summaryrefslogtreecommitdiff
authorLawrence Mok <lawrence.mok@amlogic.com>2015-05-13 21:33:59 (GMT)
committer Lawrence Mok <lawrence.mok@amlogic.com>2015-05-13 21:33:59 (GMT)
commite6c4553a0af24b8762b7c49f754227f0454e3395 (patch)
treedb317f97a6e136cf5e0752a4f39108a94c2ee244
parente1848aa469b7fc7f65df7656593ce382923e7371 (diff)
downloadffmpeg-e6c4553a0af24b8762b7c49f754227f0454e3395.zip
ffmpeg-e6c4553a0af24b8762b7c49f754227f0454e3395.tar.gz
ffmpeg-e6c4553a0af24b8762b7c49f754227f0454e3395.tar.bz2
Amlogic modifications
from commit f292c3c1d19937805e098ed6959b090009698653 Author: Jian Xu <jian.xu@amlogic.com> Date: Sun May 10 13:22:35 2015 +0800 Change-Id: I66da6be6c55095a0a23a37cd6c590b96ca3d785d
Diffstat
-rw-r--r--.gitignore5
-rwxr-xr-xAndroid.mk1211
-rw-r--r--config.h1638
-rw-r--r--libavcodec/ac3.c231
-rw-r--r--libavcodec/ac3dec.c1493
-rw-r--r--libavcodec/ac3dec.h241
-rw-r--r--libavcodec/ac3dec_data.c60
-rw-r--r--libavcodec/ac3dec_data.h32
-rw-r--r--libavcodec/ac3dsp.c263
-rw-r--r--libavcodec/ac3dsp.h144
-rw-r--r--libavcodec/ac3enc.c2491
-rw-r--r--libavcodec/ac3enc.h308
-rw-r--r--libavcodec/ac3enc_fixed.c169
-rw-r--r--libavcodec/ac3enc_float.c168
-rw-r--r--libavcodec/ac3enc_opts_template.c80
-rw-r--r--libavcodec/ac3enc_template.c447
-rw-r--r--libavcodec/arm/ac3dsp_arm.S36
-rw-r--r--libavcodec/arm/ac3dsp_armv6.S84
-rw-r--r--libavcodec/arm/ac3dsp_init_arm.c70
-rw-r--r--libavcodec/arm/ac3dsp_neon.S154
-rw-r--r--libavcodec/arm/dca.h103
-rw-r--r--libavcodec/arm/dcadsp_init_arm.c70
-rw-r--r--libavcodec/arm/dcadsp_neon.S61
-rw-r--r--libavcodec/arm/dcadsp_vfp.S493
-rw-r--r--libavcodec/dcadata.h7664
-rw-r--r--libavcodec/dcadec.c2521
-rw-r--r--libavcodec/dcadsp.c82
-rw-r--r--libavcodec/dcadsp.h39
-rw-r--r--libavcodec/dcaenc.c974
-rw-r--r--libavcodec/dcaenc.h113
-rw-r--r--libavcodec/dcahuff.h1076
-rw-r--r--libavcodec/eac3_data.c1134
-rw-r--r--libavcodec/eac3_data.h36
-rw-r--r--libavcodec/eac3dec.c607
-rw-r--r--libavcodec/eac3enc.c270
-rw-r--r--libavcodec/eac3enc.h54
-rwxr-xr-x[-rw-r--r--]libavcodec/hevc_parser.c53
-rw-r--r--libavcodec/mips/ac3dsp_mips.c412
-rw-r--r--libavcodec/mlp.c115
-rw-r--r--libavcodec/mlp_parser.c25
-rw-r--r--libavcodec/mlpdec.c1275
-rw-r--r--libavcodec/mlpdsp.c65
-rw-r--r--libavcodec/mlpdsp.h37
-rw-r--r--libavcodec/synth_filter.c2
-rw-r--r--libavcodec/x86/ac3dsp.asm421
-rw-r--r--libavcodec/x86/ac3dsp_init.c231
-rw-r--r--libavcodec/x86/mlpdsp.c186
-rwxr-xr-x[-rw-r--r--]libavformat/aacdec.c24
-rw-r--r--libavformat/ac3parser.c (renamed from libavformat/ac3dec.c)24
-rwxr-xr-xlibavformat/adif.c225
-rwxr-xr-xlibavformat/adif.h60
-rwxr-xr-x[-rw-r--r--]libavformat/asfdec.c87
-rwxr-xr-x[-rw-r--r--]libavformat/avformat.h6
-rw-r--r--libavformat/dca_parser.c (renamed from libavformat/dtsdec.c)2
-rw-r--r--libavformat/dcahd_parser.c (renamed from libavformat/dtshddec.c)0
-rwxr-xr-x[-rw-r--r--]libavformat/flv.h3
-rwxr-xr-x[-rw-r--r--]libavformat/flvdec.c74
-rw-r--r--libavformat/id3v1.c52
-rwxr-xr-x[-rw-r--r--]libavformat/id3v2.c94
-rw-r--r--libavformat/mov.c361
-rw-r--r--libavformat/mp3dec.c83
-rwxr-xr-x[-rw-r--r--]libavformat/mpegts.c95
-rwxr-xr-x[-rw-r--r--]libavformat/utils.c3
-rw-r--r--libavformat/vorbiscomment.c4
-rw-r--r--libavutil/avconfig.h8
-rwxr-xr-x[-rw-r--r--]libavutil/log.c18
66 files changed, 4121 insertions, 24546 deletions
diff --git a/.gitignore b/.gitignore
index 1f13ec4..bff00f7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,8 +25,10 @@
/ffplay
/ffprobe
/ffserver
-/config.*
/coverage.info
+/config.fate
+/config.log
+/config.mak
/version.h
/doc/*.1
/doc/*.3
@@ -51,7 +53,6 @@
/libavcodec/*_tablegen
/libavcodec/*_tables.c
/libavcodec/*_tables.h
-/libavutil/avconfig.h
/tests/audiogen
/tests/base64
/tests/data/
diff --git a/Android.mk b/Android.mk
new file mode 100755
index 0000000..dcd81b7
--- a/dev/null
+++ b/Android.mk
@@ -0,0 +1,1211 @@
+LOCAL_PATH := $(call my-dir)
+
+FFMPEG_CFLAGS := \
+ -DHAVE_AV_CONFIG_H \
+ -I$(LOCAL_PATH) \
+ -Wno-error=return-type \
+ -Wno-missing-field-initializers \
+ -Wno-parentheses \
+ -Wno-pointer-sign \
+ -Wno-sign-compare \
+ -Wno-switch \
+ -fPIC
+
+FFMPEG_LDFLAGS := -Wl,--as-needed -Wl,-Bsymbolic -lm -Wl,--no-warn-shared-textrel
+
+ifeq ($(TARGET_ARCH),arm)
+# Generated by configure. Should match the list of source files in
+# FFMPEG_LOCAL_SRC_FILES_armv* below. See libavcodec/<arch>/Makefile.
+FFMPEG_CFLAGS_armv4t := \
+ -DHAVE_ARMV5TE=0 \
+ -DHAVE_ARMV6=0 \
+ -DHAVE_ARMV6T2=0 \
+ -DHAVE_NEON=0
+FFMPEG_CFLAGS_armv5te := \
+ -DHAVE_ARMV5TE=1 \
+ -DHAVE_ARMV6=0 \
+ -DHAVE_ARMV6T2=0 \
+ -DHAVE_NEON=0
+FFMPEG_CFLAGS_armv5te-vfp := \
+ -DHAVE_ARMV5TE=1 \
+ -DHAVE_ARMV6=0 \
+ -DHAVE_ARMV6T2=0 \
+ -DHAVE_NEON=0
+FFMPEG_CFLAGS_armv7-a := \
+ -DHAVE_ARMV5TE=0 \
+ -DHAVE_ARMV6=0 \
+ -DHAVE_ARMV6T2=1 \
+ -DHAVE_NEON=0
+FFMPEG_CFLAGS_armv7-a-neon := \
+ -DHAVE_ARMV5TE=1 \
+ -DHAVE_ARMV6=1 \
+ -DHAVE_ARMV6T2=1 \
+ -DHAVE_NEON=1
+FFMPEG_CFLAGS += \
+ -std=c99 \
+ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
+ -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 \
+ ${FFMPEG_CFLAGS_$(TARGET_ARCH_VARIANT)}
+endif
+
+##### libavutil
+
+FFMPEG_LIBAVUTIL_SRC_FILES := \
+ libavutil/adler32.c \
+ libavutil/aes.c \
+ libavutil/arm/asm.S \
+ libavutil/arm/cpu.c \
+ libavutil/arm/float_dsp_init_arm.c \
+ libavutil/arm/float_dsp_init_neon.c \
+ libavutil/arm/float_dsp_init_vfp.c \
+ libavutil/arm/float_dsp_neon.S \
+ libavutil/arm/float_dsp_vfp.S \
+ libavutil/audio_fifo.c \
+ libavutil/avstring.c \
+ libavutil/base64.c \
+ libavutil/blowfish.c \
+ libavutil/bprint.c \
+ libavutil/buffer.c \
+ libavutil/channel_layout.c \
+ libavutil/cpu.c \
+ libavutil/crc.c \
+ libavutil/des.c \
+ libavutil/dict.c \
+ libavutil/error.c \
+ libavutil/eval.c \
+ libavutil/fifo.c \
+ libavutil/file.c \
+ libavutil/file_open.c \
+ libavutil/float_dsp.c \
+ libavutil/frame.c \
+ libavutil/hash.c \
+ libavutil/hmac.c \
+ libavutil/imgutils.c \
+ libavutil/intfloat_readwrite.c \
+ libavutil/intmath.c \
+ libavutil/lfg.c \
+ libavutil/lls.c \
+ libavutil/log.c \
+ libavutil/log2_tab.c \
+ libavutil/lzo.c \
+ libavutil/mathematics.c \
+ libavutil/md5.c \
+ libavutil/mem.c \
+ libavutil/murmur3.c \
+ libavutil/opt.c \
+ libavutil/parseutils.c \
+ libavutil/pixdesc.c \
+ libavutil/random_seed.c \
+ libavutil/rational.c \
+ libavutil/rc4.c \
+ libavutil/ripemd.c \
+ libavutil/samplefmt.c \
+ libavutil/sha.c \
+ libavutil/sha512.c \
+ libavutil/time.c \
+ libavutil/timecode.c \
+ libavutil/tree.c \
+ libavutil/utils.c \
+ libavutil/xga_font_data.c \
+ libavutil/xtea.c
+
+##### libavcodec
+
+FFMPEG_LIBAVCODEC_SRC_FILES := \
+ libavcodec/012v.c \
+ libavcodec/4xm.c \
+ libavcodec/8bps.c \
+ libavcodec/8svx.c \
+ libavcodec/a64multienc.c \
+ libavcodec/aac_ac3_parser.c \
+ libavcodec/aac_adtstoasc_bsf.c \
+ libavcodec/aac_parser.c \
+ libavcodec/aacadtsdec.c \
+ libavcodec/aaccoder.c \
+ libavcodec/aacdec.c \
+ libavcodec/aacenc.c \
+ libavcodec/aacps.c \
+ libavcodec/aacpsdsp.c \
+ libavcodec/aacpsy.c \
+ libavcodec/aacsbr.c \
+ libavcodec/aactab.c \
+ libavcodec/aandcttab.c \
+ libavcodec/aasc.c \
+ libavcodec/ac3_parser.c \
+ libavcodec/ac3tab.c \
+ libavcodec/acelp_filters.c \
+ libavcodec/acelp_pitch_delay.c \
+ libavcodec/acelp_vectors.c \
+ libavcodec/adpcm.c \
+ libavcodec/adpcm_data.c \
+ libavcodec/adpcmenc.c \
+ libavcodec/adx.c \
+ libavcodec/adx_parser.c \
+ libavcodec/adxdec.c \
+ libavcodec/adxenc.c \
+ libavcodec/aic.c \
+ libavcodec/alac.c \
+ libavcodec/alac_data.c \
+ libavcodec/alacenc.c \
+ libavcodec/allcodecs.c \
+ libavcodec/alsdec.c \
+ libavcodec/amrwbdec.c \
+ libavcodec/anm.c \
+ libavcodec/ansi.c \
+ libavcodec/apedec.c \
+ libavcodec/ass.c \
+ libavcodec/ass_split.c \
+ libavcodec/assdec.c \
+ libavcodec/assenc.c \
+ libavcodec/asv.c \
+ libavcodec/asvdec.c \
+ libavcodec/asvenc.c \
+ libavcodec/atrac.c \
+ libavcodec/atrac1.c \
+ libavcodec/atrac3.c \
+ libavcodec/audio_frame_queue.c \
+ libavcodec/audioconvert.c \
+ libavcodec/aura.c \
+ libavcodec/avfft.c \
+ libavcodec/avpacket.c \
+ libavcodec/avpicture.c \
+ libavcodec/avrndec.c \
+ libavcodec/avs.c \
+ libavcodec/avuidec.c \
+ libavcodec/avuienc.c \
+ libavcodec/bethsoftvideo.c \
+ libavcodec/bfi.c \
+ libavcodec/bgmc.c \
+ libavcodec/bink.c \
+ libavcodec/binkaudio.c \
+ libavcodec/binkdsp.c \
+ libavcodec/bintext.c \
+ libavcodec/bitstream.c \
+ libavcodec/bitstream_filter.c \
+ libavcodec/bmp.c \
+ libavcodec/bmp_parser.c \
+ libavcodec/bmpenc.c \
+ libavcodec/bmv.c \
+ libavcodec/brender_pix.c \
+ libavcodec/c93.c \
+ libavcodec/cabac.c \
+ libavcodec/cavs_parser.c \
+ libavcodec/cdgraphics.c \
+ libavcodec/cdxl.c \
+ libavcodec/celp_filters.c \
+ libavcodec/celp_math.c \
+ libavcodec/cga_data.c \
+ libavcodec/chomp_bsf.c \
+ libavcodec/cinepak.c \
+ libavcodec/cljr.c \
+ libavcodec/cllc.c \
+ libavcodec/cngdec.c \
+ libavcodec/cngenc.c \
+ libavcodec/codec_desc.c \
+ libavcodec/cook.c \
+ libavcodec/cook_parser.c \
+ libavcodec/cpia.c \
+ libavcodec/cscd.c \
+ libavcodec/cyuv.c \
+ libavcodec/dca.c \
+ libavcodec/dca_parser.c \
+ libavcodec/dct.c \
+ libavcodec/dct32_fixed.c \
+ libavcodec/dct32_float.c \
+ libavcodec/dfa.c \
+ libavcodec/dirac.c \
+ libavcodec/dirac_arith.c \
+ libavcodec/dirac_dwt.c \
+ libavcodec/dirac_parser.c \
+ libavcodec/diracdec.c \
+ libavcodec/diracdsp.c \
+ libavcodec/dnxhd_parser.c \
+ libavcodec/dnxhddata.c \
+ libavcodec/dnxhddec.c \
+ libavcodec/dnxhdenc.c \
+ libavcodec/dpcm.c \
+ libavcodec/dpx.c \
+ libavcodec/dpx_parser.c \
+ libavcodec/dpxenc.c \
+ libavcodec/dsicinav.c \
+ libavcodec/dsputil.c \
+ libavcodec/dump_extradata_bsf.c \
+ libavcodec/dv.c \
+ libavcodec/dv_profile.c \
+ libavcodec/dvbsub.c \
+ libavcodec/dvbsub_parser.c \
+ libavcodec/dvbsubdec.c \
+ libavcodec/dvdata.c \
+ libavcodec/dvdec.c \
+ libavcodec/dvdsub_parser.c \
+ libavcodec/dvd_nav_parser.c \
+ libavcodec/dvdsubdec.c \
+ libavcodec/dvdsubenc.c \
+ libavcodec/dxtory.c \
+ libavcodec/eacmv.c \
+ libavcodec/eaidct.c \
+ libavcodec/eamad.c \
+ libavcodec/eatgq.c \
+ libavcodec/eatgv.c \
+ libavcodec/eatqi.c \
+ libavcodec/elbg.c \
+ libavcodec/error_resilience.c \
+ libavcodec/escape124.c \
+ libavcodec/escape130.c \
+ libavcodec/evrcdec.c \
+ libavcodec/exif.c \
+ libavcodec/faandct.c \
+ libavcodec/faanidct.c \
+ libavcodec/faxcompr.c \
+ libavcodec/fft_fixed.c \
+ libavcodec/fft_float.c \
+ libavcodec/ffv1.c \
+ libavcodec/ffv1dec.c \
+ libavcodec/ffv1enc.c \
+ libavcodec/ffwavesynth.c \
+ libavcodec/flac.c \
+ libavcodec/flac_parser.c \
+ libavcodec/flacdata.c \
+ libavcodec/flacdec.c \
+ libavcodec/flacdsp.c \
+ libavcodec/flicvideo.c \
+ libavcodec/flvdec.c \
+ libavcodec/flvenc.c \
+ libavcodec/fmtconvert.c \
+ libavcodec/frame_thread_encoder.c \
+ libavcodec/fraps.c \
+ libavcodec/frwu.c \
+ libavcodec/g722.c \
+ libavcodec/g722dec.c \
+ libavcodec/g722enc.c \
+ libavcodec/g723_1.c \
+ libavcodec/g726.c \
+ libavcodec/g729dec.c \
+ libavcodec/g729postfilter.c \
+ libavcodec/gif.c \
+ libavcodec/gifdec.c \
+ libavcodec/golomb.c \
+ libavcodec/gsm_parser.c \
+ libavcodec/gsmdec.c \
+ libavcodec/gsmdec_data.c \
+ libavcodec/h261.c \
+ libavcodec/h261_parser.c \
+ libavcodec/h261data.c \
+ libavcodec/h261dec.c \
+ libavcodec/h261enc.c \
+ libavcodec/h263.c \
+ libavcodec/h263_parser.c \
+ libavcodec/h263dec.c \
+ libavcodec/h264.c \
+ libavcodec/h264_cabac.c \
+ libavcodec/h264_cavlc.c \
+ libavcodec/h264_direct.c \
+ libavcodec/h264_loopfilter.c \
+ libavcodec/h264_mp4toannexb_bsf.c \
+ libavcodec/h264_parser.c \
+ libavcodec/h264_ps.c \
+ libavcodec/h264_refs.c \
+ libavcodec/h264_sei.c \
+ libavcodec/h264chroma.c \
+ libavcodec/h264dsp.c \
+ libavcodec/h264idct.c \
+ libavcodec/h264pred.c \
+ libavcodec/h264qpel.c \
+ libavcodec/hevc_mvs.c \
+ libavcodec/hevc_ps.c \
+ libavcodec/hevc_filter.c \
+ libavcodec/hevcdsp.c \
+ libavcodec/hevc_cabac.c \
+ libavcodec/hevc_sei.c \
+ libavcodec/hevc_refs.c \
+ libavcodec/hevc.c \
+ libavcodec/hevcpred.c \
+ libavcodec/hevc_parser.c \
+ libavcodec/hpeldsp.c \
+ libavcodec/huffman.c \
+ libavcodec/huffyuv.c \
+ libavcodec/huffyuvdec.c \
+ libavcodec/huffyuvenc.c \
+ libavcodec/idcinvideo.c \
+ libavcodec/iff.c \
+ libavcodec/iirfilter.c \
+ libavcodec/imc.c \
+ libavcodec/imgconvert.c \
+ libavcodec/imx_dump_header_bsf.c \
+ libavcodec/indeo2.c \
+ libavcodec/indeo3.c \
+ libavcodec/indeo4.c \
+ libavcodec/indeo5.c \
+ libavcodec/intelh263dec.c \
+ libavcodec/interplayvideo.c \
+ libavcodec/intrax8.c \
+ libavcodec/intrax8dsp.c \
+ libavcodec/ituh263dec.c \
+ libavcodec/ituh263enc.c \
+ libavcodec/ivi_common.c \
+ libavcodec/ivi_dsp.c \
+ libavcodec/j2kenc.c \
+ libavcodec/jacosubdec.c \
+ libavcodec/jfdctfst.c \
+ libavcodec/jfdctint.c \
+ libavcodec/jpegls.c \
+ libavcodec/jpeglsdec.c \
+ libavcodec/jpeglsenc.c \
+ libavcodec/jpeg2000.c \
+ libavcodec/jpeg2000dec.c \
+ libavcodec/jpeg2000dwt.c \
+ libavcodec/jrevdct.c \
+ libavcodec/jvdec.c \
+ libavcodec/kbdwin.c \
+ libavcodec/kgv1dec.c \
+ libavcodec/kmvc.c \
+ libavcodec/lagarith.c \
+ libavcodec/lagarithrac.c \
+ libavcodec/latm_parser.c \
+ libavcodec/lcldec.c \
+ libavcodec/ljpegenc.c \
+ libavcodec/loco.c \
+ libavcodec/lpc.c \
+ libavcodec/lsp.c \
+ libavcodec/lzw.c \
+ libavcodec/lzwenc.c \
+ libavcodec/mace.c \
+ libavcodec/mathtables.c \
+ libavcodec/mdct_fixed.c \
+ libavcodec/mdct_float.c \
+ libavcodec/mdec.c \
+ libavcodec/metasound.c \
+ libavcodec/metasound_data.c \
+ libavcodec/microdvddec.c \
+ libavcodec/mimic.c \
+ libavcodec/mjpeg.c \
+ libavcodec/mjpeg2jpeg_bsf.c \
+ libavcodec/mjpeg_parser.c \
+ libavcodec/mjpega_dump_header_bsf.c \
+ libavcodec/mjpegbdec.c \
+ libavcodec/mjpegdec.c \
+ libavcodec/mjpegenc.c \
+ libavcodec/mlp_parser.c \
+ libavcodec/mmvideo.c \
+ libavcodec/motion_est.c \
+ libavcodec/motionpixels.c \
+ libavcodec/movsub_bsf.c \
+ libavcodec/movtextdec.c \
+ libavcodec/movtextenc.c \
+ libavcodec/mp3_header_compress_bsf.c \
+ libavcodec/mp3_header_decompress_bsf.c \
+ libavcodec/mpc.c \
+ libavcodec/mpc7.c \
+ libavcodec/mpc8.c \
+ libavcodec/mpeg12.c \
+ libavcodec/mpeg12data.c \
+ libavcodec/mpeg12dec.c \
+ libavcodec/mpeg12enc.c \
+ libavcodec/mpeg4audio.c \
+ libavcodec/mpeg4video.c \
+ libavcodec/mpeg4video_parser.c \
+ libavcodec/mpeg4videodec.c \
+ libavcodec/mpeg4videoenc.c \
+ libavcodec/mpegaudio.c \
+ libavcodec/mpegaudio_parser.c \
+ libavcodec/mpegaudiodata.c \
+ libavcodec/mpegaudiodec.c \
+ libavcodec/mpegaudiodec_float.c \
+ libavcodec/mpegaudiodecheader.c \
+ libavcodec/mpegaudiodsp.c \
+ libavcodec/mpegaudiodsp_data.c \
+ libavcodec/mpegaudiodsp_fixed.c \
+ libavcodec/mpegaudiodsp_float.c \
+ libavcodec/mpegaudioenc.c \
+ libavcodec/mpegvideo.c \
+ libavcodec/mpegvideo_enc.c \
+ libavcodec/mpegvideo_motion.c \
+ libavcodec/mpegvideo_parser.c \
+ libavcodec/mpl2dec.c \
+ libavcodec/mqc.c \
+ libavcodec/mqcdec.c \
+ libavcodec/mqcenc.c \
+ libavcodec/msgsmdec.c \
+ libavcodec/msmpeg4.c \
+ libavcodec/msmpeg4data.c \
+ libavcodec/msmpeg4enc.c \
+ libavcodec/msmpeg4dec.c \
+ libavcodec/msrle.c \
+ libavcodec/msrledec.c \
+ libavcodec/mss1.c \
+ libavcodec/mss12.c \
+ libavcodec/mss2.c \
+ libavcodec/mss2dsp.c \
+ libavcodec/mss3.c \
+ libavcodec/mss34dsp.c \
+ libavcodec/mss4.c \
+ libavcodec/msvideo1.c \
+ libavcodec/msvideo1enc.c \
+ libavcodec/mvcdec.c \
+ libavcodec/mxpegdec.c \
+ libavcodec/nellymoser.c \
+ libavcodec/nellymoserdec.c \
+ libavcodec/nellymoserenc.c \
+ libavcodec/noise_bsf.c \
+ libavcodec/nuv.c \
+ libavcodec/options.c \
+ libavcodec/paf.c \
+ libavcodec/pamenc.c \
+ libavcodec/parser.c \
+ libavcodec/pcm.c \
+ libavcodec/pcm-bluray.c \
+ libavcodec/pcm-dvd.c \
+ libavcodec/pcx.c \
+ libavcodec/pcxenc.c \
+ libavcodec/pgssubdec.c \
+ libavcodec/pictordec.c \
+ libavcodec/png_parser.c \
+ libavcodec/pnm.c \
+ libavcodec/pnm_parser.c \
+ libavcodec/pnmdec.c \
+ libavcodec/pnmenc.c \
+ libavcodec/proresdata.c \
+ libavcodec/proresdec2.c \
+ libavcodec/proresdec_lgpl.c \
+ libavcodec/proresdsp.c \
+ libavcodec/proresenc_anatoliy.c \
+ libavcodec/proresenc_kostya.c \
+ libavcodec/psymodel.c \
+ libavcodec/pthread.c \
+ libavcodec/ptx.c \
+ libavcodec/qcelpdec.c \
+ libavcodec/qdm2.c \
+ libavcodec/qdrw.c \
+ libavcodec/qpeg.c \
+ libavcodec/qtrle.c \
+ libavcodec/qtrleenc.c \
+ libavcodec/r210dec.c \
+ libavcodec/r210enc.c \
+ libavcodec/ra144.c \
+ libavcodec/ra144dec.c \
+ libavcodec/ra144enc.c \
+ libavcodec/ra288.c \
+ libavcodec/ralf.c \
+ libavcodec/rangecoder.c \
+ libavcodec/ratecontrol.c \
+ libavcodec/raw.c \
+ libavcodec/rawdec.c \
+ libavcodec/rawenc.c \
+ libavcodec/rdft.c \
+ libavcodec/realtextdec.c \
+ libavcodec/remove_extradata_bsf.c \
+ libavcodec/resample.c \
+ libavcodec/resample2.c \
+ libavcodec/rl2.c \
+ libavcodec/rle.c \
+ libavcodec/roqaudioenc.c \
+ libavcodec/roqvideo.c \
+ libavcodec/roqvideodec.c \
+ libavcodec/roqvideoenc.c \
+ libavcodec/rpza.c \
+ libavcodec/rtjpeg.c \
+ libavcodec/rv10.c \
+ libavcodec/rv10enc.c \
+ libavcodec/rv20enc.c \
+ libavcodec/rv30.c \
+ libavcodec/rv30dsp.c \
+ libavcodec/rv34.c \
+ libavcodec/rv34_parser.c \
+ libavcodec/rv34dsp.c \
+ libavcodec/rv40.c \
+ libavcodec/rv40dsp.c \
+ libavcodec/s302m.c \
+ libavcodec/s302menc.c \
+ libavcodec/s3tc.c \
+ libavcodec/samidec.c \
+ libavcodec/sanm.c \
+ libavcodec/sbrdsp.c \
+ libavcodec/sgidec.c \
+ libavcodec/sgienc.c \
+ libavcodec/sgirledec.c \
+ libavcodec/shorten.c \
+ libavcodec/simple_idct.c \
+ libavcodec/sinewin.c \
+ libavcodec/sipr.c \
+ libavcodec/sipr16k.c \
+ libavcodec/smacker.c \
+ libavcodec/smc.c \
+ libavcodec/smvjpegdec.c \
+ libavcodec/snow.c \
+ libavcodec/snow_dwt.c \
+ libavcodec/snowdec.c \
+ libavcodec/snowenc.c \
+ libavcodec/sonic.c \
+ libavcodec/sp5xdec.c \
+ libavcodec/srtdec.c \
+ libavcodec/srtenc.c \
+ libavcodec/subviewerdec.c \
+ libavcodec/sunrast.c \
+ libavcodec/sunrastenc.c \
+ libavcodec/svq1.c \
+ libavcodec/svq13.c \
+ libavcodec/svq1dec.c \
+ libavcodec/svq1enc.c \
+ libavcodec/svq3.c \
+ libavcodec/synth_filter.c \
+ libavcodec/tak.c \
+ libavcodec/tak_parser.c \
+ libavcodec/takdec.c \
+ libavcodec/targa.c \
+ libavcodec/targa_y216dec.c \
+ libavcodec/targaenc.c \
+ libavcodec/textdec.c \
+ libavcodec/tiertexseqv.c \
+ libavcodec/tiff.c \
+ libavcodec/tiff_common.c \
+ libavcodec/tiff_data.c \
+ libavcodec/tiffenc.c \
+ libavcodec/timecode.c \
+ libavcodec/tmv.c \
+ libavcodec/truemotion1.c \
+ libavcodec/truemotion2.c \
+ libavcodec/truespeech.c \
+ libavcodec/tscc2.c \
+ libavcodec/tta.c \
+ libavcodec/ttadata.c \
+ libavcodec/ttaenc.c \
+ libavcodec/twinvq.c \
+ libavcodec/twinvqdec.c \
+ libavcodec/txd.c \
+ libavcodec/ulti.c \
+ libavcodec/utils.c \
+ libavcodec/utvideo.c \
+ libavcodec/utvideodec.c \
+ libavcodec/utvideoenc.c \
+ libavcodec/v210dec.c \
+ libavcodec/v210enc.c \
+ libavcodec/v210x.c \
+ libavcodec/v308dec.c \
+ libavcodec/v308enc.c \
+ libavcodec/v408dec.c \
+ libavcodec/v408enc.c \
+ libavcodec/v410dec.c \
+ libavcodec/v410enc.c \
+ libavcodec/vb.c \
+ libavcodec/vble.c \
+ libavcodec/vc1.c \
+ libavcodec/vc1_parser.c \
+ libavcodec/vc1data.c \
+ libavcodec/vc1dec.c \
+ libavcodec/vc1dsp.c \
+ libavcodec/vcr1.c \
+ libavcodec/videodsp.c \
+ libavcodec/vima.c \
+ libavcodec/vmdav.c \
+ libavcodec/vmnc.c \
+ libavcodec/vorbis.c \
+ libavcodec/vorbis_data.c \
+ libavcodec/vorbis_parser.c \
+ libavcodec/vorbisdec.c \
+ libavcodec/vorbisdsp.c \
+ libavcodec/vorbisenc.c \
+ libavcodec/vp3.c \
+ libavcodec/vp3_parser.c \
+ libavcodec/vp3dsp.c \
+ libavcodec/vp5.c \
+ libavcodec/vp56.c \
+ libavcodec/vp56data.c \
+ libavcodec/vp56dsp.c \
+ libavcodec/vp56rac.c \
+ libavcodec/vp6.c \
+ libavcodec/vp6dsp.c \
+ libavcodec/vp8.c \
+ libavcodec/vp8_parser.c \
+ libavcodec/vp8dsp.c \
+ libavcodec/vp9.c \
+ libavcodec/vp9dsp.c \
+ libavcodec/vqavideo.c \
+ libavcodec/wavpack.c \
+ libavcodec/wavpackenc.c \
+ libavcodec/webvttdec.c \
+ libavcodec/webp.c \
+ libavcodec/wma.c \
+ libavcodec/wma_common.c \
+ libavcodec/wmadec.c \
+ libavcodec/wmaenc.c \
+ libavcodec/wmalosslessdec.c \
+ libavcodec/wmaprodec.c \
+ libavcodec/wmavoice.c \
+ libavcodec/wmv2.c \
+ libavcodec/wmv2dec.c \
+ libavcodec/wmv2dsp.c \
+ libavcodec/wmv2enc.c \
+ libavcodec/wnv1.c \
+ libavcodec/ws-snd1.c \
+ libavcodec/xan.c \
+ libavcodec/xbmdec.c \
+ libavcodec/xbmenc.c \
+ libavcodec/xface.c \
+ libavcodec/xfacedec.c \
+ libavcodec/xfaceenc.c \
+ libavcodec/xiph.c \
+ libavcodec/xl.c \
+ libavcodec/xsubdec.c \
+ libavcodec/xsubenc.c \
+ libavcodec/xwddec.c \
+ libavcodec/xwdenc.c \
+ libavcodec/xxan.c \
+ libavcodec/y41pdec.c \
+ libavcodec/y41penc.c \
+ libavcodec/yop.c \
+ libavcodec/yuv4dec.c \
+ libavcodec/yuv4enc.c
+
+FFMPEG_LOCAL_SRC_FILES_armv4t := \
+ libavcodec/arm/aacpsdsp_init_arm.c \
+ libavcodec/arm/dsputil_arm.S \
+ libavcodec/arm/dsputil_init_arm.c \
+ libavcodec/arm/dsputil_init_vfp.c \
+ libavcodec/arm/dsputil_vfp.S \
+ libavcodec/arm/fft_fixed_init_arm.c \
+ libavcodec/arm/fft_init_arm.c \
+ libavcodec/arm/flacdsp_arm.S \
+ libavcodec/arm/flacdsp_init_arm.c \
+ libavcodec/arm/fmtconvert_init_arm.c \
+ libavcodec/arm/h264dsp_init_arm.c \
+ libavcodec/arm/h264pred_init_arm.c \
+ libavcodec/arm/jrevdct_arm.S \
+ libavcodec/arm/mpegaudiodsp_init_arm.c \
+ libavcodec/arm/mpegvideo_arm.c \
+ libavcodec/arm/rv34dsp_init_arm.c \
+ libavcodec/arm/rv40dsp_init_arm.c \
+ libavcodec/arm/sbrdsp_init_arm.c \
+ libavcodec/arm/simple_idct_arm.S \
+ libavcodec/arm/videodsp_init_arm.c \
+ libavcodec/arm/vp3dsp_init_arm.c \
+ libavcodec/arm/vp56dsp_init_arm.c \
+ libavcodec/arm/vp8dsp_init_arm.c
+
+FFMPEG_LOCAL_SRC_FILES_armv5te :=\
+ libavcodec/arm/aacpsdsp_init_arm.c \
+ libavcodec/arm/dsputil_arm.S \
+ libavcodec/arm/dsputil_init_arm.c \
+ libavcodec/arm/dsputil_init_armv5te.c \
+ libavcodec/arm/dsputil_init_vfp.c \
+ libavcodec/arm/dsputil_vfp.S \
+ libavcodec/arm/fft_fixed_init_arm.c \
+ libavcodec/arm/fft_init_arm.c \
+ libavcodec/arm/flacdsp_arm.S \
+ libavcodec/arm/flacdsp_init_arm.c \
+ libavcodec/arm/fmtconvert_init_arm.c \
+ libavcodec/arm/h264dsp_init_arm.c \
+ libavcodec/arm/h264pred_init_arm.c \
+ libavcodec/arm/jrevdct_arm.S \
+ libavcodec/arm/mpegaudiodsp_init_arm.c \
+ libavcodec/arm/mpegvideo_arm.c \
+ libavcodec/arm/mpegvideo_armv5te.c \
+ libavcodec/arm/mpegvideo_armv5te_s.S \
+ libavcodec/arm/rv34dsp_init_arm.c \
+ libavcodec/arm/rv40dsp_init_arm.c \
+ libavcodec/arm/sbrdsp_init_arm.c \
+ libavcodec/arm/simple_idct_arm.S \
+ libavcodec/arm/simple_idct_armv5te.S \
+ libavcodec/arm/videodsp_armv5te.S \
+ libavcodec/arm/videodsp_init_arm.c \
+ libavcodec/arm/videodsp_init_armv5te.c \
+ libavcodec/arm/vp3dsp_init_arm.c \
+ libavcodec/arm/vp56dsp_init_arm.c \
+ libavcodec/arm/vp8dsp_init_arm.c
+
+FFMPEG_LOCAL_SRC_FILES_armv7-a :=\
+ libavcodec/arm/aacpsdsp_init_arm.c \
+ libavcodec/arm/dcadsp_init_arm.c \
+ libavcodec/arm/dsputil_arm.S \
+ libavcodec/arm/dsputil_init_arm.c \
+ libavcodec/arm/dsputil_init_vfp.c \
+ libavcodec/arm/dsputil_vfp.S \
+ libavcodec/arm/fft_fixed_init_arm.c \
+ libavcodec/arm/fft_init_arm.c \
+ libavcodec/arm/flacdsp_arm.S \
+ libavcodec/arm/flacdsp_init_arm.c \
+ libavcodec/arm/fmtconvert_init_arm.c \
+ libavcodec/arm/h264dsp_init_arm.c \
+ libavcodec/arm/h264pred_init_arm.c \
+ libavcodec/arm/jrevdct_arm.S \
+ libavcodec/arm/mpegaudiodsp_init_arm.c \
+ libavcodec/arm/mpegvideo_arm.c \
+ libavcodec/arm/rv34dsp_init_arm.c \
+ libavcodec/arm/rv40dsp_init_arm.c \
+ libavcodec/arm/sbrdsp_init_arm.c \
+ libavcodec/arm/simple_idct_arm.S \
+ libavcodec/arm/videodsp_init_arm.c \
+ libavcodec/arm/vp3dsp_init_arm.c \
+ libavcodec/arm/vp56dsp_init_arm.c \
+ libavcodec/arm/vp8dsp_init_arm.c
+
+FFMPEG_LOCAL_SRC_FILES_armv7-a-neon :=\
+ libavcodec/arm/aacpsdsp_init_arm.c \
+ libavcodec/arm/aacpsdsp_neon.S \
+ libavcodec/arm/dsputil_arm.S \
+ libavcodec/arm/dsputil_armv6.S \
+ libavcodec/arm/dsputil_init_arm.c \
+ libavcodec/arm/dsputil_init_armv5te.c \
+ libavcodec/arm/dsputil_init_armv6.c \
+ libavcodec/arm/dsputil_init_neon.c \
+ libavcodec/arm/dsputil_neon.S \
+ libavcodec/arm/fft_fixed_init_arm.c \
+ libavcodec/arm/fft_fixed_neon.S \
+ libavcodec/arm/fft_init_arm.c \
+ libavcodec/arm/fft_neon.S \
+ libavcodec/arm/fft_vfp.S \
+ libavcodec/arm/flacdsp_arm.S \
+ libavcodec/arm/flacdsp_init_arm.c \
+ libavcodec/arm/fmtconvert_init_arm.c \
+ libavcodec/arm/fmtconvert_neon.S \
+ libavcodec/arm/fmtconvert_vfp.S \
+ libavcodec/arm/fmtconvert_vfp_armv6.S \
+ libavcodec/arm/h264chroma_init_arm.c \
+ libavcodec/arm/h264cmc_neon.S \
+ libavcodec/arm/h264dsp_armv6.S \
+ libavcodec/arm/h264dsp_init_arm.c \
+ libavcodec/arm/h264dsp_neon.S \
+ libavcodec/arm/h264idct_neon.S \
+ libavcodec/arm/h264pred_init_arm.c \
+ libavcodec/arm/h264pred_neon.S \
+ libavcodec/arm/h264qpel_init_arm.c \
+ libavcodec/arm/h264qpel_neon.S \
+ libavcodec/arm/hpeldsp_arm.S \
+ libavcodec/arm/hpeldsp_armv6.S \
+ libavcodec/arm/hpeldsp_init_arm.c \
+ libavcodec/arm/hpeldsp_init_armv6.c \
+ libavcodec/arm/hpeldsp_init_neon.c \
+ libavcodec/arm/hpeldsp_neon.S \
+ libavcodec/arm/int_neon.S \
+ libavcodec/arm/jrevdct_arm.S \
+ libavcodec/arm/mdct_fixed_neon.S \
+ libavcodec/arm/mdct_neon.S \
+ libavcodec/arm/mdct_vfp.S \
+ libavcodec/arm/mpegaudiodsp_fixed_armv6.S \
+ libavcodec/arm/mpegaudiodsp_init_arm.c \
+ libavcodec/arm/mpegvideo_arm.c \
+ libavcodec/arm/mpegvideo_armv5te.c \
+ libavcodec/arm/mpegvideo_armv5te_s.S \
+ libavcodec/arm/mpegvideo_neon.S \
+ libavcodec/arm/neon.S \
+ libavcodec/arm/rdft_neon.S \
+ libavcodec/arm/rv34dsp_init_arm.c \
+ libavcodec/arm/rv34dsp_neon.S \
+ libavcodec/arm/rv40dsp_init_arm.c \
+ libavcodec/arm/rv40dsp_neon.S \
+ libavcodec/arm/sbrdsp_init_arm.c \
+ libavcodec/arm/sbrdsp_neon.S \
+ libavcodec/arm/simple_idct_arm.S \
+ libavcodec/arm/simple_idct_armv5te.S \
+ libavcodec/arm/simple_idct_armv6.S \
+ libavcodec/arm/simple_idct_neon.S \
+ libavcodec/arm/synth_filter_neon.S \
+ libavcodec/arm/synth_filter_vfp.S \
+ libavcodec/arm/videodsp_armv5te.S \
+ libavcodec/arm/videodsp_init_arm.c \
+ libavcodec/arm/videodsp_init_armv5te.c \
+ libavcodec/arm/vorbisdsp_init_arm.c \
+ libavcodec/arm/vorbisdsp_neon.S \
+ libavcodec/arm/vp3dsp_init_arm.c \
+ libavcodec/arm/vp3dsp_neon.S \
+ libavcodec/arm/vp6dsp_init_arm.c \
+ libavcodec/arm/vp6dsp_neon.S \
+ libavcodec/arm/vp8_armv6.S \
+ libavcodec/arm/vp8dsp_armv6.S \
+ libavcodec/arm/vp8dsp_init_arm.c \
+ libavcodec/arm/vp8dsp_init_armv6.c \
+ libavcodec/arm/vp8dsp_init_neon.c \
+ libavcodec/arm/vp8dsp_neon.S
+
+##### libavformat
+
+FFMPEG_LIBAVFORMAT_SRC_FILES := \
+ libavformat/4xm.c \
+ libavformat/a64.c \
+ libavformat/aacdec.c \
+ libavformat/adif.c \
+ libavformat/ac3parser.c \
+ libavformat/act.c \
+ libavformat/adtsenc.c \
+ libavformat/adxdec.c \
+ libavformat/adp.c \
+ libavformat/aea.c \
+ libavformat/afc.c \
+ libavformat/aiffdec.c \
+ libavformat/aiffenc.c \
+ libavformat/allformats.c \
+ libavformat/amr.c \
+ libavformat/anm.c \
+ libavformat/apc.c \
+ libavformat/ape.c \
+ libavformat/apetag.c \
+ libavformat/aqtitledec.c \
+ libavformat/asf.c \
+ libavformat/asfcrypt.c \
+ libavformat/asfdec.c \
+ libavformat/asfenc.c \
+ libavformat/assdec.c \
+ libavformat/assenc.c \
+ libavformat/ast.c \
+ libavformat/astdec.c \
+ libavformat/astenc.c \
+ libavformat/au.c \
+ libavformat/audiointerleave.c \
+ libavformat/avc.c \
+ libavformat/avidec.c \
+ libavformat/avienc.c \
+ libavformat/avio.c \
+ libavformat/aviobuf.c \
+ libavformat/avlanguage.c \
+ libavformat/avr.c \
+ libavformat/avs.c \
+ libavformat/bethsoftvid.c \
+ libavformat/bfi.c \
+ libavformat/bink.c \
+ libavformat/bintext.c \
+ libavformat/bit.c \
+ libavformat/bmv.c \
+ libavformat/boadec.c \
+ libavformat/brstm.c \
+ libavformat/c93.c \
+ libavformat/cache.c \
+ libavformat/caf.c \
+ libavformat/cafdec.c \
+ libavformat/cafenc.c \
+ libavformat/cavsvideodec.c \
+ libavformat/cdg.c \
+ libavformat/cdxl.c \
+ libavformat/concat.c \
+ libavformat/concatdec.c \
+ libavformat/crcenc.c \
+ libavformat/crypto.c \
+ libavformat/cutils.c \
+ libavformat/data_uri.c \
+ libavformat/daud.c \
+ libavformat/dfa.c \
+ libavformat/diracdec.c \
+ libavformat/dnxhddec.c \
+ libavformat/dsicin.c \
+ libavformat/dca_parser.c \
+ libavformat/dcahd_parser.c \
+ libavformat/dv.c \
+ libavformat/dvenc.c \
+ libavformat/dxa.c \
+ libavformat/eacdata.c \
+ libavformat/electronicarts.c \
+ libavformat/epafdec.c \
+ libavformat/ffmdec.c \
+ libavformat/ffmenc.c \
+ libavformat/ffmetadec.c \
+ libavformat/ffmetaenc.c \
+ libavformat/format.c \
+ libavformat/file.c \
+ libavformat/filmstripdec.c \
+ libavformat/filmstripenc.c \
+ libavformat/flac_picture.c \
+ libavformat/flacdec.c \
+ libavformat/flacenc.c \
+ libavformat/flacenc_header.c \
+ libavformat/flic.c \
+ libavformat/flvdec.c \
+ libavformat/flvenc.c \
+ libavformat/framecrcenc.c \
+ libavformat/framehash.c \
+ libavformat/frmdec.c \
+ libavformat/ftp.c \
+ libavformat/g722.c \
+ libavformat/g723_1.c \
+ libavformat/g729dec.c \
+ libavformat/gif.c \
+ libavformat/gifdec.c \
+ libavformat/gopher.c \
+ libavformat/gsmdec.c \
+ libavformat/gxf.c \
+ libavformat/gxfenc.c \
+ libavformat/h261dec.c \
+ libavformat/h263dec.c \
+ libavformat/h264dec.c \
+ libavformat/hevcdec.c \
+ libavformat/hls.c \
+ libavformat/hlsenc.c \
+ libavformat/hlsproto.c \
+ libavformat/http.c \
+ libavformat/httpauth.c \
+ libavformat/icodec.c \
+ libavformat/icoenc.c \
+ libavformat/id3v1.c \
+ libavformat/id3v2.c \
+ libavformat/id3v2enc.c \
+ libavformat/idcin.c \
+ libavformat/idroqdec.c \
+ libavformat/idroqenc.c \
+ libavformat/iff.c \
+ libavformat/ilbc.c \
+ libavformat/img2.c \
+ libavformat/img2dec.c \
+ libavformat/img2enc.c \
+ libavformat/ingenientdec.c \
+ libavformat/ipmovie.c \
+ libavformat/ircam.c \
+ libavformat/ircamdec.c \
+ libavformat/ircamenc.c \
+ libavformat/isom.c \
+ libavformat/iss.c \
+ libavformat/iv8.c \
+ libavformat/ivfdec.c \
+ libavformat/ivfenc.c \
+ libavformat/jacosubdec.c \
+ libavformat/jacosubenc.c \
+ libavformat/jvdec.c \
+ libavformat/latmenc.c \
+ libavformat/lmlm4.c \
+ libavformat/loasdec.c \
+ libavformat/lvfdec.c \
+ libavformat/lxfdec.c \
+ libavformat/m4vdec.c \
+ libavformat/matroska.c \
+ libavformat/matroskadec.c \
+ libavformat/matroskaenc.c \
+ libavformat/md5enc.c \
+ libavformat/md5proto.c \
+ libavformat/metadata.c \
+ libavformat/mgsts.c \
+ libavformat/microdvddec.c \
+ libavformat/microdvdenc.c \
+ libavformat/mkvtimestamp_v2.c \
+ libavformat/mm.c \
+ libavformat/mmf.c \
+ libavformat/mms.c \
+ libavformat/mmsh.c \
+ libavformat/mmst.c \
+ libavformat/mov.c \
+ libavformat/mov_chan.c \
+ libavformat/movenc.c \
+ libavformat/movenchint.c \
+ libavformat/mp3dec.c \
+ libavformat/mp3enc.c \
+ libavformat/mpc.c \
+ libavformat/mpc8.c \
+ libavformat/mpeg.c \
+ libavformat/mpegenc.c \
+ libavformat/mpegts.c \
+ libavformat/mpegtsenc.c \
+ libavformat/mpegvideodec.c \
+ libavformat/mpjpeg.c \
+ libavformat/mpl2dec.c \
+ libavformat/mpsubdec.c \
+ libavformat/msnwc_tcp.c \
+ libavformat/mtv.c \
+ libavformat/mux.c \
+ libavformat/mvdec.c \
+ libavformat/mvi.c \
+ libavformat/mxf.c \
+ libavformat/mxfdec.c \
+ libavformat/mxfenc.c \
+ libavformat/mxg.c \
+ libavformat/ncdec.c \
+ libavformat/network.c \
+ libavformat/nistspheredec.c \
+ libavformat/nsvdec.c \
+ libavformat/nullenc.c \
+ libavformat/nut.c \
+ libavformat/nutdec.c \
+ libavformat/nutenc.c \
+ libavformat/nuv.c \
+ libavformat/oggdec.c \
+ libavformat/oggenc.c \
+ libavformat/oggparsecelt.c \
+ libavformat/oggparsedirac.c \
+ libavformat/oggparseflac.c \
+ libavformat/oggparseogm.c \
+ libavformat/oggparseopus.c \
+ libavformat/oggparseskeleton.c \
+ libavformat/oggparsespeex.c \
+ libavformat/oggparsetheora.c \
+ libavformat/oggparsevorbis.c \
+ libavformat/oma.c \
+ libavformat/omadec.c \
+ libavformat/omaenc.c \
+ libavformat/options.c \
+ libavformat/os_support.c \
+ libavformat/paf.c \
+ libavformat/pcm.c \
+ libavformat/pcmdec.c \
+ libavformat/pcmenc.c \
+ libavformat/pjsdec.c \
+ libavformat/pmpdec.c \
+ libavformat/psxstr.c \
+ libavformat/pva.c \
+ libavformat/pvfdec.c \
+ libavformat/qcp.c \
+ libavformat/r3d.c \
+ libavformat/rawdec.c \
+ libavformat/rawenc.c \
+ libavformat/rawvideodec.c \
+ libavformat/rdt.c \
+ libavformat/realtextdec.c \
+ libavformat/redspark.c \
+ libavformat/riff.c \
+ libavformat/riffdec.c \
+ libavformat/riffenc.c \
+ libavformat/rl2.c \
+ libavformat/rm.c \
+ libavformat/rmdec.c \
+ libavformat/rmenc.c \
+ libavformat/rmsipr.c \
+ libavformat/rpl.c \
+ libavformat/rsd.c \
+ libavformat/rso.c \
+ libavformat/rsodec.c \
+ libavformat/rsoenc.c \
+ libavformat/rtmphttp.c \
+ libavformat/rtmppkt.c \
+ libavformat/rtmpproto.c \
+ libavformat/rtp.c \
+ libavformat/rtpdec.c \
+ libavformat/rtpdec_amr.c \
+ libavformat/rtpdec_asf.c \
+ libavformat/rtpdec_g726.c \
+ libavformat/rtpdec_h263.c \
+ libavformat/rtpdec_h263_rfc2190.c \
+ libavformat/rtpdec_h264.c \
+ libavformat/rtpdec_ilbc.c \
+ libavformat/rtpdec_jpeg.c \
+ libavformat/rtpdec_latm.c \
+ libavformat/rtpdec_mpeg4.c \
+ libavformat/rtpdec_mpeg12.c \
+ libavformat/rtpdec_mpegts.c \
+ libavformat/rtpdec_qcelp.c \
+ libavformat/rtpdec_qdm2.c \
+ libavformat/rtpdec_qt.c \
+ libavformat/rtpdec_svq3.c \
+ libavformat/rtpdec_vp8.c \
+ libavformat/rtpdec_xiph.c \
+ libavformat/rtpenc.c \
+ libavformat/rtpenc_aac.c \
+ libavformat/rtpenc_amr.c \
+ libavformat/rtpenc_chain.c \
+ libavformat/rtpenc_h263.c \
+ libavformat/rtpenc_h263_rfc2190.c \
+ libavformat/rtpenc_h264.c \
+ libavformat/rtpenc_jpeg.c \
+ libavformat/rtpenc_latm.c \
+ libavformat/rtpenc_mpv.c \
+ libavformat/rtpenc_vp8.c \
+ libavformat/rtpenc_xiph.c \
+ libavformat/rtpproto.c \
+ libavformat/rtsp.c \
+ libavformat/rtspdec.c \
+ libavformat/rtspenc.c \
+ libavformat/samidec.c \
+ libavformat/sapdec.c \
+ libavformat/sapenc.c \
+ libavformat/sauce.c \
+ libavformat/sbgdec.c \
+ libavformat/sdp.c \
+ libavformat/seek.c \
+ libavformat/segafilm.c \
+ libavformat/segment.c \
+ libavformat/sierravmd.c \
+ libavformat/siff.c \
+ libavformat/smacker.c \
+ libavformat/smjpeg.c \
+ libavformat/smjpegdec.c \
+ libavformat/smjpegenc.c \
+ libavformat/smoothstreamingenc.c \
+ libavformat/smush.c \
+ libavformat/sol.c \
+ libavformat/soxdec.c \
+ libavformat/soxenc.c \
+ libavformat/spdif.c \
+ libavformat/spdifdec.c \
+ libavformat/spdifenc.c \
+ libavformat/srtdec.c \
+ libavformat/srtenc.c \
+ libavformat/srtp.c \
+ libavformat/srtpproto.c \
+ libavformat/subtitles.c \
+ libavformat/subviewer1dec.c \
+ libavformat/subviewerdec.c \
+ libavformat/swf.c \
+ libavformat/swfdec.c \
+ libavformat/swfenc.c \
+ libavformat/takdec.c \
+ libavformat/tcp.c \
+ libavformat/tedcaptionsdec.c \
+ libavformat/tee.c \
+ libavformat/thp.c \
+ libavformat/tiertexseq.c \
+ libavformat/tmv.c \
+ libavformat/tta.c \
+ libavformat/tty.c \
+ libavformat/txd.c \
+ libavformat/udp.c \
+ libavformat/unix.c \
+ libavformat/url.c \
+ libavformat/urldecode.c \
+ libavformat/utils.c \
+ libavformat/vc1test.c \
+ libavformat/vc1testenc.c \
+ libavformat/vivo.c \
+ libavformat/voc.c \
+ libavformat/vocdec.c \
+ libavformat/vocenc.c \
+ libavformat/vorbiscomment.c \
+ libavformat/vplayerdec.c \
+ libavformat/vqf.c \
+ libavformat/w64.c \
+ libavformat/wavdec.c \
+ libavformat/wavenc.c \
+ libavformat/wc3movie.c \
+ libavformat/webvttdec.c \
+ libavformat/webvttenc.c \
+ libavformat/westwood_aud.c \
+ libavformat/westwood_vqa.c \
+ libavformat/wtv_common.c \
+ libavformat/wtvdec.c \
+ libavformat/wtvenc.c \
+ libavformat/wv.c \
+ libavformat/wvdec.c \
+ libavformat/wvenc.c \
+ libavformat/xa.c \
+ libavformat/xmv.c \
+ libavformat/xwma.c \
+ libavformat/yop.c \
+ libavformat/yuv4mpeg.c
+
+##### libavformat
+
+FFMPEG_LIBSWSCALE_SRC_FILES := \
+ libswscale/input.c \
+ libswscale/options.c \
+ libswscale/output.c \
+ libswscale/rgb2rgb.c \
+ libswscale/swscale.c \
+ libswscale/swscale_unscaled.c \
+ libswscale/utils.c \
+ libswscale/yuv2rgb.c
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libamffmpeg
+
+LOCAL_MODULE_TAGS := optional
+
+ifeq ($(TARGET_ARCH),arm)
+LOCAL_ARM_MODE := arm
+endif
+
+LOCAL_CFLAGS := $(FFMPEG_CFLAGS) -DFF_API_AV_GETTIME=0
+
+LOCAL_LDFLAGS += $(FFMPEG_LDFLAGS)
+
+LOCAL_SRC_FILES := \
+ $(FFMPEG_LIBAVUTIL_SRC_FILES) \
+ $(FFMPEG_LIBAVCODEC_SRC_FILES) \
+ ${FFMPEG_LOCAL_SRC_FILES_$(TARGET_ARCH_VARIANT)} \
+ $(FFMPEG_LIBAVFORMAT_SRC_FILES) \
+ $(FFMPEG_LIBSWSCALE_SRC_FILES)
+
+LOCAL_SHARED_LIBRARIES := libutils liblog libdl
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/config.h b/config.h
new file mode 100644
index 0000000..b53a7a4
--- a/dev/null
+++ b/config.h
@@ -0,0 +1,1638 @@
+/* Automatically generated by configure - do not modify! */
+#ifndef FFMPEG_CONFIG_H
+#define FFMPEG_CONFIG_H
+#define FFMPEG_CONFIGURATION "--arch=arm --cross-prefix=../../prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi- --target-os=linux --disable-ffplay --disable-postproc --disable-gpl --disable-static --enable-shared --disable-encoder=flac --disable-decoder=cavs --disable-zlib --disable-decoder=amrnb --enable-pic --enable-cross-compile --sysroot=../../prebuilts/ndk/8/platforms/android-17/arch-arm --cpu=armv7-a --extra-cflags='-march=armv7-a -mfloat-abi=softfp -mfpu=neon' --enable-armv5te --enable-armv6 --enable-armv6t2 --enable-neon"
+#define FFMPEG_LICENSE "LGPL version 2.1 or later"
+#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
+#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
+#define CC_IDENT "gcc 4.7 (GCC)"
+#define av_restrict restrict
+#define EXTERN_PREFIX ""
+#define EXTERN_ASM
+#define SLIBSUF ".so"
+#define HAVE_MMX2 HAVE_MMXEXT
+#define ARCH_AARCH64 0
+#define ARCH_ALPHA 0
+#define ARCH_ARM 1
+#define ARCH_AVR32 0
+#define ARCH_AVR32_AP 0
+#define ARCH_AVR32_UC 0
+#define ARCH_BFIN 0
+#define ARCH_IA64 0
+#define ARCH_M68K 0
+#define ARCH_MIPS 0
+#define ARCH_MIPS64 0
+#define ARCH_PARISC 0
+#define ARCH_PPC 0
+#define ARCH_PPC64 0
+#define ARCH_S390 0
+#define ARCH_SH4 0
+#define ARCH_SPARC 0
+#define ARCH_SPARC64 0
+#define ARCH_TILEGX 0
+#define ARCH_TILEPRO 0
+#define ARCH_TOMI 0
+#define ARCH_X86 0
+#define ARCH_X86_32 0
+#define ARCH_X86_64 0
+#define HAVE_ARMV5TE 1
+#define HAVE_ARMV6 1
+#define HAVE_ARMV6T2 1
+#define HAVE_NEON 1
+#define HAVE_VFP 1
+#define HAVE_VFPV3 1
+#define HAVE_AMD3DNOW 0
+#define HAVE_AMD3DNOWEXT 0
+#define HAVE_AVX 0
+#define HAVE_AVX2 0
+#define HAVE_FMA4 0
+#define HAVE_I686 1
+#define HAVE_MMX 0
+#define HAVE_MMXEXT 0
+#define HAVE_SSE 0
+#define HAVE_SSE2 0
+#define HAVE_SSE3 0
+#define HAVE_SSE4 0
+#define HAVE_SSE42 0
+#define HAVE_SSSE3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_PPC4XX 0
+#define HAVE_VIS 0
+#define HAVE_MIPSFPU 0
+#define HAVE_MIPS32R2 0
+#define HAVE_MIPSDSPR1 0
+#define HAVE_MIPSDSPR2 0
+#define HAVE_ARMV5TE_EXTERNAL 1
+#define HAVE_ARMV6_EXTERNAL 1
+#define HAVE_ARMV6T2_EXTERNAL 1
+#define HAVE_NEON_EXTERNAL 1
+#define HAVE_VFP_EXTERNAL 1
+#define HAVE_VFPV3_EXTERNAL 1
+#define HAVE_AMD3DNOW_EXTERNAL 0
+#define HAVE_AMD3DNOWEXT_EXTERNAL 0
+#define HAVE_AVX_EXTERNAL 0
+#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA4_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
+#define HAVE_MMX_EXTERNAL 0
+#define HAVE_MMXEXT_EXTERNAL 0
+#define HAVE_SSE_EXTERNAL 0
+#define HAVE_SSE2_EXTERNAL 0
+#define HAVE_SSE3_EXTERNAL 0
+#define HAVE_SSE4_EXTERNAL 0
+#define HAVE_SSE42_EXTERNAL 0
+#define HAVE_SSSE3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
+#define HAVE_VIS_EXTERNAL 0
+#define HAVE_MIPSFPU_EXTERNAL 0
+#define HAVE_MIPS32R2_EXTERNAL 0
+#define HAVE_MIPSDSPR1_EXTERNAL 0
+#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_ARMV5TE_INLINE 1
+#define HAVE_ARMV6_INLINE 1
+#define HAVE_ARMV6T2_INLINE 1
+#define HAVE_NEON_INLINE 1
+#define HAVE_VFP_INLINE 1
+#define HAVE_VFPV3_INLINE 1
+#define HAVE_AMD3DNOW_INLINE 0
+#define HAVE_AMD3DNOWEXT_INLINE 0
+#define HAVE_AVX_INLINE 0
+#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA4_INLINE 0
+#define HAVE_I686_INLINE 0
+#define HAVE_MMX_INLINE 0
+#define HAVE_MMXEXT_INLINE 0
+#define HAVE_SSE_INLINE 0
+#define HAVE_SSE2_INLINE 0
+#define HAVE_SSE3_INLINE 0
+#define HAVE_SSE4_INLINE 0
+#define HAVE_SSE42_INLINE 0
+#define HAVE_SSSE3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
+#define HAVE_VIS_INLINE 0
+#define HAVE_MIPSFPU_INLINE 0
+#define HAVE_MIPS32R2_INLINE 0
+#define HAVE_MIPSDSPR1_INLINE 0
+#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_INLINE_ASM 1
+#define HAVE_SYMVER 1
+#define HAVE_YASM 0
+#define HAVE_BIGENDIAN 0
+#define HAVE_FAST_UNALIGNED 1
+#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
+#define HAVE_INCOMPATIBLE_FORK_ABI 0
+#define HAVE_PTHREADS 1
+#define HAVE_W32THREADS 0
+#define HAVE_OS2THREADS 0
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATANF 1
+#define HAVE_ATAN2F 1
+#define HAVE_CBRT 1
+#define HAVE_CBRTF 1
+#define HAVE_COSF 1
+#define HAVE_EXP2 1
+#define HAVE_EXP2F 1
+#define HAVE_EXPF 1
+#define HAVE_ISINF 1
+#define HAVE_ISNAN 1
+#define HAVE_LDEXPF 1
+#define HAVE_LLRINT 1
+#define HAVE_LLRINTF 1
+#define HAVE_LOG2 0
+#define HAVE_LOG2F 0
+#define HAVE_LOG10F 1
+#define HAVE_LRINT 1
+#define HAVE_LRINTF 1
+#define HAVE_POWF 1
+#define HAVE_RINT 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
+#define HAVE_SINF 1
+#define HAVE_TRUNC 1
+#define HAVE_TRUNCF 1
+#define HAVE_ACCESS 1
+#define HAVE_ALIGNED_MALLOC 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 1
+#define HAVE_ASM_MOD_Q 1
+#define HAVE_ASM_MOD_Y 1
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_CLOCK_GETTIME 1
+#define HAVE_CLOSESOCKET 0
+#define HAVE_COMMANDLINETOARGVW 0
+#define HAVE_CPUNOP 0
+#define HAVE_CRYPTGENRANDOM 0
+#define HAVE_DCBZL 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DLOPEN 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA_H 0
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_FCNTL 1
+#define HAVE_FORK 1
+#define HAVE_GETADDRINFO 1
+#define HAVE_GETHRTIME 0
+#define HAVE_GETOPT 1
+#define HAVE_GETPROCESSAFFINITYMASK 0
+#define HAVE_GETPROCESSMEMORYINFO 0
+#define HAVE_GETPROCESSTIMES 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
+#define HAVE_GETRUSAGE 1
+#define HAVE_GETSERVBYPORT 1
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_GLOB 0
+#define HAVE_GNU_AS 1
+#define HAVE_GSM_H 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INET_ATON 1
+#define HAVE_IO_H 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_ISATTY 1
+#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
+#define HAVE_KBHIT 0
+#define HAVE_LDBRX 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_LOCAL_ALIGNED_16 0
+#define HAVE_LOCAL_ALIGNED_8 0
+#define HAVE_LOCALTIME_R 1
+#define HAVE_LOONGSON 0
+#define HAVE_LZO1X_999_COMPRESS 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MAKEINFO 1
+#define HAVE_MALLOC_H 1
+#define HAVE_MAPVIEWOFFILE 0
+#define HAVE_MEMALIGN 1
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MKSTEMP 1
+#define HAVE_MM_EMPTY 0
+#define HAVE_MMAP 1
+#define HAVE_MPROTECT 1
+#define HAVE_MSVCRT 0
+#define HAVE_NANOSLEEP 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_PEEKNAMEDPIPE 0
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_POLL_H 1
+#define HAVE_POSIX_MEMALIGN 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_PTHREAD_CANCEL 0
+#define HAVE_RDTSC 0
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SARESTART 1
+#define HAVE_SCHED_GETAFFINITY 0
+#define HAVE_SDL 0
+#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETMODE 0
+#define HAVE_SETRLIMIT 1
+#define HAVE_SLEEP 0
+#define HAVE_SNDIO_H 0
+#define HAVE_SOCKLEN_T 1
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_STRERROR_R 1
+#define HAVE_STRUCT_ADDRINFO 1
+#define HAVE_STRUCT_GROUP_SOURCE_REQ 1
+#define HAVE_STRUCT_IP_MREQ_SOURCE 1
+#define HAVE_STRUCT_IPV6_MREQ 1
+#define HAVE_STRUCT_POLLFD 1
+#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1
+#define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
+#define HAVE_STRUCT_SOCKADDR_IN6 1
+#define HAVE_STRUCT_SOCKADDR_SA_LEN 0
+#define HAVE_STRUCT_SOCKADDR_STORAGE 1
+#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
+#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 0
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_TEXI2HTML 0
+#define HAVE_THREADS 1
+#define HAVE_UNISTD_H 1
+#define HAVE_USLEEP 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define CONFIG_BSFS 1
+#define CONFIG_DECODERS 1
+#define CONFIG_DEMUXERS 1
+#define CONFIG_ENCODERS 1
+#define CONFIG_FILTERS 1
+#define CONFIG_HWACCELS 0
+#define CONFIG_INDEVS 1
+#define CONFIG_MUXERS 1
+#define CONFIG_OUTDEVS 1
+#define CONFIG_PARSERS 1
+#define CONFIG_PROTOCOLS 1
+#define CONFIG_DOC 1
+#define CONFIG_HTMLPAGES 0
+#define CONFIG_MANPAGES 1
+#define CONFIG_PODPAGES 1
+#define CONFIG_TXTPAGES 1
+#define CONFIG_AVISYNTH 0
+#define CONFIG_BZLIB 0
+#define CONFIG_CRYSTALHD 0
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_FREI0R 0
+#define CONFIG_GNUTLS 0
+#define CONFIG_ICONV 0
+#define CONFIG_LADSPA 0
+#define CONFIG_LIBAACPLUS 0
+#define CONFIG_LIBASS 0
+#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBCACA 0
+#define CONFIG_LIBCDIO 0
+#define CONFIG_LIBCELT 0
+#define CONFIG_LIBDC1394 0
+#define CONFIG_LIBFAAC 0
+#define CONFIG_LIBFDK_AAC 0
+#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFREETYPE 0
+#define CONFIG_LIBGME 0
+#define CONFIG_LIBGSM 0
+#define CONFIG_LIBIEC61883 0
+#define CONFIG_LIBILBC 0
+#define CONFIG_LIBMODPLUG 0
+#define CONFIG_LIBMP3LAME 0
+#define CONFIG_LIBNUT 0
+#define CONFIG_LIBOPENCORE_AMRNB 0
+#define CONFIG_LIBOPENCORE_AMRWB 0
+#define CONFIG_LIBOPENCV 0
+#define CONFIG_LIBOPENJPEG 0
+#define CONFIG_LIBOPUS 0
+#define CONFIG_LIBPULSE 0
+#define CONFIG_LIBQUVI 0
+#define CONFIG_LIBRTMP 0
+#define CONFIG_LIBSCHROEDINGER 0
+#define CONFIG_LIBSHINE 0
+#define CONFIG_LIBSOXR 0
+#define CONFIG_LIBSPEEX 0
+#define CONFIG_LIBSSH 0
+#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTHEORA 0
+#define CONFIG_LIBTWOLAME 0
+#define CONFIG_LIBUTVIDEO 0
+#define CONFIG_LIBV4L2 0
+#define CONFIG_LIBVIDSTAB 0
+#define CONFIG_LIBVO_AACENC 0
+#define CONFIG_LIBVO_AMRWBENC 0
+#define CONFIG_LIBVORBIS 0
+#define CONFIG_LIBVPX 0
+#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBX264 0
+#define CONFIG_LIBXAVS 0
+#define CONFIG_LIBXVID 0
+#define CONFIG_LIBZMQ 0
+#define CONFIG_LIBZVBI 0
+#define CONFIG_OPENAL 0
+#define CONFIG_OPENCL 0
+#define CONFIG_OPENSSL 0
+#define CONFIG_X11GRAB 0
+#define CONFIG_ZLIB 0
+#define CONFIG_DXVA2 0
+#define CONFIG_VAAPI 0
+#define CONFIG_VDA 0
+#define CONFIG_VDPAU 0
+#define CONFIG_AVCODEC 1
+#define CONFIG_AVDEVICE 1
+#define CONFIG_AVFILTER 1
+#define CONFIG_AVFORMAT 1
+#define CONFIG_AVRESAMPLE 0
+#define CONFIG_AVUTIL 1
+#define CONFIG_POSTPROC 0
+#define CONFIG_SWRESAMPLE 1
+#define CONFIG_SWSCALE 1
+#define CONFIG_FFPLAY 0
+#define CONFIG_FFPROBE 1
+#define CONFIG_FFSERVER 1
+#define CONFIG_FFMPEG 1
+#define CONFIG_DCT 1
+#define CONFIG_DWT 1
+#define CONFIG_ERROR_RESILIENCE 1
+#define CONFIG_FAST_UNALIGNED 1
+#define CONFIG_FFT 1
+#define CONFIG_FTRAPV 0
+#define CONFIG_GPL 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
+#define CONFIG_INCOMPATIBLE_FORK_ABI 0
+#define CONFIG_LSP 1
+#define CONFIG_LZO 1
+#define CONFIG_MDCT 1
+#define CONFIG_MEMALIGN_HACK 0
+#define CONFIG_MEMORY_POISONING 0
+#define CONFIG_NETWORK 1
+#define CONFIG_NONFREE 0
+#define CONFIG_PIC 1
+#define CONFIG_RDFT 1
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_THUMB 0
+#define CONFIG_VERSION3 0
+#define CONFIG_XMM_CLOBBER_TEST 0
+#define CONFIG_AANDCTTABLES 1
+#define CONFIG_AC3DSP 0
+#define CONFIG_AUDIO_FRAME_QUEUE 1
+#define CONFIG_DSPUTIL 1
+#define CONFIG_EXIF 1
+#define CONFIG_FRAME_THREAD_ENCODER 1
+#define CONFIG_GCRYPT 0
+#define CONFIG_GOLOMB 1
+#define CONFIG_GPLV3 0
+#define CONFIG_H264CHROMA 1
+#define CONFIG_H264DSP 1
+#define CONFIG_H264PRED 1
+#define CONFIG_H264QPEL 1
+#define CONFIG_HPELDSP 1
+#define CONFIG_HUFFMAN 1
+#define CONFIG_LGPLV3 0
+#define CONFIG_LPC 1
+#define CONFIG_MPEGAUDIO 1
+#define CONFIG_MPEGAUDIODSP 1
+#define CONFIG_MPEGVIDEO 1
+#define CONFIG_MPEGVIDEOENC 1
+#define CONFIG_NETTLE 0
+#define CONFIG_RANGECODER 1
+#define CONFIG_RIFFDEC 1
+#define CONFIG_RIFFENC 1
+#define CONFIG_RTPDEC 1
+#define CONFIG_RTPENC_CHAIN 1
+#define CONFIG_SINEWIN 1
+#define CONFIG_VIDEODSP 1
+#define CONFIG_VP3DSP 1
+#define CONFIG_AAC_ADTSTOASC_BSF 1
+#define CONFIG_CHOMP_BSF 1
+#define CONFIG_DUMP_EXTRADATA_BSF 1
+#define CONFIG_H264_MP4TOANNEXB_BSF 1
+#define CONFIG_IMX_DUMP_HEADER_BSF 1
+#define CONFIG_MJPEG2JPEG_BSF 1
+#define CONFIG_MJPEGA_DUMP_HEADER_BSF 1
+#define CONFIG_MP3_HEADER_COMPRESS_BSF 1
+#define CONFIG_MP3_HEADER_DECOMPRESS_BSF 1
+#define CONFIG_MOV2TEXTSUB_BSF 1
+#define CONFIG_NOISE_BSF 1
+#define CONFIG_REMOVE_EXTRADATA_BSF 1
+#define CONFIG_TEXT2MOVSUB_BSF 1
+#define CONFIG_AASC_DECODER 1
+#define CONFIG_AIC_DECODER 1
+#define CONFIG_AMV_DECODER 1
+#define CONFIG_ANM_DECODER 1
+#define CONFIG_ANSI_DECODER 1
+#define CONFIG_ASV1_DECODER 1
+#define CONFIG_ASV2_DECODER 1
+#define CONFIG_AURA_DECODER 1
+#define CONFIG_AURA2_DECODER 1
+#define CONFIG_AVRP_DECODER 1
+#define CONFIG_AVRN_DECODER 1
+#define CONFIG_AVS_DECODER 1
+#define CONFIG_AVUI_DECODER 1
+#define CONFIG_AYUV_DECODER 1
+#define CONFIG_BETHSOFTVID_DECODER 1
+#define CONFIG_BFI_DECODER 1
+#define CONFIG_BINK_DECODER 1
+#define CONFIG_BMP_DECODER 1
+#define CONFIG_BMV_VIDEO_DECODER 1
+#define CONFIG_BRENDER_PIX_DECODER 1
+#define CONFIG_C93_DECODER 1
+#define CONFIG_CAVS_DECODER 0
+#define CONFIG_CDGRAPHICS_DECODER 1
+#define CONFIG_CDXL_DECODER 1
+#define CONFIG_CINEPAK_DECODER 1
+#define CONFIG_CLJR_DECODER 1
+#define CONFIG_CLLC_DECODER 1
+#define CONFIG_COMFORTNOISE_DECODER 1
+#define CONFIG_CPIA_DECODER 1
+#define CONFIG_CSCD_DECODER 1
+#define CONFIG_CYUV_DECODER 1
+#define CONFIG_DFA_DECODER 1
+#define CONFIG_DIRAC_DECODER 1
+#define CONFIG_DNXHD_DECODER 1
+#define CONFIG_DPX_DECODER 1
+#define CONFIG_DSICINVIDEO_DECODER 1
+#define CONFIG_DVVIDEO_DECODER 1
+#define CONFIG_DXA_DECODER 0
+#define CONFIG_DXTORY_DECODER 1
+#define CONFIG_EACMV_DECODER 1
+#define CONFIG_EAMAD_DECODER 1
+#define CONFIG_EATGQ_DECODER 1
+#define CONFIG_EATGV_DECODER 1
+#define CONFIG_EATQI_DECODER 1
+#define CONFIG_EIGHTBPS_DECODER 1
+#define CONFIG_EIGHTSVX_EXP_DECODER 1
+#define CONFIG_EIGHTSVX_FIB_DECODER 1
+#define CONFIG_ESCAPE124_DECODER 1
+#define CONFIG_ESCAPE130_DECODER 1
+#define CONFIG_EXR_DECODER 0
+#define CONFIG_FFV1_DECODER 1
+#define CONFIG_FFVHUFF_DECODER 1
+#define CONFIG_FLASHSV_DECODER 0
+#define CONFIG_FLASHSV2_DECODER 0
+#define CONFIG_FLIC_DECODER 1
+#define CONFIG_FLV_DECODER 1
+#define CONFIG_FOURXM_DECODER 1
+#define CONFIG_FRAPS_DECODER 1
+#define CONFIG_FRWU_DECODER 1
+#define CONFIG_G2M_DECODER 0
+#define CONFIG_GIF_DECODER 1
+#define CONFIG_H261_DECODER 1
+#define CONFIG_H263_DECODER 1
+#define CONFIG_H263I_DECODER 1
+#define CONFIG_H263P_DECODER 1
+#define CONFIG_H264_DECODER 1
+#define CONFIG_H264_CRYSTALHD_DECODER 0
+#define CONFIG_H264_VDA_DECODER 0
+#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HEVC_DECODER 1
+#define CONFIG_HUFFYUV_DECODER 1
+#define CONFIG_IDCIN_DECODER 1
+#define CONFIG_IFF_BYTERUN1_DECODER 1
+#define CONFIG_IFF_ILBM_DECODER 1
+#define CONFIG_INDEO2_DECODER 1
+#define CONFIG_INDEO3_DECODER 1
+#define CONFIG_INDEO4_DECODER 1
+#define CONFIG_INDEO5_DECODER 1
+#define CONFIG_INTERPLAY_VIDEO_DECODER 1
+#define CONFIG_JPEG2000_DECODER 1
+#define CONFIG_JPEGLS_DECODER 1
+#define CONFIG_JV_DECODER 1
+#define CONFIG_KGV1_DECODER 1
+#define CONFIG_KMVC_DECODER 1
+#define CONFIG_LAGARITH_DECODER 1
+#define CONFIG_LOCO_DECODER 1
+#define CONFIG_MDEC_DECODER 1
+#define CONFIG_MIMIC_DECODER 1
+#define CONFIG_MJPEG_DECODER 1
+#define CONFIG_MJPEGB_DECODER 1
+#define CONFIG_MMVIDEO_DECODER 1
+#define CONFIG_MOTIONPIXELS_DECODER 1
+#define CONFIG_MPEG_XVMC_DECODER 0
+#define CONFIG_MPEG1VIDEO_DECODER 1
+#define CONFIG_MPEG2VIDEO_DECODER 1
+#define CONFIG_MPEG4_DECODER 1
+#define CONFIG_MPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG4_VDPAU_DECODER 0
+#define CONFIG_MPEGVIDEO_DECODER 1
+#define CONFIG_MPEG_VDPAU_DECODER 0
+#define CONFIG_MPEG1_VDPAU_DECODER 0
+#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MSA1_DECODER 1
+#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MSMPEG4V1_DECODER 1
+#define CONFIG_MSMPEG4V2_DECODER 1
+#define CONFIG_MSMPEG4V3_DECODER 1
+#define CONFIG_MSRLE_DECODER 1
+#define CONFIG_MSS1_DECODER 1
+#define CONFIG_MSS2_DECODER 1
+#define CONFIG_MSVIDEO1_DECODER 1
+#define CONFIG_MSZH_DECODER 1
+#define CONFIG_MTS2_DECODER 1
+#define CONFIG_MVC1_DECODER 1
+#define CONFIG_MVC2_DECODER 1
+#define CONFIG_MXPEG_DECODER 1
+#define CONFIG_NUV_DECODER 1
+#define CONFIG_PAF_VIDEO_DECODER 1
+#define CONFIG_PAM_DECODER 1
+#define CONFIG_PBM_DECODER 1
+#define CONFIG_PCX_DECODER 1
+#define CONFIG_PGM_DECODER 1
+#define CONFIG_PGMYUV_DECODER 1
+#define CONFIG_PICTOR_DECODER 1
+#define CONFIG_PNG_DECODER 0
+#define CONFIG_PPM_DECODER 1
+#define CONFIG_PRORES_DECODER 1
+#define CONFIG_PRORES_LGPL_DECODER 1
+#define CONFIG_PTX_DECODER 1
+#define CONFIG_QDRAW_DECODER 1
+#define CONFIG_QPEG_DECODER 1
+#define CONFIG_QTRLE_DECODER 1
+#define CONFIG_R10K_DECODER 1
+#define CONFIG_R210_DECODER 1
+#define CONFIG_RAWVIDEO_DECODER 1
+#define CONFIG_RL2_DECODER 1
+#define CONFIG_ROQ_DECODER 1
+#define CONFIG_RPZA_DECODER 1
+#define CONFIG_RV10_DECODER 1
+#define CONFIG_RV20_DECODER 1
+#define CONFIG_RV30_DECODER 1
+#define CONFIG_RV40_DECODER 1
+#define CONFIG_S302M_DECODER 1
+#define CONFIG_SANM_DECODER 1
+#define CONFIG_SGI_DECODER 1
+#define CONFIG_SGIRLE_DECODER 1
+#define CONFIG_SMACKER_DECODER 1
+#define CONFIG_SMC_DECODER 1
+#define CONFIG_SMVJPEG_DECODER 1
+#define CONFIG_SNOW_DECODER 1
+#define CONFIG_SP5X_DECODER 1
+#define CONFIG_SUNRAST_DECODER 1
+#define CONFIG_SVQ1_DECODER 1
+#define CONFIG_SVQ3_DECODER 1
+#define CONFIG_TARGA_DECODER 1
+#define CONFIG_TARGA_Y216_DECODER 1
+#define CONFIG_THEORA_DECODER 1
+#define CONFIG_THP_DECODER 1
+#define CONFIG_TIERTEXSEQVIDEO_DECODER 1
+#define CONFIG_TIFF_DECODER 1
+#define CONFIG_TMV_DECODER 1
+#define CONFIG_TRUEMOTION1_DECODER 1
+#define CONFIG_TRUEMOTION2_DECODER 1
+#define CONFIG_TSCC_DECODER 0
+#define CONFIG_TSCC2_DECODER 1
+#define CONFIG_TXD_DECODER 1
+#define CONFIG_ULTI_DECODER 1
+#define CONFIG_UTVIDEO_DECODER 1
+#define CONFIG_V210_DECODER 1
+#define CONFIG_V210X_DECODER 1
+#define CONFIG_V308_DECODER 1
+#define CONFIG_V408_DECODER 1
+#define CONFIG_V410_DECODER 1
+#define CONFIG_VB_DECODER 1
+#define CONFIG_VBLE_DECODER 1
+#define CONFIG_VC1_DECODER 1
+#define CONFIG_VC1_CRYSTALHD_DECODER 0
+#define CONFIG_VC1_VDPAU_DECODER 0
+#define CONFIG_VC1IMAGE_DECODER 1
+#define CONFIG_VCR1_DECODER 1
+#define CONFIG_VMDVIDEO_DECODER 1
+#define CONFIG_VMNC_DECODER 1
+#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP5_DECODER 1
+#define CONFIG_VP6_DECODER 1
+#define CONFIG_VP6A_DECODER 1
+#define CONFIG_VP6F_DECODER 1
+#define CONFIG_VP8_DECODER 1
+#define CONFIG_VP9_DECODER 1
+#define CONFIG_VQA_DECODER 1
+#define CONFIG_WEBP_DECODER 1
+#define CONFIG_WMV1_DECODER 1
+#define CONFIG_WMV2_DECODER 1
+#define CONFIG_WMV3_DECODER 1
+#define CONFIG_WMV3_CRYSTALHD_DECODER 0
+#define CONFIG_WMV3_VDPAU_DECODER 0
+#define CONFIG_WMV3IMAGE_DECODER 1
+#define CONFIG_WNV1_DECODER 1
+#define CONFIG_XAN_WC3_DECODER 1
+#define CONFIG_XAN_WC4_DECODER 1
+#define CONFIG_XBM_DECODER 1
+#define CONFIG_XFACE_DECODER 1
+#define CONFIG_XL_DECODER 1
+#define CONFIG_XWD_DECODER 1
+#define CONFIG_Y41P_DECODER 1
+#define CONFIG_YOP_DECODER 1
+#define CONFIG_YUV4_DECODER 1
+#define CONFIG_ZERO12V_DECODER 1
+#define CONFIG_ZEROCODEC_DECODER 0
+#define CONFIG_ZLIB_DECODER 0
+#define CONFIG_ZMBV_DECODER 0
+#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_LATM_DECODER 1
+#define CONFIG_AC3_DECODER 0
+#define CONFIG_ALAC_DECODER 1
+#define CONFIG_ALS_DECODER 1
+#define CONFIG_AMRNB_DECODER 0
+#define CONFIG_AMRWB_DECODER 1
+#define CONFIG_APE_DECODER 1
+#define CONFIG_ATRAC1_DECODER 1
+#define CONFIG_ATRAC3_DECODER 1
+#define CONFIG_BINKAUDIO_DCT_DECODER 1
+#define CONFIG_BINKAUDIO_RDFT_DECODER 1
+#define CONFIG_BMV_AUDIO_DECODER 1
+#define CONFIG_COOK_DECODER 1
+#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSICINAUDIO_DECODER 1
+#define CONFIG_EAC3_DECODER 0
+#define CONFIG_EVRC_DECODER 1
+#define CONFIG_FFWAVESYNTH_DECODER 1
+#define CONFIG_FLAC_DECODER 1
+#define CONFIG_G723_1_DECODER 1
+#define CONFIG_G729_DECODER 1
+#define CONFIG_GSM_DECODER 1
+#define CONFIG_GSM_MS_DECODER 1
+#define CONFIG_IAC_DECODER 1
+#define CONFIG_IMC_DECODER 1
+#define CONFIG_MACE3_DECODER 1
+#define CONFIG_MACE6_DECODER 1
+#define CONFIG_METASOUND_DECODER 1
+#define CONFIG_MLP_DECODER 0
+#define CONFIG_MP1_DECODER 1
+#define CONFIG_MP1FLOAT_DECODER 1
+#define CONFIG_MP2_DECODER 1
+#define CONFIG_MP2FLOAT_DECODER 1
+#define CONFIG_MP3_DECODER 1
+#define CONFIG_MP3FLOAT_DECODER 1
+#define CONFIG_MP3ADU_DECODER 1
+#define CONFIG_MP3ADUFLOAT_DECODER 1
+#define CONFIG_MP3ON4_DECODER 1
+#define CONFIG_MP3ON4FLOAT_DECODER 1
+#define CONFIG_MPC7_DECODER 1
+#define CONFIG_MPC8_DECODER 1
+#define CONFIG_NELLYMOSER_DECODER 1
+#define CONFIG_PAF_AUDIO_DECODER 1
+#define CONFIG_QCELP_DECODER 1
+#define CONFIG_QDM2_DECODER 1
+#define CONFIG_RA_144_DECODER 1
+#define CONFIG_RA_288_DECODER 1
+#define CONFIG_RALF_DECODER 1
+#define CONFIG_SHORTEN_DECODER 1
+#define CONFIG_SIPR_DECODER 1
+#define CONFIG_SMACKAUD_DECODER 1
+#define CONFIG_SONIC_DECODER 1
+#define CONFIG_TAK_DECODER 1
+#define CONFIG_TRUEHD_DECODER 0
+#define CONFIG_TRUESPEECH_DECODER 1
+#define CONFIG_TTA_DECODER 1
+#define CONFIG_TWINVQ_DECODER 1
+#define CONFIG_VMDAUDIO_DECODER 1
+#define CONFIG_VORBIS_DECODER 1
+#define CONFIG_WAVPACK_DECODER 1
+#define CONFIG_WMALOSSLESS_DECODER 1
+#define CONFIG_WMAPRO_DECODER 1
+#define CONFIG_WMAV1_DECODER 1
+#define CONFIG_WMAV2_DECODER 1
+#define CONFIG_WMAVOICE_DECODER 1
+#define CONFIG_WS_SND1_DECODER 1
+#define CONFIG_PCM_ALAW_DECODER 1
+#define CONFIG_PCM_BLURAY_DECODER 1
+#define CONFIG_PCM_DVD_DECODER 1
+#define CONFIG_PCM_F32BE_DECODER 1
+#define CONFIG_PCM_F32LE_DECODER 1
+#define CONFIG_PCM_F64BE_DECODER 1
+#define CONFIG_PCM_F64LE_DECODER 1
+#define CONFIG_PCM_LXF_DECODER 1
+#define CONFIG_PCM_MULAW_DECODER 1
+#define CONFIG_PCM_S8_DECODER 1
+#define CONFIG_PCM_S8_PLANAR_DECODER 1
+#define CONFIG_PCM_S16BE_DECODER 1
+#define CONFIG_PCM_S16BE_PLANAR_DECODER 1
+#define CONFIG_PCM_S16LE_DECODER 1
+#define CONFIG_PCM_S16LE_PLANAR_DECODER 1
+#define CONFIG_PCM_S24BE_DECODER 1
+#define CONFIG_PCM_S24DAUD_DECODER 1
+#define CONFIG_PCM_S24LE_DECODER 1
+#define CONFIG_PCM_S24LE_PLANAR_DECODER 1
+#define CONFIG_PCM_S32BE_DECODER 1
+#define CONFIG_PCM_S32LE_DECODER 1
+#define CONFIG_PCM_S32LE_PLANAR_DECODER 1
+#define CONFIG_PCM_U8_DECODER 1
+#define CONFIG_PCM_U16BE_DECODER 1
+#define CONFIG_PCM_U16LE_DECODER 1
+#define CONFIG_PCM_U24BE_DECODER 1
+#define CONFIG_PCM_U24LE_DECODER 1
+#define CONFIG_PCM_U32BE_DECODER 1
+#define CONFIG_PCM_U32LE_DECODER 1
+#define CONFIG_PCM_ZORK_DECODER 1
+#define CONFIG_INTERPLAY_DPCM_DECODER 1
+#define CONFIG_ROQ_DPCM_DECODER 1
+#define CONFIG_SOL_DPCM_DECODER 1
+#define CONFIG_XAN_DPCM_DECODER 1
+#define CONFIG_ADPCM_4XM_DECODER 1
+#define CONFIG_ADPCM_ADX_DECODER 1
+#define CONFIG_ADPCM_AFC_DECODER 1
+#define CONFIG_ADPCM_CT_DECODER 1
+#define CONFIG_ADPCM_DTK_DECODER 1
+#define CONFIG_ADPCM_EA_DECODER 1
+#define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 1
+#define CONFIG_ADPCM_EA_R1_DECODER 1
+#define CONFIG_ADPCM_EA_R2_DECODER 1
+#define CONFIG_ADPCM_EA_R3_DECODER 1
+#define CONFIG_ADPCM_EA_XAS_DECODER 1
+#define CONFIG_ADPCM_G722_DECODER 1
+#define CONFIG_ADPCM_G726_DECODER 1
+#define CONFIG_ADPCM_G726LE_DECODER 1
+#define CONFIG_ADPCM_IMA_AMV_DECODER 1
+#define CONFIG_ADPCM_IMA_APC_DECODER 1
+#define CONFIG_ADPCM_IMA_DK3_DECODER 1
+#define CONFIG_ADPCM_IMA_DK4_DECODER 1
+#define CONFIG_ADPCM_IMA_EA_EACS_DECODER 1
+#define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 1
+#define CONFIG_ADPCM_IMA_ISS_DECODER 1
+#define CONFIG_ADPCM_IMA_OKI_DECODER 1
+#define CONFIG_ADPCM_IMA_QT_DECODER 1
+#define CONFIG_ADPCM_IMA_RAD_DECODER 1
+#define CONFIG_ADPCM_IMA_SMJPEG_DECODER 1
+#define CONFIG_ADPCM_IMA_WAV_DECODER 1
+#define CONFIG_ADPCM_IMA_WS_DECODER 1
+#define CONFIG_ADPCM_MS_DECODER 1
+#define CONFIG_ADPCM_SBPRO_2_DECODER 1
+#define CONFIG_ADPCM_SBPRO_3_DECODER 1
+#define CONFIG_ADPCM_SBPRO_4_DECODER 1
+#define CONFIG_ADPCM_SWF_DECODER 1
+#define CONFIG_ADPCM_THP_DECODER 1
+#define CONFIG_ADPCM_XA_DECODER 1
+#define CONFIG_ADPCM_YAMAHA_DECODER 1
+#define CONFIG_VIMA_DECODER 1
+#define CONFIG_SSA_DECODER 1
+#define CONFIG_ASS_DECODER 1
+#define CONFIG_DVBSUB_DECODER 1
+#define CONFIG_DVDSUB_DECODER 1
+#define CONFIG_JACOSUB_DECODER 1
+#define CONFIG_MICRODVD_DECODER 1
+#define CONFIG_MOVTEXT_DECODER 1
+#define CONFIG_MPL2_DECODER 1
+#define CONFIG_PGSSUB_DECODER 1
+#define CONFIG_PJS_DECODER 1
+#define CONFIG_REALTEXT_DECODER 1
+#define CONFIG_SAMI_DECODER 1
+#define CONFIG_SRT_DECODER 1
+#define CONFIG_SUBRIP_DECODER 1
+#define CONFIG_SUBVIEWER_DECODER 1
+#define CONFIG_SUBVIEWER1_DECODER 1
+#define CONFIG_TEXT_DECODER 1
+#define CONFIG_VPLAYER_DECODER 1
+#define CONFIG_WEBVTT_DECODER 1
+#define CONFIG_XSUB_DECODER 1
+#define CONFIG_LIBCELT_DECODER 0
+#define CONFIG_LIBFDK_AAC_DECODER 0
+#define CONFIG_LIBGSM_DECODER 0
+#define CONFIG_LIBGSM_MS_DECODER 0
+#define CONFIG_LIBILBC_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
+#define CONFIG_LIBOPENJPEG_DECODER 0
+#define CONFIG_LIBOPUS_DECODER 0
+#define CONFIG_LIBSCHROEDINGER_DECODER 0
+#define CONFIG_LIBSPEEX_DECODER 0
+#define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0
+#define CONFIG_LIBUTVIDEO_DECODER 0
+#define CONFIG_LIBVORBIS_DECODER 0
+#define CONFIG_LIBVPX_VP8_DECODER 0
+#define CONFIG_LIBVPX_VP9_DECODER 0
+#define CONFIG_LIBZVBI_TELETEXT_DECODER 0
+#define CONFIG_BINTEXT_DECODER 1
+#define CONFIG_XBIN_DECODER 1
+#define CONFIG_IDF_DECODER 1
+#define CONFIG_AAC_DEMUXER 1
+#define CONFIG_AC3_DEMUXER 1
+#define CONFIG_ACT_DEMUXER 1
+#define CONFIG_ADF_DEMUXER 1
+#define CONFIG_ADP_DEMUXER 1
+#define CONFIG_ADX_DEMUXER 1
+#define CONFIG_AEA_DEMUXER 1
+#define CONFIG_AFC_DEMUXER 1
+#define CONFIG_AIFF_DEMUXER 1
+#define CONFIG_AMR_DEMUXER 1
+#define CONFIG_ANM_DEMUXER 1
+#define CONFIG_APC_DEMUXER 1
+#define CONFIG_APE_DEMUXER 1
+#define CONFIG_AQTITLE_DEMUXER 1
+#define CONFIG_ASF_DEMUXER 1
+#define CONFIG_ASS_DEMUXER 1
+#define CONFIG_AST_DEMUXER 1
+#define CONFIG_AU_DEMUXER 1
+#define CONFIG_AVI_DEMUXER 1
+#define CONFIG_AVISYNTH_DEMUXER 0
+#define CONFIG_AVR_DEMUXER 1
+#define CONFIG_AVS_DEMUXER 1
+#define CONFIG_BETHSOFTVID_DEMUXER 1
+#define CONFIG_BFI_DEMUXER 1
+#define CONFIG_BINTEXT_DEMUXER 1
+#define CONFIG_BINK_DEMUXER 1
+#define CONFIG_BIT_DEMUXER 1
+#define CONFIG_BMV_DEMUXER 1
+#define CONFIG_BRSTM_DEMUXER 1
+#define CONFIG_BOA_DEMUXER 1
+#define CONFIG_C93_DEMUXER 1
+#define CONFIG_CAF_DEMUXER 1
+#define CONFIG_CAVSVIDEO_DEMUXER 1
+#define CONFIG_CDG_DEMUXER 1
+#define CONFIG_CDXL_DEMUXER 1
+#define CONFIG_CONCAT_DEMUXER 1
+#define CONFIG_DATA_DEMUXER 1
+#define CONFIG_DAUD_DEMUXER 1
+#define CONFIG_DFA_DEMUXER 1
+#define CONFIG_DIRAC_DEMUXER 1
+#define CONFIG_DNXHD_DEMUXER 1
+#define CONFIG_DSICIN_DEMUXER 1
+#define CONFIG_DTS_DEMUXER 1
+#define CONFIG_DTSHD_DEMUXER 1
+#define CONFIG_DV_DEMUXER 1
+#define CONFIG_DXA_DEMUXER 1
+#define CONFIG_EA_DEMUXER 1
+#define CONFIG_EA_CDATA_DEMUXER 1
+#define CONFIG_EAC3_DEMUXER 1
+#define CONFIG_EPAF_DEMUXER 1
+#define CONFIG_FFM_DEMUXER 1
+#define CONFIG_FFMETADATA_DEMUXER 1
+#define CONFIG_FILMSTRIP_DEMUXER 1
+#define CONFIG_FLAC_DEMUXER 1
+#define CONFIG_FLIC_DEMUXER 1
+#define CONFIG_FLV_DEMUXER 1
+#define CONFIG_FOURXM_DEMUXER 1
+#define CONFIG_FRM_DEMUXER 1
+#define CONFIG_G722_DEMUXER 1
+#define CONFIG_G723_1_DEMUXER 1
+#define CONFIG_G729_DEMUXER 1
+#define CONFIG_GIF_DEMUXER 1
+#define CONFIG_GSM_DEMUXER 1
+#define CONFIG_GXF_DEMUXER 1
+#define CONFIG_H261_DEMUXER 1
+#define CONFIG_H263_DEMUXER 1
+#define CONFIG_H264_DEMUXER 1
+#define CONFIG_HEVC_DEMUXER 1
+#define CONFIG_HLS_DEMUXER 1
+#define CONFIG_ICO_DEMUXER 1
+#define CONFIG_IDCIN_DEMUXER 1
+#define CONFIG_IDF_DEMUXER 1
+#define CONFIG_IFF_DEMUXER 1
+#define CONFIG_ILBC_DEMUXER 1
+#define CONFIG_IMAGE2_DEMUXER 1
+#define CONFIG_IMAGE2PIPE_DEMUXER 1
+#define CONFIG_INGENIENT_DEMUXER 1
+#define CONFIG_IPMOVIE_DEMUXER 1
+#define CONFIG_IRCAM_DEMUXER 1
+#define CONFIG_ISS_DEMUXER 1
+#define CONFIG_IV8_DEMUXER 1
+#define CONFIG_IVF_DEMUXER 1
+#define CONFIG_JACOSUB_DEMUXER 1
+#define CONFIG_JV_DEMUXER 1
+#define CONFIG_LATM_DEMUXER 1
+#define CONFIG_LMLM4_DEMUXER 1
+#define CONFIG_LOAS_DEMUXER 1
+#define CONFIG_LVF_DEMUXER 1
+#define CONFIG_LXF_DEMUXER 1
+#define CONFIG_M4V_DEMUXER 1
+#define CONFIG_MATROSKA_DEMUXER 1
+#define CONFIG_MGSTS_DEMUXER 1
+#define CONFIG_MICRODVD_DEMUXER 1
+#define CONFIG_MJPEG_DEMUXER 1
+#define CONFIG_MLP_DEMUXER 1
+#define CONFIG_MM_DEMUXER 1
+#define CONFIG_MMF_DEMUXER 1
+#define CONFIG_MOV_DEMUXER 1
+#define CONFIG_MP3_DEMUXER 1
+#define CONFIG_MPC_DEMUXER 1
+#define CONFIG_MPC8_DEMUXER 1
+#define CONFIG_MPEGPS_DEMUXER 1
+#define CONFIG_MPEGTS_DEMUXER 1
+#define CONFIG_MPEGTSRAW_DEMUXER 1
+#define CONFIG_MPEGVIDEO_DEMUXER 1
+#define CONFIG_MPL2_DEMUXER 1
+#define CONFIG_MPSUB_DEMUXER 1
+#define CONFIG_MSNWC_TCP_DEMUXER 1
+#define CONFIG_MTV_DEMUXER 1
+#define CONFIG_MV_DEMUXER 1
+#define CONFIG_MVI_DEMUXER 1
+#define CONFIG_MXF_DEMUXER 1
+#define CONFIG_MXG_DEMUXER 1
+#define CONFIG_NC_DEMUXER 1
+#define CONFIG_NISTSPHERE_DEMUXER 1
+#define CONFIG_NSV_DEMUXER 1
+#define CONFIG_NUT_DEMUXER 1
+#define CONFIG_NUV_DEMUXER 1
+#define CONFIG_OGG_DEMUXER 1
+#define CONFIG_OMA_DEMUXER 1
+#define CONFIG_PAF_DEMUXER 1
+#define CONFIG_PCM_ALAW_DEMUXER 1
+#define CONFIG_PCM_MULAW_DEMUXER 1
+#define CONFIG_PCM_F64BE_DEMUXER 1
+#define CONFIG_PCM_F64LE_DEMUXER 1
+#define CONFIG_PCM_F32BE_DEMUXER 1
+#define CONFIG_PCM_F32LE_DEMUXER 1
+#define CONFIG_PCM_S32BE_DEMUXER 1
+#define CONFIG_PCM_S32LE_DEMUXER 1
+#define CONFIG_PCM_S24BE_DEMUXER 1
+#define CONFIG_PCM_S24LE_DEMUXER 1
+#define CONFIG_PCM_S16BE_DEMUXER 1
+#define CONFIG_PCM_S16LE_DEMUXER 1
+#define CONFIG_PCM_S8_DEMUXER 1
+#define CONFIG_PCM_U32BE_DEMUXER 1
+#define CONFIG_PCM_U32LE_DEMUXER 1
+#define CONFIG_PCM_U24BE_DEMUXER 1
+#define CONFIG_PCM_U24LE_DEMUXER 1
+#define CONFIG_PCM_U16BE_DEMUXER 1
+#define CONFIG_PCM_U16LE_DEMUXER 1
+#define CONFIG_PCM_U8_DEMUXER 1
+#define CONFIG_PJS_DEMUXER 1
+#define CONFIG_PMP_DEMUXER 1
+#define CONFIG_PVA_DEMUXER 1
+#define CONFIG_PVF_DEMUXER 1
+#define CONFIG_QCP_DEMUXER 1
+#define CONFIG_R3D_DEMUXER 1
+#define CONFIG_RAWVIDEO_DEMUXER 1
+#define CONFIG_REALTEXT_DEMUXER 1
+#define CONFIG_REDSPARK_DEMUXER 1
+#define CONFIG_RL2_DEMUXER 1
+#define CONFIG_RM_DEMUXER 1
+#define CONFIG_ROQ_DEMUXER 1
+#define CONFIG_RPL_DEMUXER 1
+#define CONFIG_RSD_DEMUXER 1
+#define CONFIG_RSO_DEMUXER 1
+#define CONFIG_RTP_DEMUXER 1
+#define CONFIG_RTSP_DEMUXER 1
+#define CONFIG_SAMI_DEMUXER 1
+#define CONFIG_SAP_DEMUXER 1
+#define CONFIG_SBG_DEMUXER 1
+#define CONFIG_SDP_DEMUXER 1
+#define CONFIG_SEGAFILM_DEMUXER 1
+#define CONFIG_SHORTEN_DEMUXER 1
+#define CONFIG_SIFF_DEMUXER 1
+#define CONFIG_SMACKER_DEMUXER 1
+#define CONFIG_SMJPEG_DEMUXER 1
+#define CONFIG_SMUSH_DEMUXER 1
+#define CONFIG_SOL_DEMUXER 1
+#define CONFIG_SOX_DEMUXER 1
+#define CONFIG_SPDIF_DEMUXER 1
+#define CONFIG_SRT_DEMUXER 1
+#define CONFIG_STR_DEMUXER 1
+#define CONFIG_SUBVIEWER1_DEMUXER 1
+#define CONFIG_SUBVIEWER_DEMUXER 1
+#define CONFIG_SWF_DEMUXER 1
+#define CONFIG_TAK_DEMUXER 1
+#define CONFIG_TEDCAPTIONS_DEMUXER 1
+#define CONFIG_THP_DEMUXER 1
+#define CONFIG_TIERTEXSEQ_DEMUXER 1
+#define CONFIG_TMV_DEMUXER 1
+#define CONFIG_TRUEHD_DEMUXER 1
+#define CONFIG_TTA_DEMUXER 1
+#define CONFIG_TXD_DEMUXER 1
+#define CONFIG_TTY_DEMUXER 1
+#define CONFIG_VC1_DEMUXER 1
+#define CONFIG_VC1T_DEMUXER 1
+#define CONFIG_VIVO_DEMUXER 1
+#define CONFIG_VMD_DEMUXER 1
+#define CONFIG_VOBSUB_DEMUXER 1
+#define CONFIG_VOC_DEMUXER 1
+#define CONFIG_VPLAYER_DEMUXER 1
+#define CONFIG_VQF_DEMUXER 1
+#define CONFIG_W64_DEMUXER 1
+#define CONFIG_WAV_DEMUXER 1
+#define CONFIG_WC3_DEMUXER 1
+#define CONFIG_WEBVTT_DEMUXER 1
+#define CONFIG_WSAUD_DEMUXER 1
+#define CONFIG_WSVQA_DEMUXER 1
+#define CONFIG_WTV_DEMUXER 1
+#define CONFIG_WV_DEMUXER 1
+#define CONFIG_XA_DEMUXER 1
+#define CONFIG_XBIN_DEMUXER 1
+#define CONFIG_XMV_DEMUXER 1
+#define CONFIG_XWMA_DEMUXER 1
+#define CONFIG_YOP_DEMUXER 1
+#define CONFIG_YUV4MPEGPIPE_DEMUXER 1
+#define CONFIG_LIBGME_DEMUXER 0
+#define CONFIG_LIBMODPLUG_DEMUXER 0
+#define CONFIG_LIBNUT_DEMUXER 0
+#define CONFIG_LIBQUVI_DEMUXER 0
+#define CONFIG_A64MULTI_ENCODER 1
+#define CONFIG_A64MULTI5_ENCODER 1
+#define CONFIG_AMV_ENCODER 1
+#define CONFIG_ASV1_ENCODER 1
+#define CONFIG_ASV2_ENCODER 1
+#define CONFIG_AVRP_ENCODER 1
+#define CONFIG_AVUI_ENCODER 1
+#define CONFIG_AYUV_ENCODER 1
+#define CONFIG_BMP_ENCODER 1
+#define CONFIG_CLJR_ENCODER 1
+#define CONFIG_COMFORTNOISE_ENCODER 1
+#define CONFIG_DNXHD_ENCODER 1
+#define CONFIG_DPX_ENCODER 1
+#define CONFIG_DVVIDEO_ENCODER 1
+#define CONFIG_FFV1_ENCODER 1
+#define CONFIG_FFVHUFF_ENCODER 1
+#define CONFIG_FLASHSV_ENCODER 0
+#define CONFIG_FLASHSV2_ENCODER 0
+#define CONFIG_FLV_ENCODER 1
+#define CONFIG_GIF_ENCODER 1
+#define CONFIG_H261_ENCODER 1
+#define CONFIG_H263_ENCODER 1
+#define CONFIG_H263P_ENCODER 1
+#define CONFIG_HUFFYUV_ENCODER 1
+#define CONFIG_JPEG2000_ENCODER 1
+#define CONFIG_JPEGLS_ENCODER 1
+#define CONFIG_LJPEG_ENCODER 1
+#define CONFIG_MJPEG_ENCODER 1
+#define CONFIG_MPEG1VIDEO_ENCODER 1
+#define CONFIG_MPEG2VIDEO_ENCODER 1
+#define CONFIG_MPEG4_ENCODER 1
+#define CONFIG_MSMPEG4V2_ENCODER 1
+#define CONFIG_MSMPEG4V3_ENCODER 1
+#define CONFIG_MSVIDEO1_ENCODER 1
+#define CONFIG_PAM_ENCODER 1
+#define CONFIG_PBM_ENCODER 1
+#define CONFIG_PCX_ENCODER 1
+#define CONFIG_PGM_ENCODER 1
+#define CONFIG_PGMYUV_ENCODER 1
+#define CONFIG_PNG_ENCODER 0
+#define CONFIG_PPM_ENCODER 1
+#define CONFIG_PRORES_ENCODER 1
+#define CONFIG_PRORES_AW_ENCODER 1
+#define CONFIG_PRORES_KS_ENCODER 1
+#define CONFIG_QTRLE_ENCODER 1
+#define CONFIG_R10K_ENCODER 1
+#define CONFIG_R210_ENCODER 1
+#define CONFIG_RAWVIDEO_ENCODER 1
+#define CONFIG_ROQ_ENCODER 1
+#define CONFIG_RV10_ENCODER 1
+#define CONFIG_RV20_ENCODER 1
+#define CONFIG_S302M_ENCODER 1
+#define CONFIG_SGI_ENCODER 1
+#define CONFIG_SNOW_ENCODER 1
+#define CONFIG_SUNRAST_ENCODER 1
+#define CONFIG_SVQ1_ENCODER 1
+#define CONFIG_TARGA_ENCODER 1
+#define CONFIG_TIFF_ENCODER 1
+#define CONFIG_UTVIDEO_ENCODER 1
+#define CONFIG_V210_ENCODER 1
+#define CONFIG_V308_ENCODER 1
+#define CONFIG_V408_ENCODER 1
+#define CONFIG_V410_ENCODER 1
+#define CONFIG_WMV1_ENCODER 1
+#define CONFIG_WMV2_ENCODER 1
+#define CONFIG_XBM_ENCODER 1
+#define CONFIG_XFACE_ENCODER 1
+#define CONFIG_XWD_ENCODER 1
+#define CONFIG_Y41P_ENCODER 1
+#define CONFIG_YUV4_ENCODER 1
+#define CONFIG_ZLIB_ENCODER 0
+#define CONFIG_ZMBV_ENCODER 0
+#define CONFIG_AAC_ENCODER 1
+#define CONFIG_AC3_ENCODER 0
+#define CONFIG_AC3_FIXED_ENCODER 0
+#define CONFIG_ALAC_ENCODER 1
+#define CONFIG_DCA_ENCODER 0
+#define CONFIG_EAC3_ENCODER 0
+#define CONFIG_FLAC_ENCODER 0
+#define CONFIG_G723_1_ENCODER 1
+#define CONFIG_MP2_ENCODER 1
+#define CONFIG_NELLYMOSER_ENCODER 1
+#define CONFIG_RA_144_ENCODER 1
+#define CONFIG_SONIC_ENCODER 1
+#define CONFIG_SONIC_LS_ENCODER 1
+#define CONFIG_TTA_ENCODER 1
+#define CONFIG_VORBIS_ENCODER 1
+#define CONFIG_WAVPACK_ENCODER 1
+#define CONFIG_WMAV1_ENCODER 1
+#define CONFIG_WMAV2_ENCODER 1
+#define CONFIG_PCM_ALAW_ENCODER 1
+#define CONFIG_PCM_F32BE_ENCODER 1
+#define CONFIG_PCM_F32LE_ENCODER 1
+#define CONFIG_PCM_F64BE_ENCODER 1
+#define CONFIG_PCM_F64LE_ENCODER 1
+#define CONFIG_PCM_MULAW_ENCODER 1
+#define CONFIG_PCM_S8_ENCODER 1
+#define CONFIG_PCM_S8_PLANAR_ENCODER 1
+#define CONFIG_PCM_S16BE_ENCODER 1
+#define CONFIG_PCM_S16BE_PLANAR_ENCODER 1
+#define CONFIG_PCM_S16LE_ENCODER 1
+#define CONFIG_PCM_S16LE_PLANAR_ENCODER 1
+#define CONFIG_PCM_S24BE_ENCODER 1
+#define CONFIG_PCM_S24DAUD_ENCODER 1
+#define CONFIG_PCM_S24LE_ENCODER 1
+#define CONFIG_PCM_S24LE_PLANAR_ENCODER 1
+#define CONFIG_PCM_S32BE_ENCODER 1
+#define CONFIG_PCM_S32LE_ENCODER 1
+#define CONFIG_PCM_S32LE_PLANAR_ENCODER 1
+#define CONFIG_PCM_U8_ENCODER 1
+#define CONFIG_PCM_U16BE_ENCODER 1
+#define CONFIG_PCM_U16LE_ENCODER 1
+#define CONFIG_PCM_U24BE_ENCODER 1
+#define CONFIG_PCM_U24LE_ENCODER 1
+#define CONFIG_PCM_U32BE_ENCODER 1
+#define CONFIG_PCM_U32LE_ENCODER 1
+#define CONFIG_ROQ_DPCM_ENCODER 1
+#define CONFIG_ADPCM_ADX_ENCODER 1
+#define CONFIG_ADPCM_G722_ENCODER 1
+#define CONFIG_ADPCM_G726_ENCODER 1
+#define CONFIG_ADPCM_IMA_QT_ENCODER 1
+#define CONFIG_ADPCM_IMA_WAV_ENCODER 1
+#define CONFIG_ADPCM_MS_ENCODER 1
+#define CONFIG_ADPCM_SWF_ENCODER 1
+#define CONFIG_ADPCM_YAMAHA_ENCODER 1
+#define CONFIG_SSA_ENCODER 1
+#define CONFIG_ASS_ENCODER 1
+#define CONFIG_DVBSUB_ENCODER 1
+#define CONFIG_DVDSUB_ENCODER 1
+#define CONFIG_MOVTEXT_ENCODER 1
+#define CONFIG_SRT_ENCODER 1
+#define CONFIG_SUBRIP_ENCODER 1
+#define CONFIG_XSUB_ENCODER 1
+#define CONFIG_LIBFAAC_ENCODER 0
+#define CONFIG_LIBFDK_AAC_ENCODER 0
+#define CONFIG_LIBGSM_ENCODER 0
+#define CONFIG_LIBGSM_MS_ENCODER 0
+#define CONFIG_LIBILBC_ENCODER 0
+#define CONFIG_LIBMP3LAME_ENCODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
+#define CONFIG_LIBOPENJPEG_ENCODER 0
+#define CONFIG_LIBOPUS_ENCODER 0
+#define CONFIG_LIBSCHROEDINGER_ENCODER 0
+#define CONFIG_LIBSHINE_ENCODER 0
+#define CONFIG_LIBSPEEX_ENCODER 0
+#define CONFIG_LIBTHEORA_ENCODER 0
+#define CONFIG_LIBTWOLAME_ENCODER 0
+#define CONFIG_LIBUTVIDEO_ENCODER 0
+#define CONFIG_LIBVO_AACENC_ENCODER 0
+#define CONFIG_LIBVO_AMRWBENC_ENCODER 0
+#define CONFIG_LIBVORBIS_ENCODER 0
+#define CONFIG_LIBVPX_VP8_ENCODER 0
+#define CONFIG_LIBVPX_VP9_ENCODER 0
+#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBX264_ENCODER 0
+#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBXAVS_ENCODER 0
+#define CONFIG_LIBXVID_ENCODER 0
+#define CONFIG_LIBAACPLUS_ENCODER 0
+#define CONFIG_ACONVERT_FILTER 1
+#define CONFIG_ADELAY_FILTER 1
+#define CONFIG_AECHO_FILTER 1
+#define CONFIG_AFADE_FILTER 1
+#define CONFIG_AFORMAT_FILTER 1
+#define CONFIG_AINTERLEAVE_FILTER 1
+#define CONFIG_ALLPASS_FILTER 1
+#define CONFIG_AMERGE_FILTER 1
+#define CONFIG_AMIX_FILTER 1
+#define CONFIG_ANULL_FILTER 1
+#define CONFIG_APAD_FILTER 1
+#define CONFIG_APERMS_FILTER 1
+#define CONFIG_APHASER_FILTER 1
+#define CONFIG_ARESAMPLE_FILTER 1
+#define CONFIG_ASELECT_FILTER 1
+#define CONFIG_ASENDCMD_FILTER 1
+#define CONFIG_ASETNSAMPLES_FILTER 1
+#define CONFIG_ASETPTS_FILTER 1
+#define CONFIG_ASETRATE_FILTER 1
+#define CONFIG_ASETTB_FILTER 1
+#define CONFIG_ASHOWINFO_FILTER 1
+#define CONFIG_ASPLIT_FILTER 1
+#define CONFIG_ASTATS_FILTER 1
+#define CONFIG_ASTREAMSYNC_FILTER 1
+#define CONFIG_ASYNCTS_FILTER 0
+#define CONFIG_ATEMPO_FILTER 1
+#define CONFIG_ATRIM_FILTER 1
+#define CONFIG_AZMQ_FILTER 0
+#define CONFIG_BANDPASS_FILTER 1
+#define CONFIG_BANDREJECT_FILTER 1
+#define CONFIG_BASS_FILTER 1
+#define CONFIG_BIQUAD_FILTER 1
+#define CONFIG_CHANNELMAP_FILTER 1
+#define CONFIG_CHANNELSPLIT_FILTER 1
+#define CONFIG_COMPAND_FILTER 1
+#define CONFIG_EARWAX_FILTER 1
+#define CONFIG_EBUR128_FILTER 0
+#define CONFIG_EQUALIZER_FILTER 1
+#define CONFIG_HIGHPASS_FILTER 1
+#define CONFIG_JOIN_FILTER 1
+#define CONFIG_LADSPA_FILTER 0
+#define CONFIG_LOWPASS_FILTER 1
+#define CONFIG_PAN_FILTER 1
+#define CONFIG_REPLAYGAIN_FILTER 1
+#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SILENCEDETECT_FILTER 1
+#define CONFIG_TREBLE_FILTER 1
+#define CONFIG_VOLUME_FILTER 1
+#define CONFIG_VOLUMEDETECT_FILTER 1
+#define CONFIG_AEVALSRC_FILTER 1
+#define CONFIG_ANULLSRC_FILTER 1
+#define CONFIG_FLITE_FILTER 0
+#define CONFIG_SINE_FILTER 1
+#define CONFIG_ANULLSINK_FILTER 1
+#define CONFIG_ALPHAEXTRACT_FILTER 1
+#define CONFIG_ALPHAMERGE_FILTER 1
+#define CONFIG_ASS_FILTER 0
+#define CONFIG_BBOX_FILTER 1
+#define CONFIG_BLACKDETECT_FILTER 1
+#define CONFIG_BLACKFRAME_FILTER 0
+#define CONFIG_BLEND_FILTER 1
+#define CONFIG_BOXBLUR_FILTER 0
+#define CONFIG_COLORBALANCE_FILTER 1
+#define CONFIG_COLORCHANNELMIXER_FILTER 1
+#define CONFIG_COLORMATRIX_FILTER 0
+#define CONFIG_COPY_FILTER 1
+#define CONFIG_CROP_FILTER 1
+#define CONFIG_CROPDETECT_FILTER 0
+#define CONFIG_CURVES_FILTER 1
+#define CONFIG_DCTDNOIZ_FILTER 1
+#define CONFIG_DECIMATE_FILTER 1
+#define CONFIG_DELOGO_FILTER 0
+#define CONFIG_DESHAKE_FILTER 1
+#define CONFIG_DRAWBOX_FILTER 1
+#define CONFIG_DRAWGRID_FILTER 1
+#define CONFIG_DRAWTEXT_FILTER 0
+#define CONFIG_EDGEDETECT_FILTER 1
+#define CONFIG_EXTRACTPLANES_FILTER 1
+#define CONFIG_FADE_FILTER 1
+#define CONFIG_FIELD_FILTER 1
+#define CONFIG_FIELDMATCH_FILTER 1
+#define CONFIG_FIELDORDER_FILTER 1
+#define CONFIG_FORMAT_FILTER 1
+#define CONFIG_FPS_FILTER 1
+#define CONFIG_FRAMESTEP_FILTER 1
+#define CONFIG_FREI0R_FILTER 0
+#define CONFIG_GEQ_FILTER 0
+#define CONFIG_GRADFUN_FILTER 1
+#define CONFIG_HALDCLUT_FILTER 1
+#define CONFIG_HFLIP_FILTER 1
+#define CONFIG_HISTEQ_FILTER 0
+#define CONFIG_HISTOGRAM_FILTER 1
+#define CONFIG_HQDN3D_FILTER 0
+#define CONFIG_HUE_FILTER 1
+#define CONFIG_IDET_FILTER 1
+#define CONFIG_IL_FILTER 1
+#define CONFIG_INTERLACE_FILTER 0
+#define CONFIG_INTERLEAVE_FILTER 1
+#define CONFIG_KERNDEINT_FILTER 0
+#define CONFIG_LUT3D_FILTER 1
+#define CONFIG_LUT_FILTER 1
+#define CONFIG_LUTRGB_FILTER 1
+#define CONFIG_LUTYUV_FILTER 1
+#define CONFIG_MCDEINT_FILTER 0
+#define CONFIG_MERGEPLANES_FILTER 1
+#define CONFIG_MP_FILTER 0
+#define CONFIG_MPDECIMATE_FILTER 0
+#define CONFIG_NEGATE_FILTER 1
+#define CONFIG_NOFORMAT_FILTER 1
+#define CONFIG_NOISE_FILTER 1
+#define CONFIG_NULL_FILTER 1
+#define CONFIG_OCV_FILTER 0
+#define CONFIG_OVERLAY_FILTER 1
+#define CONFIG_OWDENOISE_FILTER 0
+#define CONFIG_PAD_FILTER 1
+#define CONFIG_PERMS_FILTER 1
+#define CONFIG_PERSPECTIVE_FILTER 0
+#define CONFIG_PHASE_FILTER 0
+#define CONFIG_PIXDESCTEST_FILTER 1
+#define CONFIG_PP_FILTER 0
+#define CONFIG_PSNR_FILTER 1
+#define CONFIG_PULLUP_FILTER 0
+#define CONFIG_REMOVELOGO_FILTER 1
+#define CONFIG_ROTATE_FILTER 1
+#define CONFIG_SAB_FILTER 0
+#define CONFIG_SCALE_FILTER 1
+#define CONFIG_SELECT_FILTER 1
+#define CONFIG_SENDCMD_FILTER 1
+#define CONFIG_SEPARATEFIELDS_FILTER 1
+#define CONFIG_SETDAR_FILTER 1
+#define CONFIG_SETFIELD_FILTER 1
+#define CONFIG_SETPTS_FILTER 1
+#define CONFIG_SETSAR_FILTER 1
+#define CONFIG_SETTB_FILTER 1
+#define CONFIG_SHOWINFO_FILTER 1
+#define CONFIG_SMARTBLUR_FILTER 0
+#define CONFIG_SPLIT_FILTER 1
+#define CONFIG_SPP_FILTER 0
+#define CONFIG_STEREO3D_FILTER 0
+#define CONFIG_SUBTITLES_FILTER 0
+#define CONFIG_SUPER2XSAI_FILTER 0
+#define CONFIG_SWAPUV_FILTER 1
+#define CONFIG_TELECINE_FILTER 1
+#define CONFIG_THUMBNAIL_FILTER 1
+#define CONFIG_TILE_FILTER 1
+#define CONFIG_TINTERLACE_FILTER 0
+#define CONFIG_TRANSPOSE_FILTER 1
+#define CONFIG_TRIM_FILTER 1
+#define CONFIG_UNSHARP_FILTER 1
+#define CONFIG_VFLIP_FILTER 1
+#define CONFIG_VIDSTABDETECT_FILTER 0
+#define CONFIG_VIDSTABTRANSFORM_FILTER 0
+#define CONFIG_VIGNETTE_FILTER 1
+#define CONFIG_W3FDIF_FILTER 1
+#define CONFIG_YADIF_FILTER 0
+#define CONFIG_ZMQ_FILTER 0
+#define CONFIG_CELLAUTO_FILTER 1
+#define CONFIG_COLOR_FILTER 1
+#define CONFIG_FREI0R_SRC_FILTER 0
+#define CONFIG_HALDCLUTSRC_FILTER 1
+#define CONFIG_LIFE_FILTER 1
+#define CONFIG_MANDELBROT_FILTER 1
+#define CONFIG_MPTESTSRC_FILTER 0
+#define CONFIG_NULLSRC_FILTER 1
+#define CONFIG_RGBTESTSRC_FILTER 1
+#define CONFIG_SMPTEBARS_FILTER 1
+#define CONFIG_SMPTEHDBARS_FILTER 1
+#define CONFIG_TESTSRC_FILTER 1
+#define CONFIG_NULLSINK_FILTER 1
+#define CONFIG_AVECTORSCOPE_FILTER 1
+#define CONFIG_CONCAT_FILTER 1
+#define CONFIG_SHOWSPECTRUM_FILTER 1
+#define CONFIG_SHOWWAVES_FILTER 1
+#define CONFIG_AMOVIE_FILTER 1
+#define CONFIG_MOVIE_FILTER 1
+#define CONFIG_H263_VAAPI_HWACCEL 0
+#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H264_DXVA2_HWACCEL 0
+#define CONFIG_H264_VAAPI_HWACCEL 0
+#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_VAAPI_HWACCEL 0
+#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VAAPI_HWACCEL 0
+#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_VC1_DXVA2_HWACCEL 0
+#define CONFIG_VC1_VAAPI_HWACCEL 0
+#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_WMV3_DXVA2_HWACCEL 0
+#define CONFIG_WMV3_VAAPI_HWACCEL 0
+#define CONFIG_WMV3_VDPAU_HWACCEL 0
+#define CONFIG_ALSA_INDEV 0
+#define CONFIG_BKTR_INDEV 0
+#define CONFIG_DSHOW_INDEV 0
+#define CONFIG_DV1394_INDEV 1
+#define CONFIG_FBDEV_INDEV 1
+#define CONFIG_IEC61883_INDEV 0
+#define CONFIG_JACK_INDEV 0
+#define CONFIG_LAVFI_INDEV 1
+#define CONFIG_OPENAL_INDEV 0
+#define CONFIG_OSS_INDEV 0
+#define CONFIG_PULSE_INDEV 0
+#define CONFIG_SNDIO_INDEV 0
+#define CONFIG_V4L2_INDEV 1
+#define CONFIG_VFWCAP_INDEV 0
+#define CONFIG_X11GRAB_INDEV 0
+#define CONFIG_LIBCDIO_INDEV 0
+#define CONFIG_LIBDC1394_INDEV 0
+#define CONFIG_A64_MUXER 1
+#define CONFIG_AC3_MUXER 1
+#define CONFIG_ADTS_MUXER 1
+#define CONFIG_ADX_MUXER 1
+#define CONFIG_AIFF_MUXER 1
+#define CONFIG_AMR_MUXER 1
+#define CONFIG_ASF_MUXER 1
+#define CONFIG_ASS_MUXER 1
+#define CONFIG_AST_MUXER 1
+#define CONFIG_ASF_STREAM_MUXER 1
+#define CONFIG_AU_MUXER 1
+#define CONFIG_AVI_MUXER 1
+#define CONFIG_AVM2_MUXER 1
+#define CONFIG_BIT_MUXER 1
+#define CONFIG_CAF_MUXER 1
+#define CONFIG_CAVSVIDEO_MUXER 1
+#define CONFIG_CRC_MUXER 1
+#define CONFIG_DATA_MUXER 1
+#define CONFIG_DAUD_MUXER 1
+#define CONFIG_DIRAC_MUXER 1
+#define CONFIG_DNXHD_MUXER 1
+#define CONFIG_DTS_MUXER 1
+#define CONFIG_DV_MUXER 1
+#define CONFIG_EAC3_MUXER 1
+#define CONFIG_F4V_MUXER 1
+#define CONFIG_FFM_MUXER 1
+#define CONFIG_FFMETADATA_MUXER 1
+#define CONFIG_FILMSTRIP_MUXER 1
+#define CONFIG_FLAC_MUXER 1
+#define CONFIG_FLV_MUXER 1
+#define CONFIG_FRAMECRC_MUXER 1
+#define CONFIG_FRAMEMD5_MUXER 1
+#define CONFIG_G722_MUXER 1
+#define CONFIG_G723_1_MUXER 1
+#define CONFIG_GIF_MUXER 1
+#define CONFIG_GXF_MUXER 1
+#define CONFIG_H261_MUXER 1
+#define CONFIG_H263_MUXER 1
+#define CONFIG_H264_MUXER 1
+#define CONFIG_HLS_MUXER 1
+#define CONFIG_ICO_MUXER 1
+#define CONFIG_ILBC_MUXER 1
+#define CONFIG_IMAGE2_MUXER 1
+#define CONFIG_IMAGE2PIPE_MUXER 1
+#define CONFIG_IPOD_MUXER 1
+#define CONFIG_IRCAM_MUXER 1
+#define CONFIG_ISMV_MUXER 1
+#define CONFIG_IVF_MUXER 1
+#define CONFIG_JACOSUB_MUXER 1
+#define CONFIG_LATM_MUXER 1
+#define CONFIG_M4V_MUXER 1
+#define CONFIG_MD5_MUXER 1
+#define CONFIG_MATROSKA_MUXER 1
+#define CONFIG_MATROSKA_AUDIO_MUXER 1
+#define CONFIG_MICRODVD_MUXER 1
+#define CONFIG_MJPEG_MUXER 1
+#define CONFIG_MLP_MUXER 1
+#define CONFIG_MMF_MUXER 1
+#define CONFIG_MOV_MUXER 1
+#define CONFIG_MP2_MUXER 1
+#define CONFIG_MP3_MUXER 1
+#define CONFIG_MP4_MUXER 1
+#define CONFIG_MPEG1SYSTEM_MUXER 1
+#define CONFIG_MPEG1VCD_MUXER 1
+#define CONFIG_MPEG1VIDEO_MUXER 1
+#define CONFIG_MPEG2DVD_MUXER 1
+#define CONFIG_MPEG2SVCD_MUXER 1
+#define CONFIG_MPEG2VIDEO_MUXER 1
+#define CONFIG_MPEG2VOB_MUXER 1
+#define CONFIG_MPEGTS_MUXER 1
+#define CONFIG_MPJPEG_MUXER 1
+#define CONFIG_MXF_MUXER 1
+#define CONFIG_MXF_D10_MUXER 1
+#define CONFIG_NULL_MUXER 1
+#define CONFIG_NUT_MUXER 1
+#define CONFIG_OGG_MUXER 1
+#define CONFIG_OMA_MUXER 1
+#define CONFIG_PCM_ALAW_MUXER 1
+#define CONFIG_PCM_MULAW_MUXER 1
+#define CONFIG_PCM_F64BE_MUXER 1
+#define CONFIG_PCM_F64LE_MUXER 1
+#define CONFIG_PCM_F32BE_MUXER 1
+#define CONFIG_PCM_F32LE_MUXER 1
+#define CONFIG_PCM_S32BE_MUXER 1
+#define CONFIG_PCM_S32LE_MUXER 1
+#define CONFIG_PCM_S24BE_MUXER 1
+#define CONFIG_PCM_S24LE_MUXER 1
+#define CONFIG_PCM_S16BE_MUXER 1
+#define CONFIG_PCM_S16LE_MUXER 1
+#define CONFIG_PCM_S8_MUXER 1
+#define CONFIG_PCM_U32BE_MUXER 1
+#define CONFIG_PCM_U32LE_MUXER 1
+#define CONFIG_PCM_U24BE_MUXER 1
+#define CONFIG_PCM_U24LE_MUXER 1
+#define CONFIG_PCM_U16BE_MUXER 1
+#define CONFIG_PCM_U16LE_MUXER 1
+#define CONFIG_PCM_U8_MUXER 1
+#define CONFIG_PSP_MUXER 1
+#define CONFIG_RAWVIDEO_MUXER 1
+#define CONFIG_RM_MUXER 1
+#define CONFIG_ROQ_MUXER 1
+#define CONFIG_RSO_MUXER 1
+#define CONFIG_RTP_MUXER 1
+#define CONFIG_RTSP_MUXER 1
+#define CONFIG_SAP_MUXER 1
+#define CONFIG_SEGMENT_MUXER 1
+#define CONFIG_STREAM_SEGMENT_MUXER 1
+#define CONFIG_SMJPEG_MUXER 1
+#define CONFIG_SMOOTHSTREAMING_MUXER 1
+#define CONFIG_SOX_MUXER 1
+#define CONFIG_SPDIF_MUXER 1
+#define CONFIG_SRT_MUXER 1
+#define CONFIG_SWF_MUXER 1
+#define CONFIG_TEE_MUXER 1
+#define CONFIG_TG2_MUXER 1
+#define CONFIG_TGP_MUXER 1
+#define CONFIG_MKVTIMESTAMP_V2_MUXER 1
+#define CONFIG_TRUEHD_MUXER 1
+#define CONFIG_VC1_MUXER 1
+#define CONFIG_VC1T_MUXER 1
+#define CONFIG_VOC_MUXER 1
+#define CONFIG_W64_MUXER 1
+#define CONFIG_WAV_MUXER 1
+#define CONFIG_WEBM_MUXER 1
+#define CONFIG_WEBVTT_MUXER 1
+#define CONFIG_WTV_MUXER 1
+#define CONFIG_WV_MUXER 1
+#define CONFIG_YUV4MPEGPIPE_MUXER 1
+#define CONFIG_LIBNUT_MUXER 0
+#define CONFIG_ALSA_OUTDEV 0
+#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_FBDEV_OUTDEV 1
+#define CONFIG_OSS_OUTDEV 0
+#define CONFIG_PULSE_OUTDEV 0
+#define CONFIG_SDL_OUTDEV 0
+#define CONFIG_SNDIO_OUTDEV 0
+#define CONFIG_V4L2_OUTDEV 1
+#define CONFIG_XV_OUTDEV 0
+#define CONFIG_AAC_PARSER 1
+#define CONFIG_AAC_LATM_PARSER 1
+#define CONFIG_AC3_PARSER 1
+#define CONFIG_ADX_PARSER 1
+#define CONFIG_BMP_PARSER 1
+#define CONFIG_CAVSVIDEO_PARSER 1
+#define CONFIG_COOK_PARSER 1
+#define CONFIG_DCA_PARSER 1
+#define CONFIG_DIRAC_PARSER 1
+#define CONFIG_DNXHD_PARSER 1
+#define CONFIG_DPX_PARSER 1
+#define CONFIG_DVBSUB_PARSER 1
+#define CONFIG_DVDSUB_PARSER 1
+#define CONFIG_DVD_NAV_PARSER 1
+#define CONFIG_FLAC_PARSER 1
+#define CONFIG_GSM_PARSER 1
+#define CONFIG_H261_PARSER 1
+#define CONFIG_H263_PARSER 1
+#define CONFIG_H264_PARSER 1
+#define CONFIG_HEVC_PARSER 1
+#define CONFIG_MJPEG_PARSER 1
+#define CONFIG_MLP_PARSER 1
+#define CONFIG_MPEG4VIDEO_PARSER 1
+#define CONFIG_MPEGAUDIO_PARSER 1
+#define CONFIG_MPEGVIDEO_PARSER 1
+#define CONFIG_PNG_PARSER 1
+#define CONFIG_PNM_PARSER 1
+#define CONFIG_RV30_PARSER 1
+#define CONFIG_RV40_PARSER 1
+#define CONFIG_TAK_PARSER 1
+#define CONFIG_VC1_PARSER 1
+#define CONFIG_VORBIS_PARSER 1
+#define CONFIG_VP3_PARSER 1
+#define CONFIG_VP8_PARSER 1
+#define CONFIG_BLURAY_PROTOCOL 0
+#define CONFIG_CACHE_PROTOCOL 1
+#define CONFIG_CONCAT_PROTOCOL 1
+#define CONFIG_CRYPTO_PROTOCOL 1
+#define CONFIG_DATA_PROTOCOL 1
+#define CONFIG_FFRTMPCRYPT_PROTOCOL 0
+#define CONFIG_FFRTMPHTTP_PROTOCOL 1
+#define CONFIG_FILE_PROTOCOL 1
+#define CONFIG_FTP_PROTOCOL 1
+#define CONFIG_GOPHER_PROTOCOL 1
+#define CONFIG_HLS_PROTOCOL 1
+#define CONFIG_HTTP_PROTOCOL 1
+#define CONFIG_HTTPPROXY_PROTOCOL 1
+#define CONFIG_HTTPS_PROTOCOL 0
+#define CONFIG_MMSH_PROTOCOL 1
+#define CONFIG_MMST_PROTOCOL 1
+#define CONFIG_MD5_PROTOCOL 1
+#define CONFIG_PIPE_PROTOCOL 1
+#define CONFIG_RTMP_PROTOCOL 1
+#define CONFIG_RTMPE_PROTOCOL 0
+#define CONFIG_RTMPS_PROTOCOL 0
+#define CONFIG_RTMPT_PROTOCOL 1
+#define CONFIG_RTMPTE_PROTOCOL 0
+#define CONFIG_RTMPTS_PROTOCOL 0
+#define CONFIG_RTP_PROTOCOL 1
+#define CONFIG_SCTP_PROTOCOL 0
+#define CONFIG_SRTP_PROTOCOL 1
+#define CONFIG_TCP_PROTOCOL 1
+#define CONFIG_TLS_PROTOCOL 0
+#define CONFIG_UDP_PROTOCOL 1
+#define CONFIG_UNIX_PROTOCOL 1
+#define CONFIG_LIBRTMP_PROTOCOL 0
+#define CONFIG_LIBRTMPE_PROTOCOL 0
+#define CONFIG_LIBRTMPS_PROTOCOL 0
+#define CONFIG_LIBRTMPT_PROTOCOL 0
+#define CONFIG_LIBRTMPTE_PROTOCOL 0
+#define CONFIG_LIBSSH_PROTOCOL 0
+#endif /* FFMPEG_CONFIG_H */
diff --git a/libavcodec/ac3.c b/libavcodec/ac3.c
deleted file mode 100644
index 29e132f..0000000
--- a/libavcodec/ac3.c
+++ b/dev/null
@@ -1,231 +0,0 @@
-/*
- * Common code between the AC-3 encoder and decoder
- * Copyright (c) 2000 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
- * Common code between the AC-3 encoder and decoder.
- */
-
-#include "avcodec.h"
-#include "ac3.h"
-#include "get_bits.h"
-
-/**
- * Starting frequency coefficient bin for each critical band.
- */
-const uint8_t ff_ac3_band_start_tab[AC3_CRITICAL_BANDS+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, 31,
- 34, 37, 40, 43, 46, 49, 55, 61, 67, 73,
- 79, 85, 97, 109, 121, 133, 157, 181, 205, 229, 253
-};
-
-#if CONFIG_HARDCODED_TABLES
-
-/**
- * Map each frequency coefficient bin to the critical band that contains it.
- */
-const uint8_t ff_ac3_bin_to_band_tab[253] = {
- 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, 28, 28, 29, 29, 29, 30, 30, 30,
- 31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34,
- 35, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 36,
- 37, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 38,
- 39, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 40,
- 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
- 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
- 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49
-};
-
-#else /* CONFIG_HARDCODED_TABLES */
-uint8_t ff_ac3_bin_to_band_tab[253];
-#endif
-
-static inline int calc_lowcomp1(int a, int b0, int b1, int c)
-{
- if ((b0 + 256) == b1) {
- a = c;
- } else if (b0 > b1) {
- a = FFMAX(a - 64, 0);
- }
- return a;
-}
-
-static inline int calc_lowcomp(int a, int b0, int b1, int bin)
-{
- if (bin < 7) {
- return calc_lowcomp1(a, b0, b1, 384);
- } else if (bin < 20) {
- return calc_lowcomp1(a, b0, b1, 320);
- } else {
- return FFMAX(a - 128, 0);
- }
-}
-
-void ff_ac3_bit_alloc_calc_psd(int8_t *exp, int start, int end, int16_t *psd,
- int16_t *band_psd)
-{
- int bin, band;
-
- /* exponent mapping to PSD */
- for (bin = start; bin < end; bin++) {
- psd[bin]=(3072 - (exp[bin] << 7));
- }
-
- /* PSD integration */
- bin = start;
- band = ff_ac3_bin_to_band_tab[start];
- do {
- int v = psd[bin++];
- int band_end = FFMIN(ff_ac3_band_start_tab[band+1], end);
- for (; bin < band_end; bin++) {
- int max = FFMAX(v, psd[bin]);
- /* logadd */
- int adr = FFMIN(max - ((v + psd[bin] + 1) >> 1), 255);
- v = max + ff_ac3_log_add_tab[adr];
- }
- band_psd[band++] = v;
- } while (end > ff_ac3_band_start_tab[band]);
-}
-
-int ff_ac3_bit_alloc_calc_mask(AC3BitAllocParameters *s, int16_t *band_psd,
- int start, int end, int fast_gain, int is_lfe,
- int dba_mode, int dba_nsegs, uint8_t *dba_offsets,
- uint8_t *dba_lengths, uint8_t *dba_values,
- int16_t *mask)
-{
- int16_t excite[AC3_CRITICAL_BANDS]; /* excitation */
- int band;
- int band_start, band_end, begin, end1;
- int lowcomp, fastleak, slowleak;
-
- /* excitation function */
- band_start = ff_ac3_bin_to_band_tab[start];
- band_end = ff_ac3_bin_to_band_tab[end-1] + 1;
-
- if (band_start == 0) {
- lowcomp = 0;
- lowcomp = calc_lowcomp1(lowcomp, band_psd[0], band_psd[1], 384);
- excite[0] = band_psd[0] - fast_gain - lowcomp;
- lowcomp = calc_lowcomp1(lowcomp, band_psd[1], band_psd[2], 384);
- excite[1] = band_psd[1] - fast_gain - lowcomp;
- begin = 7;
- for (band = 2; band < 7; band++) {
- if (!(is_lfe && band == 6))
- lowcomp = calc_lowcomp1(lowcomp, band_psd[band], band_psd[band+1], 384);
- fastleak = band_psd[band] - fast_gain;
- slowleak = band_psd[band] - s->slow_gain;
- excite[band] = fastleak - lowcomp;
- if (!(is_lfe && band == 6)) {
- if (band_psd[band] <= band_psd[band+1]) {
- begin = band + 1;
- break;
- }
- }
- }
-
- end1 = FFMIN(band_end, 22);
- for (band = begin; band < end1; band++) {
- if (!(is_lfe && band == 6))
- lowcomp = calc_lowcomp(lowcomp, band_psd[band], band_psd[band+1], band);
- fastleak = FFMAX(fastleak - s->fast_decay, band_psd[band] - fast_gain);
- slowleak = FFMAX(slowleak - s->slow_decay, band_psd[band] - s->slow_gain);
- excite[band] = FFMAX(fastleak - lowcomp, slowleak);
- }
- begin = 22;
- } else {
- /* coupling channel */
- begin = band_start;
- fastleak = (s->cpl_fast_leak << 8) + 768;
- slowleak = (s->cpl_slow_leak << 8) + 768;
- }
-
- for (band = begin; band < band_end; band++) {
- fastleak = FFMAX(fastleak - s->fast_decay, band_psd[band] - fast_gain);
- slowleak = FFMAX(slowleak - s->slow_decay, band_psd[band] - s->slow_gain);
- excite[band] = FFMAX(fastleak, slowleak);
- }
-
- /* compute masking curve */
-
- for (band = band_start; band < band_end; band++) {
- int tmp = s->db_per_bit - band_psd[band];
- if (tmp > 0) {
- excite[band] += tmp >> 2;
- }
- mask[band] = FFMAX(ff_ac3_hearing_threshold_tab[band >> s->sr_shift][s->sr_code], excite[band]);
- }
-
- /* delta bit allocation */
-
- if (dba_mode == DBA_REUSE || dba_mode == DBA_NEW) {
- int i, seg, delta;
- if (dba_nsegs > 8)
- return -1;
- band = band_start;
- for (seg = 0; seg < dba_nsegs; seg++) {
- band += dba_offsets[seg];
- if (band >= AC3_CRITICAL_BANDS || dba_lengths[seg] > AC3_CRITICAL_BANDS-band)
- return -1;
- if (dba_values[seg] >= 4) {
- delta = (dba_values[seg] - 3) << 7;
- } else {
- delta = (dba_values[seg] - 4) << 7;
- }
- for (i = 0; i < dba_lengths[seg]; i++) {
- mask[band++] += delta;
- }
- }
- }
- return 0;
-}
-
-/**
- * Initialize some tables.
- * note: This function must remain thread safe because it is called by the
- * AVParser init code.
- */
-av_cold void ff_ac3_common_init(void)
-{
-#if !CONFIG_HARDCODED_TABLES
- /* compute ff_ac3_bin_to_band_tab from ff_ac3_band_start_tab */
- int bin = 0, band;
- for (band = 0; band < AC3_CRITICAL_BANDS; band++) {
- int band_end = ff_ac3_band_start_tab[band+1];
- while (bin < band_end)
- ff_ac3_bin_to_band_tab[bin++] = band;
- }
-#endif /* !CONFIG_HARDCODED_TABLES */
-}
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
deleted file mode 100644
index 1603f4f..0000000
--- a/libavcodec/ac3dec.c
+++ b/dev/null
@@ -1,1493 +0,0 @@
-/*
- * AC-3 Audio Decoder
- * This code was developed as part of Google Summer of Code 2006.
- * E-AC-3 support was added as part of Google Summer of Code 2007.
- *
- * Copyright (c) 2006 Kartikey Mahendra BHATT (bhattkm at gmail dot com)
- * Copyright (c) 2007-2008 Bartlomiej Wolowiec <bartek.wolowiec@gmail.com>
- * Copyright (c) 2007 Justin Ruggles <justin.ruggles@gmail.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
- */
-
-#include <stdio.h>
-#include <stddef.h>
-#include <math.h>
-#include <string.h>
-
-#include "libavutil/crc.h"
-#include "libavutil/opt.h"
-#include "internal.h"
-#include "aac_ac3_parser.h"
-#include "ac3_parser.h"
-#include "ac3dec.h"
-#include "ac3dec_data.h"
-#include "kbdwin.h"
-
-/**
- * table for ungrouping 3 values in 7 bits.
- * used for exponents and bap=2 mantissas
- */
-static uint8_t ungroup_3_in_7_bits_tab[128][3];
-
-/** tables for ungrouping mantissas */
-static int b1_mantissas[32][3];
-static int b2_mantissas[128][3];
-static int b3_mantissas[8];
-static int b4_mantissas[128][2];
-static int b5_mantissas[16];
-
-/**
- * Quantization table: levels for symmetric. bits for asymmetric.
- * reference: Table 7.18 Mapping of bap to Quantizer
- */
-static const uint8_t quantization_tab[16] = {
- 0, 3, 5, 7, 11, 15,
- 5, 6, 7, 8, 9, 10, 11, 12, 14, 16
-};
-
-/** dynamic range table. converts codes to scale factors. */
-static float dynamic_range_tab[256];
-
-/** Adjustments in dB gain */
-static const float gain_levels[9] = {
- LEVEL_PLUS_3DB,
- LEVEL_PLUS_1POINT5DB,
- LEVEL_ONE,
- LEVEL_MINUS_1POINT5DB,
- LEVEL_MINUS_3DB,
- LEVEL_MINUS_4POINT5DB,
- LEVEL_MINUS_6DB,
- LEVEL_ZERO,
- LEVEL_MINUS_9DB
-};
-
-/**
- * Table for default stereo downmixing coefficients
- * reference: Section 7.8.2 Downmixing Into Two Channels
- */
-static const uint8_t ac3_default_coeffs[8][5][2] = {
- { { 2, 7 }, { 7, 2 }, },
- { { 4, 4 }, },
- { { 2, 7 }, { 7, 2 }, },
- { { 2, 7 }, { 5, 5 }, { 7, 2 }, },
- { { 2, 7 }, { 7, 2 }, { 6, 6 }, },
- { { 2, 7 }, { 5, 5 }, { 7, 2 }, { 8, 8 }, },
- { { 2, 7 }, { 7, 2 }, { 6, 7 }, { 7, 6 }, },
- { { 2, 7 }, { 5, 5 }, { 7, 2 }, { 6, 7 }, { 7, 6 }, },
-};
-
-/**
- * Symmetrical Dequantization
- * reference: Section 7.3.3 Expansion of Mantissas for Symmetrical Quantization
- * Tables 7.19 to 7.23
- */
-static inline int
-symmetric_dequant(int code, int levels)
-{
- return ((code - (levels >> 1)) << 24) / levels;
-}
-
-/*
- * Initialize tables at runtime.
- */
-static av_cold void ac3_tables_init(void)
-{
- int i;
-
- /* generate table for ungrouping 3 values in 7 bits
- reference: Section 7.1.3 Exponent Decoding */
- for (i = 0; i < 128; i++) {
- ungroup_3_in_7_bits_tab[i][0] = i / 25;
- ungroup_3_in_7_bits_tab[i][1] = (i % 25) / 5;
- ungroup_3_in_7_bits_tab[i][2] = (i % 25) % 5;
- }
-
- /* generate grouped mantissa tables
- reference: Section 7.3.5 Ungrouping of Mantissas */
- for (i = 0; i < 32; i++) {
- /* bap=1 mantissas */
- b1_mantissas[i][0] = symmetric_dequant(ff_ac3_ungroup_3_in_5_bits_tab[i][0], 3);
- b1_mantissas[i][1] = symmetric_dequant(ff_ac3_ungroup_3_in_5_bits_tab[i][1], 3);
- b1_mantissas[i][2] = symmetric_dequant(ff_ac3_ungroup_3_in_5_bits_tab[i][2], 3);
- }
- for (i = 0; i < 128; i++) {
- /* bap=2 mantissas */
- b2_mantissas[i][0] = symmetric_dequant(ungroup_3_in_7_bits_tab[i][0], 5);
- b2_mantissas[i][1] = symmetric_dequant(ungroup_3_in_7_bits_tab[i][1], 5);
- b2_mantissas[i][2] = symmetric_dequant(ungroup_3_in_7_bits_tab[i][2], 5);
-
- /* bap=4 mantissas */
- b4_mantissas[i][0] = symmetric_dequant(i / 11, 11);
- b4_mantissas[i][1] = symmetric_dequant(i % 11, 11);
- }
- /* generate ungrouped mantissa tables
- reference: Tables 7.21 and 7.23 */
- for (i = 0; i < 7; i++) {
- /* bap=3 mantissas */
- b3_mantissas[i] = symmetric_dequant(i, 7);
- }
- for (i = 0; i < 15; i++) {
- /* bap=5 mantissas */
- b5_mantissas[i] = symmetric_dequant(i, 15);
- }
-
- /* generate dynamic range table
- reference: Section 7.7.1 Dynamic Range Control */
- for (i = 0; i < 256; i++) {
- int v = (i >> 5) - ((i >> 7) << 3) - 5;
- dynamic_range_tab[i] = powf(2.0f, v) * ((i & 0x1F) | 0x20);
- }
-}
-
-/**
- * AVCodec initialization
- */
-static av_cold int ac3_decode_init(AVCodecContext *avctx)
-{
- AC3DecodeContext *s = avctx->priv_data;
- int i;
-
- s->avctx = avctx;
-
- ff_ac3_common_init();
- ac3_tables_init();
- ff_mdct_init(&s->imdct_256, 8, 1, 1.0);
- ff_mdct_init(&s->imdct_512, 9, 1, 1.0);
- ff_kbd_window_init(s->window, 5.0, 256);
- ff_dsputil_init(&s->dsp, avctx);
- avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
- ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT);
- ff_fmt_convert_init(&s->fmt_conv, avctx);
- av_lfg_init(&s->dith_state, 0);
-
- avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
-
- /* allow downmixing to stereo or mono */
- if (avctx->channels > 0 && avctx->request_channels > 0 &&
- avctx->request_channels < avctx->channels &&
- avctx->request_channels <= 2) {
- avctx->channels = avctx->request_channels;
- }
- s->downmixed = 1;
-
- for (i = 0; i < AC3_MAX_CHANNELS; i++) {
- s->xcfptr[i] = s->transform_coeffs[i];
- s->dlyptr[i] = s->delay[i];
- }
-
- return 0;
-}
-
-/**
- * Parse the 'sync info' and 'bit stream info' from the AC-3 bitstream.
- * GetBitContext within AC3DecodeContext must point to
- * the start of the synchronized AC-3 bitstream.
- */
-static int ac3_parse_header(AC3DecodeContext *s)
-{
- GetBitContext *gbc = &s->gbc;
- int i;
-
- /* read the rest of the bsi. read twice for dual mono mode. */
- i = !s->channel_mode;
- do {
- skip_bits(gbc, 5); // skip dialog normalization
- if (get_bits1(gbc))
- skip_bits(gbc, 8); //skip compression
- if (get_bits1(gbc))
- skip_bits(gbc, 8); //skip language code
- if (get_bits1(gbc))
- skip_bits(gbc, 7); //skip audio production information
- } while (i--);
-
- skip_bits(gbc, 2); //skip copyright bit and original bitstream bit
-
- /* skip the timecodes (or extra bitstream information for Alternate Syntax)
- TODO: read & use the xbsi1 downmix levels */
- if (get_bits1(gbc))
- skip_bits(gbc, 14); //skip timecode1 / xbsi1
- if (get_bits1(gbc))
- skip_bits(gbc, 14); //skip timecode2 / xbsi2
-
- /* skip additional bitstream info */
- if (get_bits1(gbc)) {
- i = get_bits(gbc, 6);
- do {
- skip_bits(gbc, 8);
- } while (i--);
- }
-
- return 0;
-}
-
-/**
- * Common function to parse AC-3 or E-AC-3 frame header
- */
-static int parse_frame_header(AC3DecodeContext *s)
-{
- AC3HeaderInfo hdr;
- int err;
-
- err = avpriv_ac3_parse_header(&s->gbc, &hdr);
- if (err)
- return err;
-
- /* get decoding parameters from header info */
- s->bit_alloc_params.sr_code = hdr.sr_code;
- s->bitstream_mode = hdr.bitstream_mode;
- s->channel_mode = hdr.channel_mode;
- s->channel_layout = hdr.channel_layout;
- s->lfe_on = hdr.lfe_on;
- s->bit_alloc_params.sr_shift = hdr.sr_shift;
- s->sample_rate = hdr.sample_rate;
- s->bit_rate = hdr.bit_rate;
- s->channels = hdr.channels;
- s->fbw_channels = s->channels - s->lfe_on;
- s->lfe_ch = s->fbw_channels + 1;
- s->frame_size = hdr.frame_size;
- s->center_mix_level = hdr.center_mix_level;
- s->surround_mix_level = hdr.surround_mix_level;
- s->num_blocks = hdr.num_blocks;
- s->frame_type = hdr.frame_type;
- s->substreamid = hdr.substreamid;
-
- if (s->lfe_on) {
- s->start_freq[s->lfe_ch] = 0;
- s->end_freq[s->lfe_ch] = 7;
- s->num_exp_groups[s->lfe_ch] = 2;
- s->channel_in_cpl[s->lfe_ch] = 0;
- }
-
- if (hdr.bitstream_id <= 10) {
- s->eac3 = 0;
- s->snr_offset_strategy = 2;
- s->block_switch_syntax = 1;
- s->dither_flag_syntax = 1;
- s->bit_allocation_syntax = 1;
- s->fast_gain_syntax = 0;
- s->first_cpl_leak = 0;
- s->dba_syntax = 1;
- s->skip_syntax = 1;
- memset(s->channel_uses_aht, 0, sizeof(s->channel_uses_aht));
- return ac3_parse_header(s);
- } else if (CONFIG_EAC3_DECODER) {
- s->eac3 = 1;
- return ff_eac3_parse_header(s);
- } else {
- av_log(s->avctx, AV_LOG_ERROR, "E-AC-3 support not compiled in\n");
- return AVERROR(ENOSYS);
- }
-}
-
-/**
- * Set stereo downmixing coefficients based on frame header info.
- * reference: Section 7.8.2 Downmixing Into Two Channels
- */
-static void set_downmix_coeffs(AC3DecodeContext *s)
-{
- int i;
- float cmix = gain_levels[s-> center_mix_level];
- float smix = gain_levels[s->surround_mix_level];
- float norm0, norm1;
-
- for (i = 0; i < s->fbw_channels; i++) {
- s->downmix_coeffs[i][0] = gain_levels[ac3_default_coeffs[s->channel_mode][i][0]];
- s->downmix_coeffs[i][1] = gain_levels[ac3_default_coeffs[s->channel_mode][i][1]];
- }
- if (s->channel_mode > 1 && s->channel_mode & 1) {
- s->downmix_coeffs[1][0] = s->downmix_coeffs[1][1] = cmix;
- }
- if (s->channel_mode == AC3_CHMODE_2F1R || s->channel_mode == AC3_CHMODE_3F1R) {
- int nf = s->channel_mode - 2;
- s->downmix_coeffs[nf][0] = s->downmix_coeffs[nf][1] = smix * LEVEL_MINUS_3DB;
- }
- if (s->channel_mode == AC3_CHMODE_2F2R || s->channel_mode == AC3_CHMODE_3F2R) {
- int nf = s->channel_mode - 4;
- s->downmix_coeffs[nf][0] = s->downmix_coeffs[nf+1][1] = smix;
- }
-
- /* renormalize */
- norm0 = norm1 = 0.0;
- for (i = 0; i < s->fbw_channels; i++) {
- norm0 += s->downmix_coeffs[i][0];
- norm1 += s->downmix_coeffs[i][1];
- }
- norm0 = 1.0f / norm0;
- norm1 = 1.0f / norm1;
- for (i = 0; i < s->fbw_channels; i++) {
- s->downmix_coeffs[i][0] *= norm0;
- s->downmix_coeffs[i][1] *= norm1;
- }
-
- if (s->output_mode == AC3_CHMODE_MONO) {
- for (i = 0; i < s->fbw_channels; i++)
- s->downmix_coeffs[i][0] = (s->downmix_coeffs[i][0] +
- s->downmix_coeffs[i][1]) * LEVEL_MINUS_3DB;
- }
-}
-
-/**
- * Decode the grouped exponents according to exponent strategy.
- * reference: Section 7.1.3 Exponent Decoding
- */
-static int decode_exponents(GetBitContext *gbc, int exp_strategy, int ngrps,
- uint8_t absexp, int8_t *dexps)
-{
- int i, j, grp, group_size;
- int dexp[256];
- int expacc, prevexp;
-
- /* unpack groups */
- group_size = exp_strategy + (exp_strategy == EXP_D45);
- for (grp = 0, i = 0; grp < ngrps; grp++) {
- expacc = get_bits(gbc, 7);
- dexp[i++] = ungroup_3_in_7_bits_tab[expacc][0];
- dexp[i++] = ungroup_3_in_7_bits_tab[expacc][1];
- dexp[i++] = ungroup_3_in_7_bits_tab[expacc][2];
- }
-
- /* convert to absolute exps and expand groups */
- prevexp = absexp;
- for (i = 0, j = 0; i < ngrps * 3; i++) {
- prevexp += dexp[i] - 2;
- if (prevexp > 24U)
- return -1;
- switch (group_size) {
- case 4: dexps[j++] = prevexp;
- dexps[j++] = prevexp;
- case 2: dexps[j++] = prevexp;
- case 1: dexps[j++] = prevexp;
- }
- }
- return 0;
-}
-
-/**
- * Generate transform coefficients for each coupled channel in the coupling
- * range using the coupling coefficients and coupling coordinates.
- * reference: Section 7.4.3 Coupling Coordinate Format
- */
-static void calc_transform_coeffs_cpl(AC3DecodeContext *s)
-{
- int bin, band, ch;
-
- bin = s->start_freq[CPL_CH];
- for (band = 0; band < s->num_cpl_bands; band++) {
- int band_start = bin;
- int band_end = bin + s->cpl_band_sizes[band];
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- if (s->channel_in_cpl[ch]) {
- int cpl_coord = s->cpl_coords[ch][band] << 5;
- for (bin = band_start; bin < band_end; bin++) {
- s->fixed_coeffs[ch][bin] =
- MULH(s->fixed_coeffs[CPL_CH][bin] << 4, cpl_coord);
- }
- if (ch == 2 && s->phase_flags[band]) {
- for (bin = band_start; bin < band_end; bin++)
- s->fixed_coeffs[2][bin] = -s->fixed_coeffs[2][bin];
- }
- }
- }
- bin = band_end;
- }
-}
-
-/**
- * Grouped mantissas for 3-level 5-level and 11-level quantization
- */
-typedef struct {
- int b1_mant[2];
- int b2_mant[2];
- int b4_mant;
- int b1;
- int b2;
- int b4;
-} mant_groups;
-
-/**
- * Decode the transform coefficients for a particular channel
- * reference: Section 7.3 Quantization and Decoding of Mantissas
- */
-static void ac3_decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, mant_groups *m)
-{
- int start_freq = s->start_freq[ch_index];
- int end_freq = s->end_freq[ch_index];
- uint8_t *baps = s->bap[ch_index];
- int8_t *exps = s->dexps[ch_index];
- int32_t *coeffs = s->fixed_coeffs[ch_index];
- int dither = (ch_index == CPL_CH) || s->dither_flag[ch_index];
- GetBitContext *gbc = &s->gbc;
- int freq;
-
- for (freq = start_freq; freq < end_freq; freq++) {
- int bap = baps[freq];
- int mantissa;
- switch (bap) {
- case 0:
- /* random noise with approximate range of -0.707 to 0.707 */
- if (dither)
- mantissa = (((av_lfg_get(&s->dith_state)>>8)*181)>>8) - 5931008;
- else
- mantissa = 0;
- break;
- case 1:
- if (m->b1) {
- m->b1--;
- mantissa = m->b1_mant[m->b1];
- } else {
- int bits = get_bits(gbc, 5);
- mantissa = b1_mantissas[bits][0];
- m->b1_mant[1] = b1_mantissas[bits][1];
- m->b1_mant[0] = b1_mantissas[bits][2];
- m->b1 = 2;
- }
- break;
- case 2:
- if (m->b2) {
- m->b2--;
- mantissa = m->b2_mant[m->b2];
- } else {
- int bits = get_bits(gbc, 7);
- mantissa = b2_mantissas[bits][0];
- m->b2_mant[1] = b2_mantissas[bits][1];
- m->b2_mant[0] = b2_mantissas[bits][2];
- m->b2 = 2;
- }
- break;
- case 3:
- mantissa = b3_mantissas[get_bits(gbc, 3)];
- break;
- case 4:
- if (m->b4) {
- m->b4 = 0;
- mantissa = m->b4_mant;
- } else {
- int bits = get_bits(gbc, 7);
- mantissa = b4_mantissas[bits][0];
- m->b4_mant = b4_mantissas[bits][1];
- m->b4 = 1;
- }
- break;
- case 5:
- mantissa = b5_mantissas[get_bits(gbc, 4)];
- break;
- default: /* 6 to 15 */
- /* Shift mantissa and sign-extend it. */
- mantissa = get_sbits(gbc, quantization_tab[bap]);
- mantissa <<= 24 - quantization_tab[bap];
- break;
- }
- coeffs[freq] = mantissa >> exps[freq];
- }
-}
-
-/**
- * Remove random dithering from coupling range coefficients with zero-bit
- * mantissas for coupled channels which do not use dithering.
- * reference: Section 7.3.4 Dither for Zero Bit Mantissas (bap=0)
- */
-static void remove_dithering(AC3DecodeContext *s) {
- int ch, i;
-
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- if (!s->dither_flag[ch] && s->channel_in_cpl[ch]) {
- for (i = s->start_freq[CPL_CH]; i < s->end_freq[CPL_CH]; i++) {
- if (!s->bap[CPL_CH][i])
- s->fixed_coeffs[ch][i] = 0;
- }
- }
- }
-}
-
-static void decode_transform_coeffs_ch(AC3DecodeContext *s, int blk, int ch,
- mant_groups *m)
-{
- if (!s->channel_uses_aht[ch]) {
- ac3_decode_transform_coeffs_ch(s, ch, m);
- } else {
- /* if AHT is used, mantissas for all blocks are encoded in the first
- block of the frame. */
- int bin;
- if (!blk && CONFIG_EAC3_DECODER)
- ff_eac3_decode_transform_coeffs_aht_ch(s, ch);
- for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {
- s->fixed_coeffs[ch][bin] = s->pre_mantissa[ch][bin][blk] >> s->dexps[ch][bin];
- }
- }
-}
-
-/**
- * Decode the transform coefficients.
- */
-static void decode_transform_coeffs(AC3DecodeContext *s, int blk)
-{
- int ch, end;
- int got_cplchan = 0;
- mant_groups m;
-
- m.b1 = m.b2 = m.b4 = 0;
-
- for (ch = 1; ch <= s->channels; ch++) {
- /* transform coefficients for full-bandwidth channel */
- decode_transform_coeffs_ch(s, blk, ch, &m);
- /* transform coefficients for coupling channel come right after the
- coefficients for the first coupled channel*/
- if (s->channel_in_cpl[ch]) {
- if (!got_cplchan) {
- decode_transform_coeffs_ch(s, blk, CPL_CH, &m);
- calc_transform_coeffs_cpl(s);
- got_cplchan = 1;
- }
- end = s->end_freq[CPL_CH];
- } else {
- end = s->end_freq[ch];
- }
- do
- s->fixed_coeffs[ch][end] = 0;
- while (++end < 256);
- }
-
- /* zero the dithered coefficients for appropriate channels */
- remove_dithering(s);
-}
-
-/**
- * Stereo rematrixing.
- * reference: Section 7.5.4 Rematrixing : Decoding Technique
- */
-static void do_rematrixing(AC3DecodeContext *s)
-{
- int bnd, i;
- int end, bndend;
-
- end = FFMIN(s->end_freq[1], s->end_freq[2]);
-
- for (bnd = 0; bnd < s->num_rematrixing_bands; bnd++) {
- if (s->rematrixing_flags[bnd]) {
- bndend = FFMIN(end, ff_ac3_rematrix_band_tab[bnd + 1]);
- for (i = ff_ac3_rematrix_band_tab[bnd]; i < bndend; i++) {
- int tmp0 = s->fixed_coeffs[1][i];
- s->fixed_coeffs[1][i] += s->fixed_coeffs[2][i];
- s->fixed_coeffs[2][i] = tmp0 - s->fixed_coeffs[2][i];
- }
- }
- }
-}
-
-/**
- * Inverse MDCT Transform.
- * Convert frequency domain coefficients to time-domain audio samples.
- * reference: Section 7.9.4 Transformation Equations
- */
-static inline void do_imdct(AC3DecodeContext *s, int channels)
-{
- int ch;
-
- for (ch = 1; ch <= channels; ch++) {
- if (s->block_switch[ch]) {
- int i;
- float *x = s->tmp_output + 128;
- for (i = 0; i < 128; i++)
- x[i] = s->transform_coeffs[ch][2 * i];
- s->imdct_256.imdct_half(&s->imdct_256, s->tmp_output, x);
- s->fdsp.vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1],
- s->tmp_output, s->window, 128);
- for (i = 0; i < 128; i++)
- x[i] = s->transform_coeffs[ch][2 * i + 1];
- s->imdct_256.imdct_half(&s->imdct_256, s->delay[ch - 1], x);
- } else {
- s->imdct_512.imdct_half(&s->imdct_512, s->tmp_output, s->transform_coeffs[ch]);
- s->fdsp.vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1],
- s->tmp_output, s->window, 128);
- memcpy(s->delay[ch - 1], s->tmp_output + 128, 128 * sizeof(float));
- }
- }
-}
-
-/**
- * Upmix delay samples from stereo to original channel layout.
- */
-static void ac3_upmix_delay(AC3DecodeContext *s)
-{
- int channel_data_size = sizeof(s->delay[0]);
- switch (s->channel_mode) {
- case AC3_CHMODE_DUALMONO:
- case AC3_CHMODE_STEREO:
- /* upmix mono to stereo */
- memcpy(s->delay[1], s->delay[0], channel_data_size);
- break;
- case AC3_CHMODE_2F2R:
- memset(s->delay[3], 0, channel_data_size);
- case AC3_CHMODE_2F1R:
- memset(s->delay[2], 0, channel_data_size);
- break;
- case AC3_CHMODE_3F2R:
- memset(s->delay[4], 0, channel_data_size);
- case AC3_CHMODE_3F1R:
- memset(s->delay[3], 0, channel_data_size);
- case AC3_CHMODE_3F:
- memcpy(s->delay[2], s->delay[1], channel_data_size);
- memset(s->delay[1], 0, channel_data_size);
- break;
- }
-}
-
-/**
- * Decode band structure for coupling, spectral extension, or enhanced coupling.
- * The band structure defines how many subbands are in each band. For each
- * subband in the range, 1 means it is combined with the previous band, and 0
- * means that it starts a new band.
- *
- * @param[in] gbc bit reader context
- * @param[in] blk block number
- * @param[in] eac3 flag to indicate E-AC-3
- * @param[in] ecpl flag to indicate enhanced coupling
- * @param[in] start_subband subband number for start of range
- * @param[in] end_subband subband number for end of range
- * @param[in] default_band_struct default band structure table
- * @param[out] num_bands number of bands (optionally NULL)
- * @param[out] band_sizes array containing the number of bins in each band (optionally NULL)
- */
-static void decode_band_structure(GetBitContext *gbc, int blk, int eac3,
- int ecpl, int start_subband, int end_subband,
- const uint8_t *default_band_struct,
- int *num_bands, uint8_t *band_sizes)
-{
- int subbnd, bnd, n_subbands, n_bands=0;
- uint8_t bnd_sz[22];
- uint8_t coded_band_struct[22];
- const uint8_t *band_struct;
-
- n_subbands = end_subband - start_subband;
-
- /* decode band structure from bitstream or use default */
- if (!eac3 || get_bits1(gbc)) {
- for (subbnd = 0; subbnd < n_subbands - 1; subbnd++) {
- coded_band_struct[subbnd] = get_bits1(gbc);
- }
- band_struct = coded_band_struct;
- } else if (!blk) {
- band_struct = &default_band_struct[start_subband+1];
- } else {
- /* no change in band structure */
- return;
- }
-
- /* calculate number of bands and band sizes based on band structure.
- note that the first 4 subbands in enhanced coupling span only 6 bins
- instead of 12. */
- if (num_bands || band_sizes ) {
- n_bands = n_subbands;
- bnd_sz[0] = ecpl ? 6 : 12;
- for (bnd = 0, subbnd = 1; subbnd < n_subbands; subbnd++) {
- int subbnd_size = (ecpl && subbnd < 4) ? 6 : 12;
- if (band_struct[subbnd - 1]) {
- n_bands--;
- bnd_sz[bnd] += subbnd_size;
- } else {
- bnd_sz[++bnd] = subbnd_size;
- }
- }
- }
-
- /* set optional output params */
- if (num_bands)
- *num_bands = n_bands;
- if (band_sizes)
- memcpy(band_sizes, bnd_sz, n_bands);
-}
-
-/**
- * Decode a single audio block from the AC-3 bitstream.
- */
-static int decode_audio_block(AC3DecodeContext *s, int blk)
-{
- int fbw_channels = s->fbw_channels;
- int channel_mode = s->channel_mode;
- int i, bnd, seg, ch;
- int different_transforms;
- int downmix_output;
- int cpl_in_use;
- GetBitContext *gbc = &s->gbc;
- uint8_t bit_alloc_stages[AC3_MAX_CHANNELS] = { 0 };
-
- /* block switch flags */
- different_transforms = 0;
- if (s->block_switch_syntax) {
- for (ch = 1; ch <= fbw_channels; ch++) {
- s->block_switch[ch] = get_bits1(gbc);
- if (ch > 1 && s->block_switch[ch] != s->block_switch[1])
- different_transforms = 1;
- }
- }
-
- /* dithering flags */
- if (s->dither_flag_syntax) {
- for (ch = 1; ch <= fbw_channels; ch++) {
- s->dither_flag[ch] = get_bits1(gbc);
- }
- }
-
- /* dynamic range */
- i = !s->channel_mode;
- do {
- if (get_bits1(gbc)) {
- s->dynamic_range[i] = ((dynamic_range_tab[get_bits(gbc, 8)] - 1.0) *
- s->drc_scale) + 1.0;
- } else if (blk == 0) {
- s->dynamic_range[i] = 1.0f;
- }
- } while (i--);
-
- /* spectral extension strategy */
- if (s->eac3 && (!blk || get_bits1(gbc))) {
- s->spx_in_use = get_bits1(gbc);
- if (s->spx_in_use) {
- int dst_start_freq, dst_end_freq, src_start_freq,
- start_subband, end_subband;
-
- /* determine which channels use spx */
- if (s->channel_mode == AC3_CHMODE_MONO) {
- s->channel_uses_spx[1] = 1;
- } else {
- for (ch = 1; ch <= fbw_channels; ch++)
- s->channel_uses_spx[ch] = get_bits1(gbc);
- }
-
- /* get the frequency bins of the spx copy region and the spx start
- and end subbands */
- dst_start_freq = get_bits(gbc, 2);
- start_subband = get_bits(gbc, 3) + 2;
- if (start_subband > 7)
- start_subband += start_subband - 7;
- end_subband = get_bits(gbc, 3) + 5;
- if (end_subband > 7)
- end_subband += end_subband - 7;
- dst_start_freq = dst_start_freq * 12 + 25;
- src_start_freq = start_subband * 12 + 25;
- dst_end_freq = end_subband * 12 + 25;
-
- /* check validity of spx ranges */
- if (start_subband >= end_subband) {
- av_log(s->avctx, AV_LOG_ERROR, "invalid spectral extension "
- "range (%d >= %d)\n", start_subband, end_subband);
- return AVERROR_INVALIDDATA;
- }
- if (dst_start_freq >= src_start_freq) {
- av_log(s->avctx, AV_LOG_ERROR, "invalid spectral extension "
- "copy start bin (%d >= %d)\n", dst_start_freq, src_start_freq);
- return AVERROR_INVALIDDATA;
- }
-
- s->spx_dst_start_freq = dst_start_freq;
- s->spx_src_start_freq = src_start_freq;
- s->spx_dst_end_freq = dst_end_freq;
-
- decode_band_structure(gbc, blk, s->eac3, 0,
- start_subband, end_subband,
- ff_eac3_default_spx_band_struct,
- &s->num_spx_bands,
- s->spx_band_sizes);
- } else {
- for (ch = 1; ch <= fbw_channels; ch++) {
- s->channel_uses_spx[ch] = 0;
- s->first_spx_coords[ch] = 1;
- }
- }
- }
-
- /* spectral extension coordinates */
- if (s->spx_in_use) {
- for (ch = 1; ch <= fbw_channels; ch++) {
- if (s->channel_uses_spx[ch]) {
- if (s->first_spx_coords[ch] || get_bits1(gbc)) {
- float spx_blend;
- int bin, master_spx_coord;
-
- s->first_spx_coords[ch] = 0;
- spx_blend = get_bits(gbc, 5) * (1.0f/32);
- master_spx_coord = get_bits(gbc, 2) * 3;
-
- bin = s->spx_src_start_freq;
- for (bnd = 0; bnd < s->num_spx_bands; bnd++) {
- int bandsize;
- int spx_coord_exp, spx_coord_mant;
- float nratio, sblend, nblend, spx_coord;
-
- /* calculate blending factors */
- bandsize = s->spx_band_sizes[bnd];
- nratio = ((float)((bin + (bandsize >> 1))) / s->spx_dst_end_freq) - spx_blend;
- nratio = av_clipf(nratio, 0.0f, 1.0f);
- nblend = sqrtf(3.0f * nratio); // noise is scaled by sqrt(3)
- // to give unity variance
- sblend = sqrtf(1.0f - nratio);
- bin += bandsize;
-
- /* decode spx coordinates */
- spx_coord_exp = get_bits(gbc, 4);
- spx_coord_mant = get_bits(gbc, 2);
- if (spx_coord_exp == 15) spx_coord_mant <<= 1;
- else spx_coord_mant += 4;
- spx_coord_mant <<= (25 - spx_coord_exp - master_spx_coord);
- spx_coord = spx_coord_mant * (1.0f / (1 << 23));
-
- /* multiply noise and signal blending factors by spx coordinate */
- s->spx_noise_blend [ch][bnd] = nblend * spx_coord;
- s->spx_signal_blend[ch][bnd] = sblend * spx_coord;
- }
- }
- } else {
- s->first_spx_coords[ch] = 1;
- }
- }
- }
-
- /* coupling strategy */
- if (s->eac3 ? s->cpl_strategy_exists[blk] : get_bits1(gbc)) {
- memset(bit_alloc_stages, 3, AC3_MAX_CHANNELS);
- if (!s->eac3)
- s->cpl_in_use[blk] = get_bits1(gbc);
- if (s->cpl_in_use[blk]) {
- /* coupling in use */
- int cpl_start_subband, cpl_end_subband;
-
- if (channel_mode < AC3_CHMODE_STEREO) {
- av_log(s->avctx, AV_LOG_ERROR, "coupling not allowed in mono or dual-mono\n");
- return AVERROR_INVALIDDATA;
- }
-
- /* check for enhanced coupling */
- if (s->eac3 && get_bits1(gbc)) {
- /* TODO: parse enhanced coupling strategy info */
- avpriv_request_sample(s->avctx, "Enhanced coupling");
- return AVERROR_PATCHWELCOME;
- }
-
- /* determine which channels are coupled */
- if (s->eac3 && s->channel_mode == AC3_CHMODE_STEREO) {
- s->channel_in_cpl[1] = 1;
- s->channel_in_cpl[2] = 1;
- } else {
- for (ch = 1; ch <= fbw_channels; ch++)
- s->channel_in_cpl[ch] = get_bits1(gbc);
- }
-
- /* phase flags in use */
- if (channel_mode == AC3_CHMODE_STEREO)
- s->phase_flags_in_use = get_bits1(gbc);
-
- /* coupling frequency range */
- cpl_start_subband = get_bits(gbc, 4);
- cpl_end_subband = s->spx_in_use ? (s->spx_src_start_freq - 37) / 12 :
- get_bits(gbc, 4) + 3;
- if (cpl_start_subband >= cpl_end_subband) {
- av_log(s->avctx, AV_LOG_ERROR, "invalid coupling range (%d >= %d)\n",
- cpl_start_subband, cpl_end_subband);
- return AVERROR_INVALIDDATA;
- }
- s->start_freq[CPL_CH] = cpl_start_subband * 12 + 37;
- s->end_freq[CPL_CH] = cpl_end_subband * 12 + 37;
-
- decode_band_structure(gbc, blk, s->eac3, 0, cpl_start_subband,
- cpl_end_subband,
- ff_eac3_default_cpl_band_struct,
- &s->num_cpl_bands, s->cpl_band_sizes);
- } else {
- /* coupling not in use */
- for (ch = 1; ch <= fbw_channels; ch++) {
- s->channel_in_cpl[ch] = 0;
- s->first_cpl_coords[ch] = 1;
- }
- s->first_cpl_leak = s->eac3;
- s->phase_flags_in_use = 0;
- }
- } else if (!s->eac3) {
- if (!blk) {
- av_log(s->avctx, AV_LOG_ERROR, "new coupling strategy must "
- "be present in block 0\n");
- return AVERROR_INVALIDDATA;
- } else {
- s->cpl_in_use[blk] = s->cpl_in_use[blk-1];
- }
- }
- cpl_in_use = s->cpl_in_use[blk];
-
- /* coupling coordinates */
- if (cpl_in_use) {
- int cpl_coords_exist = 0;
-
- for (ch = 1; ch <= fbw_channels; ch++) {
- if (s->channel_in_cpl[ch]) {
- if ((s->eac3 && s->first_cpl_coords[ch]) || get_bits1(gbc)) {
- int master_cpl_coord, cpl_coord_exp, cpl_coord_mant;
- s->first_cpl_coords[ch] = 0;
- cpl_coords_exist = 1;
- master_cpl_coord = 3 * get_bits(gbc, 2);
- for (bnd = 0; bnd < s->num_cpl_bands; bnd++) {
- cpl_coord_exp = get_bits(gbc, 4);
- cpl_coord_mant = get_bits(gbc, 4);
- if (cpl_coord_exp == 15)
- s->cpl_coords[ch][bnd] = cpl_coord_mant << 22;
- else
- s->cpl_coords[ch][bnd] = (cpl_coord_mant + 16) << 21;
- s->cpl_coords[ch][bnd] >>= (cpl_coord_exp + master_cpl_coord);
- }
- } else if (!blk) {
- av_log(s->avctx, AV_LOG_ERROR, "new coupling coordinates must "
- "be present in block 0\n");
- return AVERROR_INVALIDDATA;
- }
- } else {
- /* channel not in coupling */
- s->first_cpl_coords[ch] = 1;
- }
- }
- /* phase flags */
- if (channel_mode == AC3_CHMODE_STEREO && cpl_coords_exist) {
- for (bnd = 0; bnd < s->num_cpl_bands; bnd++) {
- s->phase_flags[bnd] = s->phase_flags_in_use? get_bits1(gbc) : 0;
- }
- }
- }
-
- /* stereo rematrixing strategy and band structure */
- if (channel_mode == AC3_CHMODE_STEREO) {
- if ((s->eac3 && !blk) || get_bits1(gbc)) {
- s->num_rematrixing_bands = 4;
- if (cpl_in_use && s->start_freq[CPL_CH] <= 61) {
- s->num_rematrixing_bands -= 1 + (s->start_freq[CPL_CH] == 37);
- } else if (s->spx_in_use && s->spx_src_start_freq <= 61) {
- s->num_rematrixing_bands--;
- }
- for (bnd = 0; bnd < s->num_rematrixing_bands; bnd++)
- s->rematrixing_flags[bnd] = get_bits1(gbc);
- } else if (!blk) {
- av_log(s->avctx, AV_LOG_WARNING, "Warning: "
- "new rematrixing strategy not present in block 0\n");
- s->num_rematrixing_bands = 0;
- }
- }
-
- /* exponent strategies for each channel */
- for (ch = !cpl_in_use; ch <= s->channels; ch++) {
- if (!s->eac3)
- s->exp_strategy[blk][ch] = get_bits(gbc, 2 - (ch == s->lfe_ch));
- if (s->exp_strategy[blk][ch] != EXP_REUSE)
- bit_alloc_stages[ch] = 3;
- }
-
- /* channel bandwidth */
- for (ch = 1; ch <= fbw_channels; ch++) {
- s->start_freq[ch] = 0;
- if (s->exp_strategy[blk][ch] != EXP_REUSE) {
- int group_size;
- int prev = s->end_freq[ch];
- if (s->channel_in_cpl[ch])
- s->end_freq[ch] = s->start_freq[CPL_CH];
- else if (s->channel_uses_spx[ch])
- s->end_freq[ch] = s->spx_src_start_freq;
- else {
- int bandwidth_code = get_bits(gbc, 6);
- if (bandwidth_code > 60) {
- av_log(s->avctx, AV_LOG_ERROR, "bandwidth code = %d > 60\n", bandwidth_code);
- return AVERROR_INVALIDDATA;
- }
- s->end_freq[ch] = bandwidth_code * 3 + 73;
- }
- group_size = 3 << (s->exp_strategy[blk][ch] - 1);
- s->num_exp_groups[ch] = (s->end_freq[ch] + group_size-4) / group_size;
- if (blk > 0 && s->end_freq[ch] != prev)
- memset(bit_alloc_stages, 3, AC3_MAX_CHANNELS);
- }
- }
- if (cpl_in_use && s->exp_strategy[blk][CPL_CH] != EXP_REUSE) {
- s->num_exp_groups[CPL_CH] = (s->end_freq[CPL_CH] - s->start_freq[CPL_CH]) /
- (3 << (s->exp_strategy[blk][CPL_CH] - 1));
- }
-
- /* decode exponents for each channel */
- for (ch = !cpl_in_use; ch <= s->channels; ch++) {
- if (s->exp_strategy[blk][ch] != EXP_REUSE) {
- s->dexps[ch][0] = get_bits(gbc, 4) << !ch;
- if (decode_exponents(gbc, s->exp_strategy[blk][ch],
- s->num_exp_groups[ch], s->dexps[ch][0],
- &s->dexps[ch][s->start_freq[ch]+!!ch])) {
- av_log(s->avctx, AV_LOG_ERROR, "exponent out-of-range\n");
- return AVERROR_INVALIDDATA;
- }
- if (ch != CPL_CH && ch != s->lfe_ch)
- skip_bits(gbc, 2); /* skip gainrng */
- }
- }
-
- /* bit allocation information */
- if (s->bit_allocation_syntax) {
- if (get_bits1(gbc)) {
- s->bit_alloc_params.slow_decay = ff_ac3_slow_decay_tab[get_bits(gbc, 2)] >> s->bit_alloc_params.sr_shift;
- s->bit_alloc_params.fast_decay = ff_ac3_fast_decay_tab[get_bits(gbc, 2)] >> s->bit_alloc_params.sr_shift;
- s->bit_alloc_params.slow_gain = ff_ac3_slow_gain_tab[get_bits(gbc, 2)];
- s->bit_alloc_params.db_per_bit = ff_ac3_db_per_bit_tab[get_bits(gbc, 2)];
- s->bit_alloc_params.floor = ff_ac3_floor_tab[get_bits(gbc, 3)];
- for (ch = !cpl_in_use; ch <= s->channels; ch++)
- bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 2);
- } else if (!blk) {
- av_log(s->avctx, AV_LOG_ERROR, "new bit allocation info must "
- "be present in block 0\n");
- return AVERROR_INVALIDDATA;
- }
- }
-
- /* signal-to-noise ratio offsets and fast gains (signal-to-mask ratios) */
- if (!s->eac3 || !blk) {
- if (s->snr_offset_strategy && get_bits1(gbc)) {
- int snr = 0;
- int csnr;
- csnr = (get_bits(gbc, 6) - 15) << 4;
- for (i = ch = !cpl_in_use; ch <= s->channels; ch++) {
- /* snr offset */
- if (ch == i || s->snr_offset_strategy == 2)
- snr = (csnr + get_bits(gbc, 4)) << 2;
- /* run at least last bit allocation stage if snr offset changes */
- if (blk && s->snr_offset[ch] != snr) {
- bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 1);
- }
- s->snr_offset[ch] = snr;
-
- /* fast gain (normal AC-3 only) */
- if (!s->eac3) {
- int prev = s->fast_gain[ch];
- s->fast_gain[ch] = ff_ac3_fast_gain_tab[get_bits(gbc, 3)];
- /* run last 2 bit allocation stages if fast gain changes */
- if (blk && prev != s->fast_gain[ch])
- bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 2);
- }
- }
- } else if (!s->eac3 && !blk) {
- av_log(s->avctx, AV_LOG_ERROR, "new snr offsets must be present in block 0\n");
- return AVERROR_INVALIDDATA;
- }
- }
-
- /* fast gain (E-AC-3 only) */
- if (s->fast_gain_syntax && get_bits1(gbc)) {
- for (ch = !cpl_in_use; ch <= s->channels; ch++) {
- int prev = s->fast_gain[ch];
- s->fast_gain[ch] = ff_ac3_fast_gain_tab[get_bits(gbc, 3)];
- /* run last 2 bit allocation stages if fast gain changes */
- if (blk && prev != s->fast_gain[ch])
- bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 2);
- }
- } else if (s->eac3 && !blk) {
- for (ch = !cpl_in_use; ch <= s->channels; ch++)
- s->fast_gain[ch] = ff_ac3_fast_gain_tab[4];
- }
-
- /* E-AC-3 to AC-3 converter SNR offset */
- if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT && get_bits1(gbc)) {
- skip_bits(gbc, 10); // skip converter snr offset
- }
-
- /* coupling leak information */
- if (cpl_in_use) {
- if (s->first_cpl_leak || get_bits1(gbc)) {
- int fl = get_bits(gbc, 3);
- int sl = get_bits(gbc, 3);
- /* run last 2 bit allocation stages for coupling channel if
- coupling leak changes */
- if (blk && (fl != s->bit_alloc_params.cpl_fast_leak ||
- sl != s->bit_alloc_params.cpl_slow_leak)) {
- bit_alloc_stages[CPL_CH] = FFMAX(bit_alloc_stages[CPL_CH], 2);
- }
- s->bit_alloc_params.cpl_fast_leak = fl;
- s->bit_alloc_params.cpl_slow_leak = sl;
- } else if (!s->eac3 && !blk) {
- av_log(s->avctx, AV_LOG_ERROR, "new coupling leak info must "
- "be present in block 0\n");
- return AVERROR_INVALIDDATA;
- }
- s->first_cpl_leak = 0;
- }
-
- /* delta bit allocation information */
- if (s->dba_syntax && get_bits1(gbc)) {
- /* delta bit allocation exists (strategy) */
- for (ch = !cpl_in_use; ch <= fbw_channels; ch++) {
- s->dba_mode[ch] = get_bits(gbc, 2);
- if (s->dba_mode[ch] == DBA_RESERVED) {
- av_log(s->avctx, AV_LOG_ERROR, "delta bit allocation strategy reserved\n");
- return AVERROR_INVALIDDATA;
- }
- bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 2);
- }
- /* channel delta offset, len and bit allocation */
- for (ch = !cpl_in_use; ch <= fbw_channels; ch++) {
- if (s->dba_mode[ch] == DBA_NEW) {
- s->dba_nsegs[ch] = get_bits(gbc, 3) + 1;
- for (seg = 0; seg < s->dba_nsegs[ch]; seg++) {
- s->dba_offsets[ch][seg] = get_bits(gbc, 5);
- s->dba_lengths[ch][seg] = get_bits(gbc, 4);
- s->dba_values[ch][seg] = get_bits(gbc, 3);
- }
- /* run last 2 bit allocation stages if new dba values */
- bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 2);
- }
- }
- } else if (blk == 0) {
- for (ch = 0; ch <= s->channels; ch++) {
- s->dba_mode[ch] = DBA_NONE;
- }
- }
-
- /* Bit allocation */
- for (ch = !cpl_in_use; ch <= s->channels; ch++) {
- if (bit_alloc_stages[ch] > 2) {
- /* Exponent mapping into PSD and PSD integration */
- ff_ac3_bit_alloc_calc_psd(s->dexps[ch],
- s->start_freq[ch], s->end_freq[ch],
- s->psd[ch], s->band_psd[ch]);
- }
- if (bit_alloc_stages[ch] > 1) {
- /* Compute excitation function, Compute masking curve, and
- Apply delta bit allocation */
- if (ff_ac3_bit_alloc_calc_mask(&s->bit_alloc_params, s->band_psd[ch],
- s->start_freq[ch], s->end_freq[ch],
- s->fast_gain[ch], (ch == s->lfe_ch),
- s->dba_mode[ch], s->dba_nsegs[ch],
- s->dba_offsets[ch], s->dba_lengths[ch],
- s->dba_values[ch], s->mask[ch])) {
- av_log(s->avctx, AV_LOG_ERROR, "error in bit allocation\n");
- return AVERROR_INVALIDDATA;
- }
- }
- if (bit_alloc_stages[ch] > 0) {
- /* Compute bit allocation */
- const uint8_t *bap_tab = s->channel_uses_aht[ch] ?
- ff_eac3_hebap_tab : ff_ac3_bap_tab;
- s->ac3dsp.bit_alloc_calc_bap(s->mask[ch], s->psd[ch],
- s->start_freq[ch], s->end_freq[ch],
- s->snr_offset[ch],
- s->bit_alloc_params.floor,
- bap_tab, s->bap[ch]);
- }
- }
-
- /* unused dummy data */
- if (s->skip_syntax && get_bits1(gbc)) {
- int skipl = get_bits(gbc, 9);
- while (skipl--)
- skip_bits(gbc, 8);
- }
-
- /* unpack the transform coefficients
- this also uncouples channels if coupling is in use. */
- decode_transform_coeffs(s, blk);
-
- /* TODO: generate enhanced coupling coordinates and uncouple */
-
- /* recover coefficients if rematrixing is in use */
- if (s->channel_mode == AC3_CHMODE_STEREO)
- do_rematrixing(s);
-
- /* apply scaling to coefficients (headroom, dynrng) */
- for (ch = 1; ch <= s->channels; ch++) {
- float gain = 1.0 / 4194304.0f;
- if (s->channel_mode == AC3_CHMODE_DUALMONO) {
- gain *= s->dynamic_range[2 - ch];
- } else {
- gain *= s->dynamic_range[0];
- }
- s->fmt_conv.int32_to_float_fmul_scalar(s->transform_coeffs[ch],
- s->fixed_coeffs[ch], gain, 256);
- }
-
- /* apply spectral extension to high frequency bins */
- if (s->spx_in_use && CONFIG_EAC3_DECODER) {
- ff_eac3_apply_spectral_extension(s);
- }
-
- /* downmix and MDCT. order depends on whether block switching is used for
- any channel in this block. this is because coefficients for the long
- and short transforms cannot be mixed. */
- downmix_output = s->channels != s->out_channels &&
- !((s->output_mode & AC3_OUTPUT_LFEON) &&
- s->fbw_channels == s->out_channels);
- if (different_transforms) {
- /* the delay samples have already been downmixed, so we upmix the delay
- samples in order to reconstruct all channels before downmixing. */
- if (s->downmixed) {
- s->downmixed = 0;
- ac3_upmix_delay(s);
- }
-
- do_imdct(s, s->channels);
-
- if (downmix_output) {
- s->ac3dsp.downmix(s->outptr, s->downmix_coeffs,
- s->out_channels, s->fbw_channels, 256);
- }
- } else {
- if (downmix_output) {
- s->ac3dsp.downmix(s->xcfptr + 1, s->downmix_coeffs,
- s->out_channels, s->fbw_channels, 256);
- }
-
- if (downmix_output && !s->downmixed) {
- s->downmixed = 1;
- s->ac3dsp.downmix(s->dlyptr, s->downmix_coeffs, s->out_channels,
- s->fbw_channels, 128);
- }
-
- do_imdct(s, s->out_channels);
- }
-
- return 0;
-}
-
-/**
- * Decode a single AC-3 frame.
- */
-static int ac3_decode_frame(AVCodecContext * avctx, void *data,
- int *got_frame_ptr, AVPacket *avpkt)
-{
- AVFrame *frame = data;
- const uint8_t *buf = avpkt->data;
- int buf_size = avpkt->size;
- AC3DecodeContext *s = avctx->priv_data;
- int blk, ch, err, ret;
- const uint8_t *channel_map;
- const float *output[AC3_MAX_CHANNELS];
-
- /* copy input buffer to decoder context to avoid reading past the end
- of the buffer, which can be caused by a damaged input stream. */
- if (buf_size >= 2 && AV_RB16(buf) == 0x770B) {
- // seems to be byte-swapped AC-3
- int cnt = FFMIN(buf_size, AC3_FRAME_BUFFER_SIZE) >> 1;
- s->dsp.bswap16_buf((uint16_t *)s->input_buffer, (const uint16_t *)buf, cnt);
- } else
- memcpy(s->input_buffer, buf, FFMIN(buf_size, AC3_FRAME_BUFFER_SIZE));
- buf = s->input_buffer;
- /* initialize the GetBitContext with the start of valid AC-3 Frame */
- init_get_bits(&s->gbc, buf, buf_size * 8);
-
- /* parse the syncinfo */
- err = parse_frame_header(s);
-
- if (err) {
- switch (err) {
- case AAC_AC3_PARSE_ERROR_SYNC:
- av_log(avctx, AV_LOG_ERROR, "frame sync error\n");
- return AVERROR_INVALIDDATA;
- case AAC_AC3_PARSE_ERROR_BSID:
- av_log(avctx, AV_LOG_ERROR, "invalid bitstream id\n");
- break;
- case AAC_AC3_PARSE_ERROR_SAMPLE_RATE:
- av_log(avctx, AV_LOG_ERROR, "invalid sample rate\n");
- break;
- case AAC_AC3_PARSE_ERROR_FRAME_SIZE:
- av_log(avctx, AV_LOG_ERROR, "invalid frame size\n");
- break;
- case AAC_AC3_PARSE_ERROR_FRAME_TYPE:
- /* skip frame if CRC is ok. otherwise use error concealment. */
- /* TODO: add support for substreams and dependent frames */
- if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT || s->substreamid) {
- av_log(avctx, AV_LOG_WARNING, "unsupported frame type : "
- "skipping frame\n");
- *got_frame_ptr = 0;
- return buf_size;
- } else {
- av_log(avctx, AV_LOG_ERROR, "invalid frame type\n");
- }
- break;
- case AAC_AC3_PARSE_ERROR_CRC:
- case AAC_AC3_PARSE_ERROR_CHANNEL_CFG:
- break;
- default: // Normal AVERROR do not try to recover.
- *got_frame_ptr = 0;
- return err;
- }
- } else {
- /* check that reported frame size fits in input buffer */
- if (s->frame_size > buf_size) {
- av_log(avctx, AV_LOG_ERROR, "incomplete frame\n");
- err = AAC_AC3_PARSE_ERROR_FRAME_SIZE;
- } else if (avctx->err_recognition & (AV_EF_CRCCHECK|AV_EF_CAREFUL)) {
- /* check for crc mismatch */
- if (av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, &buf[2],
- s->frame_size - 2)) {
- av_log(avctx, AV_LOG_ERROR, "frame CRC mismatch\n");
- if (avctx->err_recognition & AV_EF_EXPLODE)
- return AVERROR_INVALIDDATA;
- err = AAC_AC3_PARSE_ERROR_CRC;
- }
- }
- }
-
- /* if frame is ok, set audio parameters */
- if (!err) {
- avctx->sample_rate = s->sample_rate;
- avctx->bit_rate = s->bit_rate;
- }
-
- /* channel config */
- if (!err || (s->channels && s->out_channels != s->channels)) {
- s->out_channels = s->channels;
- s->output_mode = s->channel_mode;
- if (s->lfe_on)
- s->output_mode |= AC3_OUTPUT_LFEON;
- if (avctx->request_channels > 0 && avctx->request_channels <= 2 &&
- avctx->request_channels < s->channels) {
- s->out_channels = avctx->request_channels;
- s->output_mode = avctx->request_channels == 1 ? AC3_CHMODE_MONO : AC3_CHMODE_STEREO;
- s->channel_layout = avpriv_ac3_channel_layout_tab[s->output_mode];
- }
- avctx->channels = s->out_channels;
- avctx->channel_layout = s->channel_layout;
-
- s->loro_center_mix_level = gain_levels[s-> center_mix_level];
- s->loro_surround_mix_level = gain_levels[s->surround_mix_level];
- s->ltrt_center_mix_level = LEVEL_MINUS_3DB;
- s->ltrt_surround_mix_level = LEVEL_MINUS_3DB;
- /* set downmixing coefficients if needed */
- if (s->channels != s->out_channels && !((s->output_mode & AC3_OUTPUT_LFEON) &&
- s->fbw_channels == s->out_channels)) {
- set_downmix_coeffs(s);
- }
- } else if (!s->channels) {
- av_log(avctx, AV_LOG_ERROR, "unable to determine channel mode\n");
- return AVERROR_INVALIDDATA;
- }
- avctx->channels = s->out_channels;
-
- /* set audio service type based on bitstream mode for AC-3 */
- avctx->audio_service_type = s->bitstream_mode;
- if (s->bitstream_mode == 0x7 && s->channels > 1)
- avctx->audio_service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE;
-
- /* get output buffer */
- frame->nb_samples = s->num_blocks * AC3_BLOCK_SIZE;
- if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
- return ret;
-
- /* decode the audio blocks */
- channel_map = ff_ac3_dec_channel_map[s->output_mode & ~AC3_OUTPUT_LFEON][s->lfe_on];
- for (ch = 0; ch < AC3_MAX_CHANNELS; ch++) {
- output[ch] = s->output[ch];
- s->outptr[ch] = s->output[ch];
- }
- for (ch = 0; ch < s->channels; ch++) {
- if (ch < s->out_channels)
- s->outptr[channel_map[ch]] = (float *)frame->data[ch];
- }
- for (blk = 0; blk < s->num_blocks; blk++) {
- if (!err && decode_audio_block(s, blk)) {
- av_log(avctx, AV_LOG_ERROR, "error decoding the audio block\n");
- err = 1;
- }
- if (err)
- for (ch = 0; ch < s->out_channels; ch++)
- memcpy(((float*)frame->data[ch]) + AC3_BLOCK_SIZE*blk, output[ch], sizeof(**output) * AC3_BLOCK_SIZE);
- for (ch = 0; ch < s->out_channels; ch++)
- output[ch] = s->outptr[channel_map[ch]];
- for (ch = 0; ch < s->out_channels; ch++) {
- if (!ch || channel_map[ch])
- s->outptr[channel_map[ch]] += AC3_BLOCK_SIZE;
- }
- }
-
- av_frame_set_decode_error_flags(frame, err ? FF_DECODE_ERROR_INVALID_BITSTREAM : 0);
-
- /* keep last block for error concealment in next frame */
- for (ch = 0; ch < s->out_channels; ch++)
- memcpy(s->output[ch], output[ch], sizeof(**output) * AC3_BLOCK_SIZE);
-
- *got_frame_ptr = 1;
-
- return FFMIN(buf_size, s->frame_size);
-}
-
-/**
- * Uninitialize the AC-3 decoder.
- */
-static av_cold int ac3_decode_end(AVCodecContext *avctx)
-{
- AC3DecodeContext *s = avctx->priv_data;
- ff_mdct_end(&s->imdct_512);
- ff_mdct_end(&s->imdct_256);
-
- return 0;
-}
-
-#define OFFSET(x) offsetof(AC3DecodeContext, x)
-#define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM)
-static const AVOption options[] = {
- { "drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), AV_OPT_TYPE_FLOAT, {.dbl = 1.0}, 0.0, 1.0, PAR },
-
-{"dmix_mode", "Preferred Stereo Downmix Mode", OFFSET(preferred_stereo_downmix), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 2, 0, "dmix_mode"},
-{"ltrt_cmixlev", "Lt/Rt Center Mix Level", OFFSET(ltrt_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
-{"ltrt_surmixlev", "Lt/Rt Surround Mix Level", OFFSET(ltrt_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
-{"loro_cmixlev", "Lo/Ro Center Mix Level", OFFSET(loro_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
-{"loro_surmixlev", "Lo/Ro Surround Mix Level", OFFSET(loro_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
-
- { NULL},
-};
-
-static const AVClass ac3_decoder_class = {
- .class_name = "AC3 decoder",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_ac3_decoder = {
- .name = "ac3",
- .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
- .type = AVMEDIA_TYPE_AUDIO,
- .id = AV_CODEC_ID_AC3,
- .priv_data_size = sizeof (AC3DecodeContext),
- .init = ac3_decode_init,
- .close = ac3_decode_end,
- .decode = ac3_decode_frame,
- .capabilities = CODEC_CAP_DR1,
- .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
- AV_SAMPLE_FMT_NONE },
- .priv_class = &ac3_decoder_class,
-};
-
-#if CONFIG_EAC3_DECODER
-static const AVClass eac3_decoder_class = {
- .class_name = "E-AC3 decoder",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_eac3_decoder = {
- .name = "eac3",
- .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"),
- .type = AVMEDIA_TYPE_AUDIO,
- .id = AV_CODEC_ID_EAC3,
- .priv_data_size = sizeof (AC3DecodeContext),
- .init = ac3_decode_init,
- .close = ac3_decode_end,
- .decode = ac3_decode_frame,
- .capabilities = CODEC_CAP_DR1,
- .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
- AV_SAMPLE_FMT_NONE },
- .priv_class = &eac3_decoder_class,
-};
-#endif
diff --git a/libavcodec/ac3dec.h b/libavcodec/ac3dec.h
deleted file mode 100644
index ae72d80..0000000
--- a/libavcodec/ac3dec.h
+++ b/dev/null
@@ -1,241 +0,0 @@
-/*
- * Common code between the AC-3 and E-AC-3 decoders
- * Copyright (c) 2007 Bartlomiej Wolowiec <bartek.wolowiec@gmail.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
- */
-
-/**
- * @file
- * Common code between the AC-3 and E-AC-3 decoders.
- *
- * Summary of MDCT Coefficient Grouping:
- * The individual MDCT coefficient indices are often referred to in the
- * (E-)AC-3 specification as frequency bins. These bins are grouped together
- * into subbands of 12 coefficients each. The subbands are grouped together
- * into bands as defined in the bitstream by the band structures, which
- * determine the number of bands and the size of each band. The full spectrum
- * of 256 frequency bins is divided into 1 DC bin + 21 subbands = 253 bins.
- * This system of grouping coefficients is used for channel bandwidth, stereo
- * rematrixing, channel coupling, enhanced coupling, and spectral extension.
- *
- * +-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-+
- * |1| |12| | [12|12|12|12] | | | | | | | | | | | | |3|
- * +-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-+
- * ~~~ ~~~~ ~~~~~~~~~~~~~ ~~~
- * | | | |
- * | | | 3 unused frequency bins--+
- * | | |
- * | | +--1 band containing 4 subbands
- * | |
- * | +--1 subband of 12 frequency bins
- * |
- * +--DC frequency bin
- */
-
-#ifndef AVCODEC_AC3DEC_H
-#define AVCODEC_AC3DEC_H
-
-#include "libavutil/float_dsp.h"
-#include "libavutil/lfg.h"
-#include "ac3.h"
-#include "ac3dsp.h"
-#include "get_bits.h"
-#include "dsputil.h"
-#include "fft.h"
-#include "fmtconvert.h"
-
-#define AC3_OUTPUT_LFEON 8
-
-#define SPX_MAX_BANDS 17
-
-/** Large enough for maximum possible frame size when the specification limit is ignored */
-#define AC3_FRAME_BUFFER_SIZE 32768
-
-typedef struct AC3DecodeContext {
- AVClass *class; ///< class for AVOptions
- AVCodecContext *avctx; ///< parent context
- GetBitContext gbc; ///< bitstream reader
-
-///@name Bit stream information
-///@{
- int frame_type; ///< frame type (strmtyp)
- int substreamid; ///< substream identification
- int frame_size; ///< current frame size, in bytes
- int bit_rate; ///< stream bit rate, in bits-per-second
- int sample_rate; ///< sample frequency, in Hz
- int num_blocks; ///< number of audio blocks
- int bitstream_mode; ///< bitstream mode (bsmod)
- int channel_mode; ///< channel mode (acmod)
- int channel_layout; ///< channel layout
- int lfe_on; ///< lfe channel in use
- int channel_map; ///< custom channel map
- int center_mix_level; ///< Center mix level index
- int surround_mix_level; ///< Surround mix level index
- int eac3; ///< indicates if current frame is E-AC-3
-///@}
-
- int preferred_stereo_downmix;
- float ltrt_center_mix_level;
- float ltrt_surround_mix_level;
- float loro_center_mix_level;
- float loro_surround_mix_level;
-
-///@name Frame syntax parameters
- int snr_offset_strategy; ///< SNR offset strategy (snroffststr)
- int block_switch_syntax; ///< block switch syntax enabled (blkswe)
- int dither_flag_syntax; ///< dither flag syntax enabled (dithflage)
- int bit_allocation_syntax; ///< bit allocation model syntax enabled (bamode)
- int fast_gain_syntax; ///< fast gain codes enabled (frmfgaincode)
- int dba_syntax; ///< delta bit allocation syntax enabled (dbaflde)
- int skip_syntax; ///< skip field syntax enabled (skipflde)
- ///@}
-
-///@name Standard coupling
- int cpl_in_use[AC3_MAX_BLOCKS]; ///< coupling in use (cplinu)
- int cpl_strategy_exists[AC3_MAX_BLOCKS];///< coupling strategy exists (cplstre)
- int channel_in_cpl[AC3_MAX_CHANNELS]; ///< channel in coupling (chincpl)
- int phase_flags_in_use; ///< phase flags in use (phsflginu)
- int phase_flags[AC3_MAX_CPL_BANDS]; ///< phase flags (phsflg)
- int num_cpl_bands; ///< number of coupling bands (ncplbnd)
- uint8_t cpl_band_sizes[AC3_MAX_CPL_BANDS]; ///< number of coeffs in each coupling band
- int firstchincpl; ///< first channel in coupling
- int first_cpl_coords[AC3_MAX_CHANNELS]; ///< first coupling coordinates states (firstcplcos)
- int cpl_coords[AC3_MAX_CHANNELS][AC3_MAX_CPL_BANDS]; ///< coupling coordinates (cplco)
-///@}
-
-///@name Spectral extension
-///@{
- int spx_in_use; ///< spectral extension in use (spxinu)
- uint8_t channel_uses_spx[AC3_MAX_CHANNELS]; ///< channel uses spectral extension (chinspx)
- int8_t spx_atten_code[AC3_MAX_CHANNELS]; ///< spx attenuation code (spxattencod)
- int spx_src_start_freq; ///< spx start frequency bin
- int spx_dst_end_freq; ///< spx end frequency bin
- int spx_dst_start_freq; ///< spx starting frequency bin for copying (copystartmant)
- ///< the copy region ends at the start of the spx region.
- int num_spx_bands; ///< number of spx bands (nspxbnds)
- uint8_t spx_band_sizes[SPX_MAX_BANDS]; ///< number of bins in each spx band
- uint8_t first_spx_coords[AC3_MAX_CHANNELS]; ///< first spx coordinates states (firstspxcos)
- float spx_noise_blend[AC3_MAX_CHANNELS][SPX_MAX_BANDS]; ///< spx noise blending factor (nblendfact)
- float spx_signal_blend[AC3_MAX_CHANNELS][SPX_MAX_BANDS];///< spx signal blending factor (sblendfact)
-///@}
-
-///@name Adaptive hybrid transform
- int channel_uses_aht[AC3_MAX_CHANNELS]; ///< channel AHT in use (chahtinu)
- int pre_mantissa[AC3_MAX_CHANNELS][AC3_MAX_COEFS][AC3_MAX_BLOCKS]; ///< pre-IDCT mantissas
-///@}
-
-///@name Channel
- int fbw_channels; ///< number of full-bandwidth channels
- int channels; ///< number of total channels
- int lfe_ch; ///< index of LFE channel
- float downmix_coeffs[AC3_MAX_CHANNELS][2]; ///< stereo downmix coefficients
- int downmixed; ///< indicates if coeffs are currently downmixed
- int output_mode; ///< output channel configuration
- int out_channels; ///< number of output channels
-///@}
-
-///@name Dynamic range
- float dynamic_range[2]; ///< dynamic range
- float drc_scale; ///< percentage of dynamic range compression to be applied
-///@}
-
-///@name Bandwidth
- int start_freq[AC3_MAX_CHANNELS]; ///< start frequency bin (strtmant)
- int end_freq[AC3_MAX_CHANNELS]; ///< end frequency bin (endmant)
-///@}
-
-///@name Rematrixing
- int num_rematrixing_bands; ///< number of rematrixing bands (nrematbnd)
- int rematrixing_flags[4]; ///< rematrixing flags (rematflg)
-///@}
-
-///@name Exponents
- int num_exp_groups[AC3_MAX_CHANNELS]; ///< Number of exponent groups (nexpgrp)
- int8_t dexps[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< decoded exponents
- int exp_strategy[AC3_MAX_BLOCKS][AC3_MAX_CHANNELS]; ///< exponent strategies (expstr)
-///@}
-
-///@name Bit allocation
- AC3BitAllocParameters bit_alloc_params; ///< bit allocation parameters
- int first_cpl_leak; ///< first coupling leak state (firstcplleak)
- int snr_offset[AC3_MAX_CHANNELS]; ///< signal-to-noise ratio offsets (snroffst)
- int fast_gain[AC3_MAX_CHANNELS]; ///< fast gain values/SMR's (fgain)
- uint8_t bap[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< bit allocation pointers
- int16_t psd[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< scaled exponents
- int16_t band_psd[AC3_MAX_CHANNELS][AC3_CRITICAL_BANDS]; ///< interpolated exponents
- int16_t mask[AC3_MAX_CHANNELS][AC3_CRITICAL_BANDS]; ///< masking curve values
- int dba_mode[AC3_MAX_CHANNELS]; ///< delta bit allocation mode
- int dba_nsegs[AC3_MAX_CHANNELS]; ///< number of delta segments
- uint8_t dba_offsets[AC3_MAX_CHANNELS][8]; ///< delta segment offsets
- uint8_t dba_lengths[AC3_MAX_CHANNELS][8]; ///< delta segment lengths
- uint8_t dba_values[AC3_MAX_CHANNELS][8]; ///< delta values for each segment
-///@}
-
-///@name Zero-mantissa dithering
- int dither_flag[AC3_MAX_CHANNELS]; ///< dither flags (dithflg)
- AVLFG dith_state; ///< for dither generation
-///@}
-
-///@name IMDCT
- int block_switch[AC3_MAX_CHANNELS]; ///< block switch flags (blksw)
- FFTContext imdct_512; ///< for 512 sample IMDCT
- FFTContext imdct_256; ///< for 256 sample IMDCT
-///@}
-
-///@name Optimization
- DSPContext dsp; ///< for optimization
- AVFloatDSPContext fdsp;
- AC3DSPContext ac3dsp;
- FmtConvertContext fmt_conv; ///< optimized conversion functions
-///@}
-
- float *outptr[AC3_MAX_CHANNELS];
- float *xcfptr[AC3_MAX_CHANNELS];
- float *dlyptr[AC3_MAX_CHANNELS];
-
-///@name Aligned arrays
- DECLARE_ALIGNED(16, int32_t, fixed_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< fixed-point transform coefficients
- DECLARE_ALIGNED(32, float, transform_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< transform coefficients
- DECLARE_ALIGNED(32, float, delay)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]; ///< delay - added to the next block
- DECLARE_ALIGNED(32, float, window)[AC3_BLOCK_SIZE]; ///< window coefficients
- DECLARE_ALIGNED(32, float, tmp_output)[AC3_BLOCK_SIZE]; ///< temporary storage for output before windowing
- DECLARE_ALIGNED(32, float, output)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]; ///< output after imdct transform and windowing
- DECLARE_ALIGNED(32, uint8_t, input_buffer)[AC3_FRAME_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; ///< temp buffer to prevent overread
-///@}
-} AC3DecodeContext;
-
-/**
- * Parse the E-AC-3 frame header.
- * This parses both the bit stream info and audio frame header.
- */
-int ff_eac3_parse_header(AC3DecodeContext *s);
-
-/**
- * Decode mantissas in a single channel for the entire frame.
- * This is used when AHT mode is enabled.
- */
-void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch);
-
-/**
- * Apply spectral extension to each channel by copying lower frequency
- * coefficients to higher frequency bins and applying side information to
- * approximate the original high frequency signal.
- */
-void ff_eac3_apply_spectral_extension(AC3DecodeContext *s);
-
-#endif /* AVCODEC_AC3DEC_H */
diff --git a/libavcodec/ac3dec_data.c b/libavcodec/ac3dec_data.c
deleted file mode 100644
index d0a9b1e..0000000
--- a/libavcodec/ac3dec_data.c
+++ b/dev/null
@@ -1,60 +0,0 @@
-/*
- * AC-3 and E-AC-3 decoder tables
- * Copyright (c) 2007 Bartlomiej Wolowiec <bartek.wolowiec@gmail.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
- */
-
-/**
- * @file
- * Tables taken directly from the AC-3 spec.
- */
-
-#include "ac3dec_data.h"
-#include "ac3.h"
-
-/**
- * Table used to ungroup 3 values stored in 5 bits.
- * Used by bap=1 mantissas and GAQ.
- * ff_ac3_ungroup_3_in_5_bits_tab[i] = { i/9, (i%9)/3, (i%9)%3 }
- */
-const uint8_t ff_ac3_ungroup_3_in_5_bits_tab[32][3] = {
- { 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 2 }, { 0, 1, 0 },
- { 0, 1, 1 }, { 0, 1, 2 }, { 0, 2, 0 }, { 0, 2, 1 },
- { 0, 2, 2 }, { 1, 0, 0 }, { 1, 0, 1 }, { 1, 0, 2 },
- { 1, 1, 0 }, { 1, 1, 1 }, { 1, 1, 2 }, { 1, 2, 0 },
- { 1, 2, 1 }, { 1, 2, 2 }, { 2, 0, 0 }, { 2, 0, 1 },
- { 2, 0, 2 }, { 2, 1, 0 }, { 2, 1, 1 }, { 2, 1, 2 },
- { 2, 2, 0 }, { 2, 2, 1 }, { 2, 2, 2 }, { 3, 0, 0 },
- { 3, 0, 1 }, { 3, 0, 2 }, { 3, 1, 0 }, { 3, 1, 1 }
-};
-
-const uint8_t ff_eac3_hebap_tab[64] = {
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 8,
- 8, 8, 9, 9, 9, 10, 10, 10, 10, 11,
- 11, 11, 11, 12, 12, 12, 12, 13, 13, 13,
- 13, 14, 14, 14, 14, 15, 15, 15, 15, 16,
- 16, 16, 16, 17, 17, 17, 17, 18, 18, 18,
- 18, 18, 18, 18, 18, 19, 19, 19, 19, 19,
- 19, 19, 19, 19,
-};
-
-/**
- * Table E2.15 Default Spectral Extension Banding Structure
- */
-const uint8_t ff_eac3_default_spx_band_struct[17] =
-{ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 };
diff --git a/libavcodec/ac3dec_data.h b/libavcodec/ac3dec_data.h
deleted file mode 100644
index 975b52e..0000000
--- a/libavcodec/ac3dec_data.h
+++ b/dev/null
@@ -1,32 +0,0 @@
-/*
- * AC-3 and E-AC-3 decoder tables
- * Copyright (c) 2007 Bartlomiej Wolowiec <bartek.wolowiec@gmail.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
- */
-
-#ifndef AVCODEC_AC3DEC_DATA_H
-#define AVCODEC_AC3DEC_DATA_H
-
-#include <stdint.h>
-
-extern const uint8_t ff_ac3_ungroup_3_in_5_bits_tab[32][3];
-
-extern const uint8_t ff_eac3_hebap_tab[64];
-extern const uint8_t ff_eac3_default_spx_band_struct[17];
-
-#endif /* AVCODEC_AC3DEC_DATA_H */
diff --git a/libavcodec/ac3dsp.c b/libavcodec/ac3dsp.c
deleted file mode 100644
index 6df3a68..0000000
--- a/libavcodec/ac3dsp.c
+++ b/dev/null
@@ -1,263 +0,0 @@
-/*
- * AC-3 DSP utils
- * Copyright (c) 2011 Justin Ruggles
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General 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 "libavutil/avassert.h"
-#include "avcodec.h"
-#include "ac3.h"
-#include "ac3dsp.h"
-#include "mathops.h"
-
-static void ac3_exponent_min_c(uint8_t *exp, int num_reuse_blocks, int nb_coefs)
-{
- int blk, i;
-
- if (!num_reuse_blocks)
- return;
-
- for (i = 0; i < nb_coefs; i++) {
- uint8_t min_exp = *exp;
- uint8_t *exp1 = exp + 256;
- for (blk = 0; blk < num_reuse_blocks; blk++) {
- uint8_t next_exp = *exp1;
- if (next_exp < min_exp)
- min_exp = next_exp;
- exp1 += 256;
- }
- *exp++ = min_exp;
- }
-}
-
-static int ac3_max_msb_abs_int16_c(const int16_t *src, int len)
-{
- int i, v = 0;
- for (i = 0; i < len; i++)
- v |= abs(src[i]);
- return v;
-}
-
-static void ac3_lshift_int16_c(int16_t *src, unsigned int len,
- unsigned int shift)
-{
- uint32_t *src32 = (uint32_t *)src;
- const uint32_t mask = ~(((1 << shift) - 1) << 16);
- int i;
- len >>= 1;
- for (i = 0; i < len; i += 8) {
- src32[i ] = (src32[i ] << shift) & mask;
- src32[i+1] = (src32[i+1] << shift) & mask;
- src32[i+2] = (src32[i+2] << shift) & mask;
- src32[i+3] = (src32[i+3] << shift) & mask;
- src32[i+4] = (src32[i+4] << shift) & mask;
- src32[i+5] = (src32[i+5] << shift) & mask;
- src32[i+6] = (src32[i+6] << shift) & mask;
- src32[i+7] = (src32[i+7] << shift) & mask;
- }
-}
-
-static void ac3_rshift_int32_c(int32_t *src, unsigned int len,
- unsigned int shift)
-{
- do {
- *src++ >>= shift;
- *src++ >>= shift;
- *src++ >>= shift;
- *src++ >>= shift;
- *src++ >>= shift;
- *src++ >>= shift;
- *src++ >>= shift;
- *src++ >>= shift;
- len -= 8;
- } while (len > 0);
-}
-
-static void float_to_fixed24_c(int32_t *dst, const float *src, unsigned int len)
-{
- const float scale = 1 << 24;
- do {
- *dst++ = lrintf(*src++ * scale);
- *dst++ = lrintf(*src++ * scale);
- *dst++ = lrintf(*src++ * scale);
- *dst++ = lrintf(*src++ * scale);
- *dst++ = lrintf(*src++ * scale);
- *dst++ = lrintf(*src++ * scale);
- *dst++ = lrintf(*src++ * scale);
- *dst++ = lrintf(*src++ * scale);
- len -= 8;
- } while (len > 0);
-}
-
-static void ac3_bit_alloc_calc_bap_c(int16_t *mask, int16_t *psd,
- int start, int end,
- int snr_offset, int floor,
- const uint8_t *bap_tab, uint8_t *bap)
-{
- int bin, band, band_end;
-
- /* special case, if snr offset is -960, set all bap's to zero */
- if (snr_offset == -960) {
- memset(bap, 0, AC3_MAX_COEFS);
- return;
- }
-
- bin = start;
- band = ff_ac3_bin_to_band_tab[start];
- do {
- int m = (FFMAX(mask[band] - snr_offset - floor, 0) & 0x1FE0) + floor;
- band_end = ff_ac3_band_start_tab[++band];
- band_end = FFMIN(band_end, end);
-
- for (; bin < band_end; bin++) {
- int address = av_clip((psd[bin] - m) >> 5, 0, 63);
- bap[bin] = bap_tab[address];
- }
- } while (end > band_end);
-}
-
-static void ac3_update_bap_counts_c(uint16_t mant_cnt[16], uint8_t *bap,
- int len)
-{
- while (len-- > 0)
- mant_cnt[bap[len]]++;
-}
-
-DECLARE_ALIGNED(16, const uint16_t, ff_ac3_bap_bits)[16] = {
- 0, 0, 0, 3, 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16
-};
-
-static int ac3_compute_mantissa_size_c(uint16_t mant_cnt[6][16])
-{
- int blk, bap;
- int bits = 0;
-
- for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
- // bap=1 : 3 mantissas in 5 bits
- bits += (mant_cnt[blk][1] / 3) * 5;
- // bap=2 : 3 mantissas in 7 bits
- // bap=4 : 2 mantissas in 7 bits
- bits += ((mant_cnt[blk][2] / 3) + (mant_cnt[blk][4] >> 1)) * 7;
- // bap=3 : 1 mantissa in 3 bits
- bits += mant_cnt[blk][3] * 3;
- // bap=5 to 15 : get bits per mantissa from table
- for (bap = 5; bap < 16; bap++)
- bits += mant_cnt[blk][bap] * ff_ac3_bap_bits[bap];
- }
- return bits;
-}
-
-static void ac3_extract_exponents_c(uint8_t *exp, int32_t *coef, int nb_coefs)
-{
- int i;
-
- for (i = 0; i < nb_coefs; i++) {
- int v = abs(coef[i]);
- exp[i] = v ? 23 - av_log2(v) : 24;
- }
-}
-
-static void ac3_sum_square_butterfly_int32_c(int64_t sum[4],
- const int32_t *coef0,
- const int32_t *coef1,
- int len)
-{
- int i;
-
- sum[0] = sum[1] = sum[2] = sum[3] = 0;
-
- for (i = 0; i < len; i++) {
- int lt = coef0[i];
- int rt = coef1[i];
- int md = lt + rt;
- int sd = lt - rt;
- MAC64(sum[0], lt, lt);
- MAC64(sum[1], rt, rt);
- MAC64(sum[2], md, md);
- MAC64(sum[3], sd, sd);
- }
-}
-
-static void ac3_sum_square_butterfly_float_c(float sum[4],
- const float *coef0,
- const float *coef1,
- int len)
-{
- int i;
-
- sum[0] = sum[1] = sum[2] = sum[3] = 0;
-
- for (i = 0; i < len; i++) {
- float lt = coef0[i];
- float rt = coef1[i];
- float md = lt + rt;
- float sd = lt - rt;
- sum[0] += lt * lt;
- sum[1] += rt * rt;
- sum[2] += md * md;
- sum[3] += sd * sd;
- }
-}
-
-static void ac3_downmix_c(float **samples, float (*matrix)[2],
- int out_ch, int in_ch, int len)
-{
- int i, j;
- float v0, v1;
- if (out_ch == 2) {
- for (i = 0; i < len; i++) {
- v0 = v1 = 0.0f;
- for (j = 0; j < in_ch; j++) {
- v0 += samples[j][i] * matrix[j][0];
- v1 += samples[j][i] * matrix[j][1];
- }
- samples[0][i] = v0;
- samples[1][i] = v1;
- }
- } else if (out_ch == 1) {
- for (i = 0; i < len; i++) {
- v0 = 0.0f;
- for (j = 0; j < in_ch; j++)
- v0 += samples[j][i] * matrix[j][0];
- samples[0][i] = v0;
- }
- }
-}
-
-av_cold void ff_ac3dsp_init(AC3DSPContext *c, int bit_exact)
-{
- c->ac3_exponent_min = ac3_exponent_min_c;
- c->ac3_max_msb_abs_int16 = ac3_max_msb_abs_int16_c;
- c->ac3_lshift_int16 = ac3_lshift_int16_c;
- c->ac3_rshift_int32 = ac3_rshift_int32_c;
- c->float_to_fixed24 = float_to_fixed24_c;
- c->bit_alloc_calc_bap = ac3_bit_alloc_calc_bap_c;
- c->update_bap_counts = ac3_update_bap_counts_c;
- c->compute_mantissa_size = ac3_compute_mantissa_size_c;
- c->extract_exponents = ac3_extract_exponents_c;
- c->sum_square_butterfly_int32 = ac3_sum_square_butterfly_int32_c;
- c->sum_square_butterfly_float = ac3_sum_square_butterfly_float_c;
- c->downmix = ac3_downmix_c;
-
- if (ARCH_ARM)
- ff_ac3dsp_init_arm(c, bit_exact);
- if (ARCH_X86)
- ff_ac3dsp_init_x86(c, bit_exact);
- if (ARCH_MIPS)
- ff_ac3dsp_init_mips(c, bit_exact);
-}
diff --git a/libavcodec/ac3dsp.h b/libavcodec/ac3dsp.h
deleted file mode 100644
index bafbc89..0000000
--- a/libavcodec/ac3dsp.h
+++ b/dev/null
@@ -1,144 +0,0 @@
-/*
- * AC-3 DSP utils
- * Copyright (c) 2011 Justin Ruggles
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General 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_AC3DSP_H
-#define AVCODEC_AC3DSP_H
-
-#include <stdint.h>
-
-/**
- * Number of mantissa bits written for each bap value.
- * bap values with fractional bits are set to 0 and are calculated separately.
- */
-extern const uint16_t ff_ac3_bap_bits[16];
-
-typedef struct AC3DSPContext {
- /**
- * Set each encoded exponent in a block to the minimum of itself and the
- * exponents in the same frequency bin of up to 5 following blocks.
- * @param exp pointer to the start of the current block of exponents.
- * constraints: align 16
- * @param num_reuse_blocks number of blocks that will reuse exponents from the current block.
- * constraints: range 0 to 5
- * @param nb_coefs number of frequency coefficients.
- */
- void (*ac3_exponent_min)(uint8_t *exp, int num_reuse_blocks, int nb_coefs);
-
- /**
- * Calculate the maximum MSB of the absolute value of each element in an
- * array of int16_t.
- * @param src input array
- * constraints: align 16. values must be in range [-32767,32767]
- * @param len number of values in the array
- * constraints: multiple of 16 greater than 0
- * @return a value with the same MSB as max(abs(src[]))
- */
- int (*ac3_max_msb_abs_int16)(const int16_t *src, int len);
-
- /**
- * Left-shift each value in an array of int16_t by a specified amount.
- * @param src input array
- * constraints: align 16
- * @param len number of values in the array
- * constraints: multiple of 32 greater than 0
- * @param shift left shift amount
- * constraints: range [0,15]
- */
- void (*ac3_lshift_int16)(int16_t *src, unsigned int len, unsigned int shift);
-
- /**
- * Right-shift each value in an array of int32_t by a specified amount.
- * @param src input array
- * constraints: align 16
- * @param len number of values in the array
- * constraints: multiple of 16 greater than 0
- * @param shift right shift amount
- * constraints: range [0,31]
- */
- void (*ac3_rshift_int32)(int32_t *src, unsigned int len, unsigned int shift);
-
- /**
- * Convert an array of float in range [-1.0,1.0] to int32_t with range
- * [-(1<<24),(1<<24)]
- *
- * @param dst destination array of int32_t.
- * constraints: 16-byte aligned
- * @param src source array of float.
- * constraints: 16-byte aligned
- * @param len number of elements to convert.
- * constraints: multiple of 32 greater than zero
- */
- void (*float_to_fixed24)(int32_t *dst, const float *src, unsigned int len);
-
- /**
- * Calculate bit allocation pointers.
- * The SNR is the difference between the masking curve and the signal. AC-3
- * uses this value for each frequency bin to allocate bits. The snroffset
- * parameter is a global adjustment to the SNR for all bins.
- *
- * @param[in] mask masking curve
- * @param[in] psd signal power for each frequency bin
- * @param[in] start starting bin location
- * @param[in] end ending bin location
- * @param[in] snr_offset SNR adjustment
- * @param[in] floor noise floor
- * @param[in] bap_tab look-up table for bit allocation pointers
- * @param[out] bap bit allocation pointers
- */
- void (*bit_alloc_calc_bap)(int16_t *mask, int16_t *psd, int start, int end,
- int snr_offset, int floor,
- const uint8_t *bap_tab, uint8_t *bap);
-
- /**
- * Update bap counts using the supplied array of bap.
- *
- * @param[out] mant_cnt bap counts for 1 block
- * @param[in] bap array of bap, pointing to start coef bin
- * @param[in] len number of elements to process
- */
- void (*update_bap_counts)(uint16_t mant_cnt[16], uint8_t *bap, int len);
-
- /**
- * Calculate the number of bits needed to encode a set of mantissas.
- *
- * @param[in] mant_cnt bap counts for all blocks
- * @return mantissa bit count
- */
- int (*compute_mantissa_size)(uint16_t mant_cnt[6][16]);
-
- void (*extract_exponents)(uint8_t *exp, int32_t *coef, int nb_coefs);
-
- void (*sum_square_butterfly_int32)(int64_t sum[4], const int32_t *coef0,
- const int32_t *coef1, int len);
-
- void (*sum_square_butterfly_float)(float sum[4], const float *coef0,
- const float *coef1, int len);
-
- void (*downmix)(float **samples, float (*matrix)[2], int out_ch,
- int in_ch, int len);
-} AC3DSPContext;
-
-void ff_ac3dsp_init (AC3DSPContext *c, int bit_exact);
-void ff_ac3dsp_init_arm(AC3DSPContext *c, int bit_exact);
-void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact);
-void ff_ac3dsp_init_mips(AC3DSPContext *c, int bit_exact);
-
-#endif /* AVCODEC_AC3DSP_H */
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
deleted file mode 100644
index 37c496c..0000000
--- a/libavcodec/ac3enc.c
+++ b/dev/null
@@ -1,2491 +0,0 @@
-/*
- * The simplest AC-3 encoder
- * Copyright (c) 2000 Fabrice Bellard
- * Copyright (c) 2006-2010 Justin Ruggles <justin.ruggles@gmail.com>
- * Copyright (c) 2006-2010 Prakash Punnoor <prakash@punnoor.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 Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * The simplest AC-3 encoder.
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/avassert.h"
-#include "libavutil/avstring.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/crc.h"
-#include "libavutil/internal.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "put_bits.h"
-#include "ac3dsp.h"
-#include "ac3.h"
-#include "fft.h"
-#include "ac3enc.h"
-#include "eac3enc.h"
-
-typedef struct AC3Mant {
- int16_t *qmant1_ptr, *qmant2_ptr, *qmant4_ptr; ///< mantissa pointers for bap=1,2,4
- int mant1_cnt, mant2_cnt, mant4_cnt; ///< mantissa counts for bap=1,2,4
-} AC3Mant;
-
-#define CMIXLEV_NUM_OPTIONS 3
-static const float cmixlev_options[CMIXLEV_NUM_OPTIONS] = {
- LEVEL_MINUS_3DB, LEVEL_MINUS_4POINT5DB, LEVEL_MINUS_6DB
-};
-
-#define SURMIXLEV_NUM_OPTIONS 3
-static const float surmixlev_options[SURMIXLEV_NUM_OPTIONS] = {
- LEVEL_MINUS_3DB, LEVEL_MINUS_6DB, LEVEL_ZERO
-};
-
-#define EXTMIXLEV_NUM_OPTIONS 8
-static const float extmixlev_options[EXTMIXLEV_NUM_OPTIONS] = {
- LEVEL_PLUS_3DB, LEVEL_PLUS_1POINT5DB, LEVEL_ONE, LEVEL_MINUS_4POINT5DB,
- LEVEL_MINUS_3DB, LEVEL_MINUS_4POINT5DB, LEVEL_MINUS_6DB, LEVEL_ZERO
-};
-
-
-/**
- * LUT for number of exponent groups.
- * exponent_group_tab[coupling][exponent strategy-1][number of coefficients]
- */
-static uint8_t exponent_group_tab[2][3][256];
-
-
-/**
- * List of supported channel layouts.
- */
-const uint64_t ff_ac3_channel_layouts[19] = {
- AV_CH_LAYOUT_MONO,
- AV_CH_LAYOUT_STEREO,
- AV_CH_LAYOUT_2_1,
- AV_CH_LAYOUT_SURROUND,
- AV_CH_LAYOUT_2_2,
- AV_CH_LAYOUT_QUAD,
- AV_CH_LAYOUT_4POINT0,
- AV_CH_LAYOUT_5POINT0,
- AV_CH_LAYOUT_5POINT0_BACK,
- (AV_CH_LAYOUT_MONO | AV_CH_LOW_FREQUENCY),
- (AV_CH_LAYOUT_STEREO | AV_CH_LOW_FREQUENCY),
- (AV_CH_LAYOUT_2_1 | AV_CH_LOW_FREQUENCY),
- (AV_CH_LAYOUT_SURROUND | AV_CH_LOW_FREQUENCY),
- (AV_CH_LAYOUT_2_2 | AV_CH_LOW_FREQUENCY),
- (AV_CH_LAYOUT_QUAD | AV_CH_LOW_FREQUENCY),
- (AV_CH_LAYOUT_4POINT0 | AV_CH_LOW_FREQUENCY),
- AV_CH_LAYOUT_5POINT1,
- AV_CH_LAYOUT_5POINT1_BACK,
- 0
-};
-
-
-/**
- * LUT to select the bandwidth code based on the bit rate, sample rate, and
- * number of full-bandwidth channels.
- * bandwidth_tab[fbw_channels-1][sample rate code][bit rate code]
- */
-static const uint8_t ac3_bandwidth_tab[5][3][19] = {
-// 32 40 48 56 64 80 96 112 128 160 192 224 256 320 384 448 512 576 640
-
- { { 0, 0, 0, 12, 16, 32, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48 },
- { 0, 0, 0, 16, 20, 36, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56 },
- { 0, 0, 0, 32, 40, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60 } },
-
- { { 0, 0, 0, 0, 0, 0, 0, 20, 24, 32, 48, 48, 48, 48, 48, 48, 48, 48, 48 },
- { 0, 0, 0, 0, 0, 0, 4, 24, 28, 36, 56, 56, 56, 56, 56, 56, 56, 56, 56 },
- { 0, 0, 0, 0, 0, 0, 20, 44, 52, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60 } },
-
- { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 24, 32, 40, 48, 48, 48, 48, 48, 48 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 4, 20, 28, 36, 44, 56, 56, 56, 56, 56, 56 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 20, 40, 48, 60, 60, 60, 60, 60, 60, 60, 60 } },
-
- { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 24, 32, 48, 48, 48, 48, 48, 48 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 28, 36, 56, 56, 56, 56, 56, 56 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 48, 60, 60, 60, 60, 60, 60, 60 } },
-
- { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 20, 32, 40, 48, 48, 48, 48 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 24, 36, 44, 56, 56, 56, 56 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 44, 60, 60, 60, 60, 60, 60 } }
-};
-
-
-/**
- * LUT to select the coupling start band based on the bit rate, sample rate, and
- * number of full-bandwidth channels. -1 = coupling off
- * ac3_coupling_start_tab[channel_mode-2][sample rate code][bit rate code]
- *
- * TODO: more testing for optimal parameters.
- * multi-channel tests at 44.1kHz and 32kHz.
- */
-static const int8_t ac3_coupling_start_tab[6][3][19] = {
-// 32 40 48 56 64 80 96 112 128 160 192 224 256 320 384 448 512 576 640
-
- // 2/0
- { { 0, 0, 0, 0, 0, 0, 0, 1, 1, 7, 8, 11, 12, -1, -1, -1, -1, -1, -1 },
- { 0, 0, 0, 0, 0, 0, 1, 3, 5, 7, 10, 12, 13, -1, -1, -1, -1, -1, -1 },
- { 0, 0, 0, 0, 1, 2, 2, 9, 13, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
-
- // 3/0
- { { 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 6, 9, 11, 12, 13, -1, -1, -1, -1 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 6, 9, 11, 12, 13, -1, -1, -1, -1 },
- { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
-
- // 2/1 - untested
- { { 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 6, 9, 11, 12, 13, -1, -1, -1, -1 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 6, 9, 11, 12, 13, -1, -1, -1, -1 },
- { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
-
- // 3/1
- { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 10, 11, 11, 12, 12, 14, -1 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 10, 11, 11, 12, 12, 14, -1 },
- { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
-
- // 2/2 - untested
- { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 10, 11, 11, 12, 12, 14, -1 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 10, 11, 11, 12, 12, 14, -1 },
- { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
-
- // 3/2
- { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 8, 11, 12, 12, -1, -1 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 8, 11, 12, 12, -1, -1 },
- { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
-};
-
-
-/**
- * Adjust the frame size to make the average bit rate match the target bit rate.
- * This is only needed for 11025, 22050, and 44100 sample rates or any E-AC-3.
- *
- * @param s AC-3 encoder private context
- */
-void ff_ac3_adjust_frame_size(AC3EncodeContext *s)
-{
- while (s->bits_written >= s->bit_rate && s->samples_written >= s->sample_rate) {
- s->bits_written -= s->bit_rate;
- s->samples_written -= s->sample_rate;
- }
- s->frame_size = s->frame_size_min +
- 2 * (s->bits_written * s->sample_rate < s->samples_written * s->bit_rate);
- s->bits_written += s->frame_size * 8;
- s->samples_written += AC3_BLOCK_SIZE * s->num_blocks;
-}
-
-
-/**
- * Set the initial coupling strategy parameters prior to coupling analysis.
- *
- * @param s AC-3 encoder private context
- */
-void ff_ac3_compute_coupling_strategy(AC3EncodeContext *s)
-{
- int blk, ch;
- int got_cpl_snr;
- int num_cpl_blocks;
-
- /* set coupling use flags for each block/channel */
- /* TODO: turn coupling on/off and adjust start band based on bit usage */
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- for (ch = 1; ch <= s->fbw_channels; ch++)
- block->channel_in_cpl[ch] = s->cpl_on;
- }
-
- /* enable coupling for each block if at least 2 channels have coupling
- enabled for that block */
- got_cpl_snr = 0;
- num_cpl_blocks = 0;
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- block->num_cpl_channels = 0;
- for (ch = 1; ch <= s->fbw_channels; ch++)
- block->num_cpl_channels += block->channel_in_cpl[ch];
- block->cpl_in_use = block->num_cpl_channels > 1;
- num_cpl_blocks += block->cpl_in_use;
- if (!block->cpl_in_use) {
- block->num_cpl_channels = 0;
- for (ch = 1; ch <= s->fbw_channels; ch++)
- block->channel_in_cpl[ch] = 0;
- }
-
- block->new_cpl_strategy = !blk;
- if (blk) {
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- if (block->channel_in_cpl[ch] != s->blocks[blk-1].channel_in_cpl[ch]) {
- block->new_cpl_strategy = 1;
- break;
- }
- }
- }
- block->new_cpl_leak = block->new_cpl_strategy;
-
- if (!blk || (block->cpl_in_use && !got_cpl_snr)) {
- block->new_snr_offsets = 1;
- if (block->cpl_in_use)
- got_cpl_snr = 1;
- } else {
- block->new_snr_offsets = 0;
- }
- }
- if (!num_cpl_blocks)
- s->cpl_on = 0;
-
- /* set bandwidth for each channel */
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- if (block->channel_in_cpl[ch])
- block->end_freq[ch] = s->start_freq[CPL_CH];
- else
- block->end_freq[ch] = s->bandwidth_code * 3 + 73;
- }
- }
-}
-
-
-/**
- * Apply stereo rematrixing to coefficients based on rematrixing flags.
- *
- * @param s AC-3 encoder private context
- */
-void ff_ac3_apply_rematrixing(AC3EncodeContext *s)
-{
- int nb_coefs;
- int blk, bnd, i;
- int start, end;
- uint8_t *flags = NULL;
-
- if (!s->rematrixing_enabled)
- return;
-
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- if (block->new_rematrixing_strategy)
- flags = block->rematrixing_flags;
- nb_coefs = FFMIN(block->end_freq[1], block->end_freq[2]);
- for (bnd = 0; bnd < block->num_rematrixing_bands; bnd++) {
- if (flags[bnd]) {
- start = ff_ac3_rematrix_band_tab[bnd];
- end = FFMIN(nb_coefs, ff_ac3_rematrix_band_tab[bnd+1]);
- for (i = start; i < end; i++) {
- int32_t lt = block->fixed_coef[1][i];
- int32_t rt = block->fixed_coef[2][i];
- block->fixed_coef[1][i] = (lt + rt) >> 1;
- block->fixed_coef[2][i] = (lt - rt) >> 1;
- }
- }
- }
- }
-}
-
-
-/*
- * Initialize exponent tables.
- */
-static av_cold void exponent_init(AC3EncodeContext *s)
-{
- int expstr, i, grpsize;
-
- for (expstr = EXP_D15-1; expstr <= EXP_D45-1; expstr++) {
- grpsize = 3 << expstr;
- for (i = 12; i < 256; i++) {
- exponent_group_tab[0][expstr][i] = (i + grpsize - 4) / grpsize;
- exponent_group_tab[1][expstr][i] = (i ) / grpsize;
- }
- }
- /* LFE */
- exponent_group_tab[0][0][7] = 2;
-
- if (CONFIG_EAC3_ENCODER && s->eac3)
- ff_eac3_exponent_init();
-}
-
-
-/*
- * Extract exponents from the MDCT coefficients.
- */
-static void extract_exponents(AC3EncodeContext *s)
-{
- int ch = !s->cpl_on;
- int chan_size = AC3_MAX_COEFS * s->num_blocks * (s->channels - ch + 1);
- AC3Block *block = &s->blocks[0];
-
- s->ac3dsp.extract_exponents(block->exp[ch], block->fixed_coef[ch], chan_size);
-}
-
-
-/**
- * Exponent Difference Threshold.
- * New exponents are sent if their SAD exceed this number.
- */
-#define EXP_DIFF_THRESHOLD 500
-
-/**
- * Table used to select exponent strategy based on exponent reuse block interval.
- */
-static const uint8_t exp_strategy_reuse_tab[4][6] = {
- { EXP_D15, EXP_D15, EXP_D15, EXP_D15, EXP_D15, EXP_D15 },
- { EXP_D15, EXP_D15, EXP_D15, EXP_D15, EXP_D15, EXP_D15 },
- { EXP_D25, EXP_D25, EXP_D15, EXP_D15, EXP_D15, EXP_D15 },
- { EXP_D45, EXP_D25, EXP_D25, EXP_D15, EXP_D15, EXP_D15 }
-};
-
-/*
- * Calculate exponent strategies for all channels.
- * Array arrangement is reversed to simplify the per-channel calculation.
- */
-static void compute_exp_strategy(AC3EncodeContext *s)
-{
- int ch, blk, blk1;
-
- for (ch = !s->cpl_on; ch <= s->fbw_channels; ch++) {
- uint8_t *exp_strategy = s->exp_strategy[ch];
- uint8_t *exp = s->blocks[0].exp[ch];
- int exp_diff;
-
- /* estimate if the exponent variation & decide if they should be
- reused in the next frame */
- exp_strategy[0] = EXP_NEW;
- exp += AC3_MAX_COEFS;
- for (blk = 1; blk < s->num_blocks; blk++, exp += AC3_MAX_COEFS) {
- if (ch == CPL_CH) {
- if (!s->blocks[blk-1].cpl_in_use) {
- exp_strategy[blk] = EXP_NEW;
- continue;
- } else if (!s->blocks[blk].cpl_in_use) {
- exp_strategy[blk] = EXP_REUSE;
- continue;
- }
- } else if (s->blocks[blk].channel_in_cpl[ch] != s->blocks[blk-1].channel_in_cpl[ch]) {
- exp_strategy[blk] = EXP_NEW;
- continue;
- }
- exp_diff = s->dsp.sad[0](NULL, exp, exp - AC3_MAX_COEFS, 16, 16);
- exp_strategy[blk] = EXP_REUSE;
- if (ch == CPL_CH && exp_diff > (EXP_DIFF_THRESHOLD * (s->blocks[blk].end_freq[ch] - s->start_freq[ch]) / AC3_MAX_COEFS))
- exp_strategy[blk] = EXP_NEW;
- else if (ch > CPL_CH && exp_diff > EXP_DIFF_THRESHOLD)
- exp_strategy[blk] = EXP_NEW;
- }
-
- /* now select the encoding strategy type : if exponents are often
- recoded, we use a coarse encoding */
- blk = 0;
- while (blk < s->num_blocks) {
- blk1 = blk + 1;
- while (blk1 < s->num_blocks && exp_strategy[blk1] == EXP_REUSE)
- blk1++;
- exp_strategy[blk] = exp_strategy_reuse_tab[s->num_blks_code][blk1-blk-1];
- blk = blk1;
- }
- }
- if (s->lfe_on) {
- ch = s->lfe_channel;
- s->exp_strategy[ch][0] = EXP_D15;
- for (blk = 1; blk < s->num_blocks; blk++)
- s->exp_strategy[ch][blk] = EXP_REUSE;
- }
-
- /* for E-AC-3, determine frame exponent strategy */
- if (CONFIG_EAC3_ENCODER && s->eac3)
- ff_eac3_get_frame_exp_strategy(s);
-}
-
-
-/**
- * Update the exponents so that they are the ones the decoder will decode.
- *
- * @param[in,out] exp array of exponents for 1 block in 1 channel
- * @param nb_exps number of exponents in active bandwidth
- * @param exp_strategy exponent strategy for the block
- * @param cpl indicates if the block is in the coupling channel
- */
-static void encode_exponents_blk_ch(uint8_t *exp, int nb_exps, int exp_strategy,
- int cpl)
-{
- int nb_groups, i, k;
-
- nb_groups = exponent_group_tab[cpl][exp_strategy-1][nb_exps] * 3;
-
- /* for each group, compute the minimum exponent */
- switch(exp_strategy) {
- case EXP_D25:
- for (i = 1, k = 1-cpl; i <= nb_groups; i++) {
- uint8_t exp_min = exp[k];
- if (exp[k+1] < exp_min)
- exp_min = exp[k+1];
- exp[i-cpl] = exp_min;
- k += 2;
- }
- break;
- case EXP_D45:
- for (i = 1, k = 1-cpl; i <= nb_groups; i++) {
- uint8_t exp_min = exp[k];
- if (exp[k+1] < exp_min)
- exp_min = exp[k+1];
- if (exp[k+2] < exp_min)
- exp_min = exp[k+2];
- if (exp[k+3] < exp_min)
- exp_min = exp[k+3];
- exp[i-cpl] = exp_min;
- k += 4;
- }
- break;
- }
-
- /* constraint for DC exponent */
- if (!cpl && exp[0] > 15)
- exp[0] = 15;
-
- /* decrease the delta between each groups to within 2 so that they can be
- differentially encoded */
- for (i = 1; i <= nb_groups; i++)
- exp[i] = FFMIN(exp[i], exp[i-1] + 2);
- i--;
- while (--i >= 0)
- exp[i] = FFMIN(exp[i], exp[i+1] + 2);
-
- if (cpl)
- exp[-1] = exp[0] & ~1;
-
- /* now we have the exponent values the decoder will see */
- switch (exp_strategy) {
- case EXP_D25:
- for (i = nb_groups, k = (nb_groups * 2)-cpl; i > 0; i--) {
- uint8_t exp1 = exp[i-cpl];
- exp[k--] = exp1;
- exp[k--] = exp1;
- }
- break;
- case EXP_D45:
- for (i = nb_groups, k = (nb_groups * 4)-cpl; i > 0; i--) {
- exp[k] = exp[k-1] = exp[k-2] = exp[k-3] = exp[i-cpl];
- k -= 4;
- }
- break;
- }
-}
-
-
-/*
- * Encode exponents from original extracted form to what the decoder will see.
- * This copies and groups exponents based on exponent strategy and reduces
- * deltas between adjacent exponent groups so that they can be differentially
- * encoded.
- */
-static void encode_exponents(AC3EncodeContext *s)
-{
- int blk, blk1, ch, cpl;
- uint8_t *exp, *exp_strategy;
- int nb_coefs, num_reuse_blocks;
-
- for (ch = !s->cpl_on; ch <= s->channels; ch++) {
- exp = s->blocks[0].exp[ch] + s->start_freq[ch];
- exp_strategy = s->exp_strategy[ch];
-
- cpl = (ch == CPL_CH);
- blk = 0;
- while (blk < s->num_blocks) {
- AC3Block *block = &s->blocks[blk];
- if (cpl && !block->cpl_in_use) {
- exp += AC3_MAX_COEFS;
- blk++;
- continue;
- }
- nb_coefs = block->end_freq[ch] - s->start_freq[ch];
- blk1 = blk + 1;
-
- /* count the number of EXP_REUSE blocks after the current block
- and set exponent reference block numbers */
- s->exp_ref_block[ch][blk] = blk;
- while (blk1 < s->num_blocks && exp_strategy[blk1] == EXP_REUSE) {
- s->exp_ref_block[ch][blk1] = blk;
- blk1++;
- }
- num_reuse_blocks = blk1 - blk - 1;
-
- /* for the EXP_REUSE case we select the min of the exponents */
- s->ac3dsp.ac3_exponent_min(exp-s->start_freq[ch], num_reuse_blocks,
- AC3_MAX_COEFS);
-
- encode_exponents_blk_ch(exp, nb_coefs, exp_strategy[blk], cpl);
-
- exp += AC3_MAX_COEFS * (num_reuse_blocks + 1);
- blk = blk1;
- }
- }
-
- /* reference block numbers have been changed, so reset ref_bap_set */
- s->ref_bap_set = 0;
-}
-
-
-/*
- * Count exponent bits based on bandwidth, coupling, and exponent strategies.
- */
-static int count_exponent_bits(AC3EncodeContext *s)
-{
- int blk, ch;
- int nb_groups, bit_count;
-
- bit_count = 0;
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- for (ch = !block->cpl_in_use; ch <= s->channels; ch++) {
- int exp_strategy = s->exp_strategy[ch][blk];
- int cpl = (ch == CPL_CH);
- int nb_coefs = block->end_freq[ch] - s->start_freq[ch];
-
- if (exp_strategy == EXP_REUSE)
- continue;
-
- nb_groups = exponent_group_tab[cpl][exp_strategy-1][nb_coefs];
- bit_count += 4 + (nb_groups * 7);
- }
- }
-
- return bit_count;
-}
-
-
-/**
- * Group exponents.
- * 3 delta-encoded exponents are in each 7-bit group. The number of groups
- * varies depending on exponent strategy and bandwidth.
- *
- * @param s AC-3 encoder private context
- */
-void ff_ac3_group_exponents(AC3EncodeContext *s)
-{
- int blk, ch, i, cpl;
- int group_size, nb_groups;
- uint8_t *p;
- int delta0, delta1, delta2;
- int exp0, exp1;
-
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- for (ch = !block->cpl_in_use; ch <= s->channels; ch++) {
- int exp_strategy = s->exp_strategy[ch][blk];
- if (exp_strategy == EXP_REUSE)
- continue;
- cpl = (ch == CPL_CH);
- group_size = exp_strategy + (exp_strategy == EXP_D45);
- nb_groups = exponent_group_tab[cpl][exp_strategy-1][block->end_freq[ch]-s->start_freq[ch]];
- p = block->exp[ch] + s->start_freq[ch] - cpl;
-
- /* DC exponent */
- exp1 = *p++;
- block->grouped_exp[ch][0] = exp1;
-
- /* remaining exponents are delta encoded */
- for (i = 1; i <= nb_groups; i++) {
- /* merge three delta in one code */
- exp0 = exp1;
- exp1 = p[0];
- p += group_size;
- delta0 = exp1 - exp0 + 2;
- av_assert2(delta0 >= 0 && delta0 <= 4);
-
- exp0 = exp1;
- exp1 = p[0];
- p += group_size;
- delta1 = exp1 - exp0 + 2;
- av_assert2(delta1 >= 0 && delta1 <= 4);
-
- exp0 = exp1;
- exp1 = p[0];
- p += group_size;
- delta2 = exp1 - exp0 + 2;
- av_assert2(delta2 >= 0 && delta2 <= 4);
-
- block->grouped_exp[ch][i] = ((delta0 * 5 + delta1) * 5) + delta2;
- }
- }
- }
-}
-
-
-/**
- * Calculate final exponents from the supplied MDCT coefficients and exponent shift.
- * Extract exponents from MDCT coefficients, calculate exponent strategies,
- * and encode final exponents.
- *
- * @param s AC-3 encoder private context
- */
-void ff_ac3_process_exponents(AC3EncodeContext *s)
-{
- extract_exponents(s);
-
- compute_exp_strategy(s);
-
- encode_exponents(s);
-
- emms_c();
-}
-
-
-/*
- * Count frame bits that are based solely on fixed parameters.
- * This only has to be run once when the encoder is initialized.
- */
-static void count_frame_bits_fixed(AC3EncodeContext *s)
-{
- static const int frame_bits_inc[8] = { 0, 0, 2, 2, 2, 4, 2, 4 };
- int blk;
- int frame_bits;
-
- /* assumptions:
- * no dynamic range codes
- * bit allocation parameters do not change between blocks
- * no delta bit allocation
- * no skipped data
- * no auxiliary data
- * no E-AC-3 metadata
- */
-
- /* header */
- frame_bits = 16; /* sync info */
- if (s->eac3) {
- /* bitstream info header */
- frame_bits += 35;
- frame_bits += 1 + 1;
- if (s->num_blocks != 0x6)
- frame_bits++;
- frame_bits++;
- /* audio frame header */
- if (s->num_blocks == 6)
- frame_bits += 2;
- frame_bits += 10;
- /* exponent strategy */
- if (s->use_frame_exp_strategy)
- frame_bits += 5 * s->fbw_channels;
- else
- frame_bits += s->num_blocks * 2 * s->fbw_channels;
- if (s->lfe_on)
- frame_bits += s->num_blocks;
- /* converter exponent strategy */
- if (s->num_blks_code != 0x3)
- frame_bits++;
- else
- frame_bits += s->fbw_channels * 5;
- /* snr offsets */
- frame_bits += 10;
- /* block start info */
- if (s->num_blocks != 1)
- frame_bits++;
- } else {
- frame_bits += 49;
- frame_bits += frame_bits_inc[s->channel_mode];
- }
-
- /* audio blocks */
- for (blk = 0; blk < s->num_blocks; blk++) {
- if (!s->eac3) {
- /* block switch flags */
- frame_bits += s->fbw_channels;
-
- /* dither flags */
- frame_bits += s->fbw_channels;
- }
-
- /* dynamic range */
- frame_bits++;
-
- /* spectral extension */
- if (s->eac3)
- frame_bits++;
-
- if (!s->eac3) {
- /* exponent strategy */
- frame_bits += 2 * s->fbw_channels;
- if (s->lfe_on)
- frame_bits++;
-
- /* bit allocation params */
- frame_bits++;
- if (!blk)
- frame_bits += 2 + 2 + 2 + 2 + 3;
- }
-
- /* converter snr offset */
- if (s->eac3)
- frame_bits++;
-
- if (!s->eac3) {
- /* delta bit allocation */
- frame_bits++;
-
- /* skipped data */
- frame_bits++;
- }
- }
-
- /* auxiliary data */
- frame_bits++;
-
- /* CRC */
- frame_bits += 1 + 16;
-
- s->frame_bits_fixed = frame_bits;
-}
-
-
-/*
- * Initialize bit allocation.
- * Set default parameter codes and calculate parameter values.
- */
-static av_cold void bit_alloc_init(AC3EncodeContext *s)
-{
- int ch;
-
- /* init default parameters */
- s->slow_decay_code = 2;
- s->fast_decay_code = 1;
- s->slow_gain_code = 1;
- s->db_per_bit_code = s->eac3 ? 2 : 3;
- s->floor_code = 7;
- for (ch = 0; ch <= s->channels; ch++)
- s->fast_gain_code[ch] = 4;
-
- /* initial snr offset */
- s->coarse_snr_offset = 40;
-
- /* compute real values */
- /* currently none of these values change during encoding, so we can just
- set them once at initialization */
- s->bit_alloc.slow_decay = ff_ac3_slow_decay_tab[s->slow_decay_code] >> s->bit_alloc.sr_shift;
- s->bit_alloc.fast_decay = ff_ac3_fast_decay_tab[s->fast_decay_code] >> s->bit_alloc.sr_shift;
- s->bit_alloc.slow_gain = ff_ac3_slow_gain_tab[s->slow_gain_code];
- s->bit_alloc.db_per_bit = ff_ac3_db_per_bit_tab[s->db_per_bit_code];
- s->bit_alloc.floor = ff_ac3_floor_tab[s->floor_code];
- s->bit_alloc.cpl_fast_leak = 0;
- s->bit_alloc.cpl_slow_leak = 0;
-
- count_frame_bits_fixed(s);
-}
-
-
-/*
- * Count the bits used to encode the frame, minus exponents and mantissas.
- * Bits based on fixed parameters have already been counted, so now we just
- * have to add the bits based on parameters that change during encoding.
- */
-static void count_frame_bits(AC3EncodeContext *s)
-{
- AC3EncOptions *opt = &s->options;
- int blk, ch;
- int frame_bits = 0;
-
- /* header */
- if (s->eac3) {
- if (opt->eac3_mixing_metadata) {
- if (s->channel_mode > AC3_CHMODE_STEREO)
- frame_bits += 2;
- if (s->has_center)
- frame_bits += 6;
- if (s->has_surround)
- frame_bits += 6;
- frame_bits += s->lfe_on;
- frame_bits += 1 + 1 + 2;
- if (s->channel_mode < AC3_CHMODE_STEREO)
- frame_bits++;
- frame_bits++;
- }
- if (opt->eac3_info_metadata) {
- frame_bits += 3 + 1 + 1;
- if (s->channel_mode == AC3_CHMODE_STEREO)
- frame_bits += 2 + 2;
- if (s->channel_mode >= AC3_CHMODE_2F2R)
- frame_bits += 2;
- frame_bits++;
- if (opt->audio_production_info)
- frame_bits += 5 + 2 + 1;
- frame_bits++;
- }
- /* coupling */
- if (s->channel_mode > AC3_CHMODE_MONO) {
- frame_bits++;
- for (blk = 1; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- frame_bits++;
- if (block->new_cpl_strategy)
- frame_bits++;
- }
- }
- /* coupling exponent strategy */
- if (s->cpl_on) {
- if (s->use_frame_exp_strategy) {
- frame_bits += 5 * s->cpl_on;
- } else {
- for (blk = 0; blk < s->num_blocks; blk++)
- frame_bits += 2 * s->blocks[blk].cpl_in_use;
- }
- }
- } else {
- if (opt->audio_production_info)
- frame_bits += 7;
- if (s->bitstream_id == 6) {
- if (opt->extended_bsi_1)
- frame_bits += 14;
- if (opt->extended_bsi_2)
- frame_bits += 14;
- }
- }
-
- /* audio blocks */
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
-
- /* coupling strategy */
- if (!s->eac3)
- frame_bits++;
- if (block->new_cpl_strategy) {
- if (!s->eac3)
- frame_bits++;
- if (block->cpl_in_use) {
- if (s->eac3)
- frame_bits++;
- if (!s->eac3 || s->channel_mode != AC3_CHMODE_STEREO)
- frame_bits += s->fbw_channels;
- if (s->channel_mode == AC3_CHMODE_STEREO)
- frame_bits++;
- frame_bits += 4 + 4;
- if (s->eac3)
- frame_bits++;
- else
- frame_bits += s->num_cpl_subbands - 1;
- }
- }
-
- /* coupling coordinates */
- if (block->cpl_in_use) {
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- if (block->channel_in_cpl[ch]) {
- if (!s->eac3 || block->new_cpl_coords[ch] != 2)
- frame_bits++;
- if (block->new_cpl_coords[ch]) {
- frame_bits += 2;
- frame_bits += (4 + 4) * s->num_cpl_bands;
- }
- }
- }
- }
-
- /* stereo rematrixing */
- if (s->channel_mode == AC3_CHMODE_STEREO) {
- if (!s->eac3 || blk > 0)
- frame_bits++;
- if (s->blocks[blk].new_rematrixing_strategy)
- frame_bits += block->num_rematrixing_bands;
- }
-
- /* bandwidth codes & gain range */
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- if (s->exp_strategy[ch][blk] != EXP_REUSE) {
- if (!block->channel_in_cpl[ch])
- frame_bits += 6;
- frame_bits += 2;
- }
- }
-
- /* coupling exponent strategy */
- if (!s->eac3 && block->cpl_in_use)
- frame_bits += 2;
-
- /* snr offsets and fast gain codes */
- if (!s->eac3) {
- frame_bits++;
- if (block->new_snr_offsets)
- frame_bits += 6 + (s->channels + block->cpl_in_use) * (4 + 3);
- }
-
- /* coupling leak info */
- if (block->cpl_in_use) {
- if (!s->eac3 || block->new_cpl_leak != 2)
- frame_bits++;
- if (block->new_cpl_leak)
- frame_bits += 3 + 3;
- }
- }
-
- s->frame_bits = s->frame_bits_fixed + frame_bits;
-}
-
-
-/*
- * Calculate masking curve based on the final exponents.
- * Also calculate the power spectral densities to use in future calculations.
- */
-static void bit_alloc_masking(AC3EncodeContext *s)
-{
- int blk, ch;
-
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- for (ch = !block->cpl_in_use; ch <= s->channels; ch++) {
- /* We only need psd and mask for calculating bap.
- Since we currently do not calculate bap when exponent
- strategy is EXP_REUSE we do not need to calculate psd or mask. */
- if (s->exp_strategy[ch][blk] != EXP_REUSE) {
- ff_ac3_bit_alloc_calc_psd(block->exp[ch], s->start_freq[ch],
- block->end_freq[ch], block->psd[ch],
- block->band_psd[ch]);
- ff_ac3_bit_alloc_calc_mask(&s->bit_alloc, block->band_psd[ch],
- s->start_freq[ch], block->end_freq[ch],
- ff_ac3_fast_gain_tab[s->fast_gain_code[ch]],
- ch == s->lfe_channel,
- DBA_NONE, 0, NULL, NULL, NULL,
- block->mask[ch]);
- }
- }
- }
-}
-
-
-/*
- * Ensure that bap for each block and channel point to the current bap_buffer.
- * They may have been switched during the bit allocation search.
- */
-static void reset_block_bap(AC3EncodeContext *s)
-{
- int blk, ch;
- uint8_t *ref_bap;
-
- if (s->ref_bap[0][0] == s->bap_buffer && s->ref_bap_set)
- return;
-
- ref_bap = s->bap_buffer;
- for (ch = 0; ch <= s->channels; ch++) {
- for (blk = 0; blk < s->num_blocks; blk++)
- s->ref_bap[ch][blk] = ref_bap + AC3_MAX_COEFS * s->exp_ref_block[ch][blk];
- ref_bap += AC3_MAX_COEFS * s->num_blocks;
- }
- s->ref_bap_set = 1;
-}
-
-
-/**
- * Initialize mantissa counts.
- * These are set so that they are padded to the next whole group size when bits
- * are counted in compute_mantissa_size.
- *
- * @param[in,out] mant_cnt running counts for each bap value for each block
- */
-static void count_mantissa_bits_init(uint16_t mant_cnt[AC3_MAX_BLOCKS][16])
-{
- int blk;
-
- for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
- memset(mant_cnt[blk], 0, sizeof(mant_cnt[blk]));
- mant_cnt[blk][1] = mant_cnt[blk][2] = 2;
- mant_cnt[blk][4] = 1;
- }
-}
-
-
-/**
- * Update mantissa bit counts for all blocks in 1 channel in a given bandwidth
- * range.
- *
- * @param s AC-3 encoder private context
- * @param ch channel index
- * @param[in,out] mant_cnt running counts for each bap value for each block
- * @param start starting coefficient bin
- * @param end ending coefficient bin
- */
-static void count_mantissa_bits_update_ch(AC3EncodeContext *s, int ch,
- uint16_t mant_cnt[AC3_MAX_BLOCKS][16],
- int start, int end)
-{
- int blk;
-
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- if (ch == CPL_CH && !block->cpl_in_use)
- continue;
- s->ac3dsp.update_bap_counts(mant_cnt[blk],
- s->ref_bap[ch][blk] + start,
- FFMIN(end, block->end_freq[ch]) - start);
- }
-}
-
-
-/*
- * Count the number of mantissa bits in the frame based on the bap values.
- */
-static int count_mantissa_bits(AC3EncodeContext *s)
-{
- int ch, max_end_freq;
- LOCAL_ALIGNED_16(uint16_t, mant_cnt, [AC3_MAX_BLOCKS], [16]);
-
- count_mantissa_bits_init(mant_cnt);
-
- max_end_freq = s->bandwidth_code * 3 + 73;
- for (ch = !s->cpl_enabled; ch <= s->channels; ch++)
- count_mantissa_bits_update_ch(s, ch, mant_cnt, s->start_freq[ch],
- max_end_freq);
-
- return s->ac3dsp.compute_mantissa_size(mant_cnt);
-}
-
-
-/**
- * Run the bit allocation with a given SNR offset.
- * This calculates the bit allocation pointers that will be used to determine
- * the quantization of each mantissa.
- *
- * @param s AC-3 encoder private context
- * @param snr_offset SNR offset, 0 to 1023
- * @return the number of bits needed for mantissas if the given SNR offset is
- * is used.
- */
-static int bit_alloc(AC3EncodeContext *s, int snr_offset)
-{
- int blk, ch;
-
- snr_offset = (snr_offset - 240) << 2;
-
- reset_block_bap(s);
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
-
- for (ch = !block->cpl_in_use; ch <= s->channels; ch++) {
- /* Currently the only bit allocation parameters which vary across
- blocks within a frame are the exponent values. We can take
- advantage of that by reusing the bit allocation pointers
- whenever we reuse exponents. */
- if (s->exp_strategy[ch][blk] != EXP_REUSE) {
- s->ac3dsp.bit_alloc_calc_bap(block->mask[ch], block->psd[ch],
- s->start_freq[ch], block->end_freq[ch],
- snr_offset, s->bit_alloc.floor,
- ff_ac3_bap_tab, s->ref_bap[ch][blk]);
- }
- }
- }
- return count_mantissa_bits(s);
-}
-
-
-/*
- * Constant bitrate bit allocation search.
- * Find the largest SNR offset that will allow data to fit in the frame.
- */
-static int cbr_bit_allocation(AC3EncodeContext *s)
-{
- int ch;
- int bits_left;
- int snr_offset, snr_incr;
-
- bits_left = 8 * s->frame_size - (s->frame_bits + s->exponent_bits);
- if (bits_left < 0)
- return AVERROR(EINVAL);
-
- snr_offset = s->coarse_snr_offset << 4;
-
- /* if previous frame SNR offset was 1023, check if current frame can also
- use SNR offset of 1023. if so, skip the search. */
- if ((snr_offset | s->fine_snr_offset[1]) == 1023) {
- if (bit_alloc(s, 1023) <= bits_left)
- return 0;
- }
-
- while (snr_offset >= 0 &&
- bit_alloc(s, snr_offset) > bits_left) {
- snr_offset -= 64;
- }
- if (snr_offset < 0)
- return AVERROR(EINVAL);
-
- FFSWAP(uint8_t *, s->bap_buffer, s->bap1_buffer);
- for (snr_incr = 64; snr_incr > 0; snr_incr >>= 2) {
- while (snr_offset + snr_incr <= 1023 &&
- bit_alloc(s, snr_offset + snr_incr) <= bits_left) {
- snr_offset += snr_incr;
- FFSWAP(uint8_t *, s->bap_buffer, s->bap1_buffer);
- }
- }
- FFSWAP(uint8_t *, s->bap_buffer, s->bap1_buffer);
- reset_block_bap(s);
-
- s->coarse_snr_offset = snr_offset >> 4;
- for (ch = !s->cpl_on; ch <= s->channels; ch++)
- s->fine_snr_offset[ch] = snr_offset & 0xF;
-
- return 0;
-}
-
-
-/*
- * Perform bit allocation search.
- * Finds the SNR offset value that maximizes quality and fits in the specified
- * frame size. Output is the SNR offset and a set of bit allocation pointers
- * used to quantize the mantissas.
- */
-int ff_ac3_compute_bit_allocation(AC3EncodeContext *s)
-{
- count_frame_bits(s);
-
- s->exponent_bits = count_exponent_bits(s);
-
- bit_alloc_masking(s);
-
- return cbr_bit_allocation(s);
-}
-
-
-/**
- * Symmetric quantization on 'levels' levels.
- *
- * @param c unquantized coefficient
- * @param e exponent
- * @param levels number of quantization levels
- * @return quantized coefficient
- */
-static inline int sym_quant(int c, int e, int levels)
-{
- int v = (((levels * c) >> (24 - e)) + levels) >> 1;
- av_assert2(v >= 0 && v < levels);
- return v;
-}
-
-
-/**
- * Asymmetric quantization on 2^qbits levels.
- *
- * @param c unquantized coefficient
- * @param e exponent
- * @param qbits number of quantization bits
- * @return quantized coefficient
- */
-static inline int asym_quant(int c, int e, int qbits)
-{
- int m;
-
- c = (((c << e) >> (24 - qbits)) + 1) >> 1;
- m = (1 << (qbits-1));
- if (c >= m)
- c = m - 1;
- av_assert2(c >= -m);
- return c;
-}
-
-
-/**
- * Quantize a set of mantissas for a single channel in a single block.
- *
- * @param s Mantissa count context
- * @param fixed_coef unquantized fixed-point coefficients
- * @param exp exponents
- * @param bap bit allocation pointer indices
- * @param[out] qmant quantized coefficients
- * @param start_freq starting coefficient bin
- * @param end_freq ending coefficient bin
- */
-static void quantize_mantissas_blk_ch(AC3Mant *s, int32_t *fixed_coef,
- uint8_t *exp, uint8_t *bap,
- int16_t *qmant, int start_freq,
- int end_freq)
-{
- int i;
-
- for (i = start_freq; i < end_freq; i++) {
- int c = fixed_coef[i];
- int e = exp[i];
- int v = bap[i];
- if (v)
- switch (v) {
- case 1:
- v = sym_quant(c, e, 3);
- switch (s->mant1_cnt) {
- case 0:
- s->qmant1_ptr = &qmant[i];
- v = 9 * v;
- s->mant1_cnt = 1;
- break;
- case 1:
- *s->qmant1_ptr += 3 * v;
- s->mant1_cnt = 2;
- v = 128;
- break;
- default:
- *s->qmant1_ptr += v;
- s->mant1_cnt = 0;
- v = 128;
- break;
- }
- break;
- case 2:
- v = sym_quant(c, e, 5);
- switch (s->mant2_cnt) {
- case 0:
- s->qmant2_ptr = &qmant[i];
- v = 25 * v;
- s->mant2_cnt = 1;
- break;
- case 1:
- *s->qmant2_ptr += 5 * v;
- s->mant2_cnt = 2;
- v = 128;
- break;
- default:
- *s->qmant2_ptr += v;
- s->mant2_cnt = 0;
- v = 128;
- break;
- }
- break;
- case 3:
- v = sym_quant(c, e, 7);
- break;
- case 4:
- v = sym_quant(c, e, 11);
- switch (s->mant4_cnt) {
- case 0:
- s->qmant4_ptr = &qmant[i];
- v = 11 * v;
- s->mant4_cnt = 1;
- break;
- default:
- *s->qmant4_ptr += v;
- s->mant4_cnt = 0;
- v = 128;
- break;
- }
- break;
- case 5:
- v = sym_quant(c, e, 15);
- break;
- case 14:
- v = asym_quant(c, e, 14);
- break;
- case 15:
- v = asym_quant(c, e, 16);
- break;
- default:
- v = asym_quant(c, e, v - 1);
- break;
- }
- qmant[i] = v;
- }
-}
-
-
-/**
- * Quantize mantissas using coefficients, exponents, and bit allocation pointers.
- *
- * @param s AC-3 encoder private context
- */
-void ff_ac3_quantize_mantissas(AC3EncodeContext *s)
-{
- int blk, ch, ch0=0, got_cpl;
-
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- AC3Mant m = { 0 };
-
- got_cpl = !block->cpl_in_use;
- for (ch = 1; ch <= s->channels; ch++) {
- if (!got_cpl && ch > 1 && block->channel_in_cpl[ch-1]) {
- ch0 = ch - 1;
- ch = CPL_CH;
- got_cpl = 1;
- }
- quantize_mantissas_blk_ch(&m, block->fixed_coef[ch],
- s->blocks[s->exp_ref_block[ch][blk]].exp[ch],
- s->ref_bap[ch][blk], block->qmant[ch],
- s->start_freq[ch], block->end_freq[ch]);
- if (ch == CPL_CH)
- ch = ch0;
- }
- }
-}
-
-
-/*
- * Write the AC-3 frame header to the output bitstream.
- */
-static void ac3_output_frame_header(AC3EncodeContext *s)
-{
- AC3EncOptions *opt = &s->options;
-
- put_bits(&s->pb, 16, 0x0b77); /* frame header */
- put_bits(&s->pb, 16, 0); /* crc1: will be filled later */
- put_bits(&s->pb, 2, s->bit_alloc.sr_code);
- put_bits(&s->pb, 6, s->frame_size_code + (s->frame_size - s->frame_size_min) / 2);
- put_bits(&s->pb, 5, s->bitstream_id);
- put_bits(&s->pb, 3, s->bitstream_mode);
- put_bits(&s->pb, 3, s->channel_mode);
- if ((s->channel_mode & 0x01) && s->channel_mode != AC3_CHMODE_MONO)
- put_bits(&s->pb, 2, s->center_mix_level);
- if (s->channel_mode & 0x04)
- put_bits(&s->pb, 2, s->surround_mix_level);
- if (s->channel_mode == AC3_CHMODE_STEREO)
- put_bits(&s->pb, 2, opt->dolby_surround_mode);
- put_bits(&s->pb, 1, s->lfe_on); /* LFE */
- put_bits(&s->pb, 5, -opt->dialogue_level);
- put_bits(&s->pb, 1, 0); /* no compression control word */
- put_bits(&s->pb, 1, 0); /* no lang code */
- put_bits(&s->pb, 1, opt->audio_production_info);
- if (opt->audio_production_info) {
- put_bits(&s->pb, 5, opt->mixing_level - 80);
- put_bits(&s->pb, 2, opt->room_type);
- }
- put_bits(&s->pb, 1, opt->copyright);
- put_bits(&s->pb, 1, opt->original);
- if (s->bitstream_id == 6) {
- /* alternate bit stream syntax */
- put_bits(&s->pb, 1, opt->extended_bsi_1);
- if (opt->extended_bsi_1) {
- put_bits(&s->pb, 2, opt->preferred_stereo_downmix);
- put_bits(&s->pb, 3, s->ltrt_center_mix_level);
- put_bits(&s->pb, 3, s->ltrt_surround_mix_level);
- put_bits(&s->pb, 3, s->loro_center_mix_level);
- put_bits(&s->pb, 3, s->loro_surround_mix_level);
- }
- put_bits(&s->pb, 1, opt->extended_bsi_2);
- if (opt->extended_bsi_2) {
- put_bits(&s->pb, 2, opt->dolby_surround_ex_mode);
- put_bits(&s->pb, 2, opt->dolby_headphone_mode);
- put_bits(&s->pb, 1, opt->ad_converter_type);
- put_bits(&s->pb, 9, 0); /* xbsi2 and encinfo : reserved */
- }
- } else {
- put_bits(&s->pb, 1, 0); /* no time code 1 */
- put_bits(&s->pb, 1, 0); /* no time code 2 */
- }
- put_bits(&s->pb, 1, 0); /* no additional bit stream info */
-}
-
-
-/*
- * Write one audio block to the output bitstream.
- */
-static void output_audio_block(AC3EncodeContext *s, int blk)
-{
- int ch, i, baie, bnd, got_cpl, ch0;
- AC3Block *block = &s->blocks[blk];
-
- /* block switching */
- if (!s->eac3) {
- for (ch = 0; ch < s->fbw_channels; ch++)
- put_bits(&s->pb, 1, 0);
- }
-
- /* dither flags */
- if (!s->eac3) {
- for (ch = 0; ch < s->fbw_channels; ch++)
- put_bits(&s->pb, 1, 1);
- }
-
- /* dynamic range codes */
- put_bits(&s->pb, 1, 0);
-
- /* spectral extension */
- if (s->eac3)
- put_bits(&s->pb, 1, 0);
-
- /* channel coupling */
- if (!s->eac3)
- put_bits(&s->pb, 1, block->new_cpl_strategy);
- if (block->new_cpl_strategy) {
- if (!s->eac3)
- put_bits(&s->pb, 1, block->cpl_in_use);
- if (block->cpl_in_use) {
- int start_sub, end_sub;
- if (s->eac3)
- put_bits(&s->pb, 1, 0); /* enhanced coupling */
- if (!s->eac3 || s->channel_mode != AC3_CHMODE_STEREO) {
- for (ch = 1; ch <= s->fbw_channels; ch++)
- put_bits(&s->pb, 1, block->channel_in_cpl[ch]);
- }
- if (s->channel_mode == AC3_CHMODE_STEREO)
- put_bits(&s->pb, 1, 0); /* phase flags in use */
- start_sub = (s->start_freq[CPL_CH] - 37) / 12;
- end_sub = (s->cpl_end_freq - 37) / 12;
- put_bits(&s->pb, 4, start_sub);
- put_bits(&s->pb, 4, end_sub - 3);
- /* coupling band structure */
- if (s->eac3) {
- put_bits(&s->pb, 1, 0); /* use default */
- } else {
- for (bnd = start_sub+1; bnd < end_sub; bnd++)
- put_bits(&s->pb, 1, ff_eac3_default_cpl_band_struct[bnd]);
- }
- }
- }
-
- /* coupling coordinates */
- if (block->cpl_in_use) {
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- if (block->channel_in_cpl[ch]) {
- if (!s->eac3 || block->new_cpl_coords[ch] != 2)
- put_bits(&s->pb, 1, block->new_cpl_coords[ch]);
- if (block->new_cpl_coords[ch]) {
- put_bits(&s->pb, 2, block->cpl_master_exp[ch]);
- for (bnd = 0; bnd < s->num_cpl_bands; bnd++) {
- put_bits(&s->pb, 4, block->cpl_coord_exp [ch][bnd]);
- put_bits(&s->pb, 4, block->cpl_coord_mant[ch][bnd]);
- }
- }
- }
- }
- }
-
- /* stereo rematrixing */
- if (s->channel_mode == AC3_CHMODE_STEREO) {
- if (!s->eac3 || blk > 0)
- put_bits(&s->pb, 1, block->new_rematrixing_strategy);
- if (block->new_rematrixing_strategy) {
- /* rematrixing flags */
- for (bnd = 0; bnd < block->num_rematrixing_bands; bnd++)
- put_bits(&s->pb, 1, block->rematrixing_flags[bnd]);
- }
- }
-
- /* exponent strategy */
- if (!s->eac3) {
- for (ch = !block->cpl_in_use; ch <= s->fbw_channels; ch++)
- put_bits(&s->pb, 2, s->exp_strategy[ch][blk]);
- if (s->lfe_on)
- put_bits(&s->pb, 1, s->exp_strategy[s->lfe_channel][blk]);
- }
-
- /* bandwidth */
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- if (s->exp_strategy[ch][blk] != EXP_REUSE && !block->channel_in_cpl[ch])
- put_bits(&s->pb, 6, s->bandwidth_code);
- }
-
- /* exponents */
- for (ch = !block->cpl_in_use; ch <= s->channels; ch++) {
- int nb_groups;
- int cpl = (ch == CPL_CH);
-
- if (s->exp_strategy[ch][blk] == EXP_REUSE)
- continue;
-
- /* DC exponent */
- put_bits(&s->pb, 4, block->grouped_exp[ch][0] >> cpl);
-
- /* exponent groups */
- nb_groups = exponent_group_tab[cpl][s->exp_strategy[ch][blk]-1][block->end_freq[ch]-s->start_freq[ch]];
- for (i = 1; i <= nb_groups; i++)
- put_bits(&s->pb, 7, block->grouped_exp[ch][i]);
-
- /* gain range info */
- if (ch != s->lfe_channel && !cpl)
- put_bits(&s->pb, 2, 0);
- }
-
- /* bit allocation info */
- if (!s->eac3) {
- baie = (blk == 0);
- put_bits(&s->pb, 1, baie);
- if (baie) {
- put_bits(&s->pb, 2, s->slow_decay_code);
- put_bits(&s->pb, 2, s->fast_decay_code);
- put_bits(&s->pb, 2, s->slow_gain_code);
- put_bits(&s->pb, 2, s->db_per_bit_code);
- put_bits(&s->pb, 3, s->floor_code);
- }
- }
-
- /* snr offset */
- if (!s->eac3) {
- put_bits(&s->pb, 1, block->new_snr_offsets);
- if (block->new_snr_offsets) {
- put_bits(&s->pb, 6, s->coarse_snr_offset);
- for (ch = !block->cpl_in_use; ch <= s->channels; ch++) {
- put_bits(&s->pb, 4, s->fine_snr_offset[ch]);
- put_bits(&s->pb, 3, s->fast_gain_code[ch]);
- }
- }
- } else {
- put_bits(&s->pb, 1, 0); /* no converter snr offset */
- }
-
- /* coupling leak */
- if (block->cpl_in_use) {
- if (!s->eac3 || block->new_cpl_leak != 2)
- put_bits(&s->pb, 1, block->new_cpl_leak);
- if (block->new_cpl_leak) {
- put_bits(&s->pb, 3, s->bit_alloc.cpl_fast_leak);
- put_bits(&s->pb, 3, s->bit_alloc.cpl_slow_leak);
- }
- }
-
- if (!s->eac3) {
- put_bits(&s->pb, 1, 0); /* no delta bit allocation */
- put_bits(&s->pb, 1, 0); /* no data to skip */
- }
-
- /* mantissas */
- got_cpl = !block->cpl_in_use;
- for (ch = 1; ch <= s->channels; ch++) {
- int b, q;
-
- if (!got_cpl && ch > 1 && block->channel_in_cpl[ch-1]) {
- ch0 = ch - 1;
- ch = CPL_CH;
- got_cpl = 1;
- }
- for (i = s->start_freq[ch]; i < block->end_freq[ch]; i++) {
- q = block->qmant[ch][i];
- b = s->ref_bap[ch][blk][i];
- switch (b) {
- case 0: break;
- case 1: if (q != 128) put_bits (&s->pb, 5, q); break;
- case 2: if (q != 128) put_bits (&s->pb, 7, q); break;
- case 3: put_sbits(&s->pb, 3, q); break;
- case 4: if (q != 128) put_bits (&s->pb, 7, q); break;
- case 14: put_sbits(&s->pb, 14, q); break;
- case 15: put_sbits(&s->pb, 16, q); break;
- default: put_sbits(&s->pb, b-1, q); break;
- }
- }
- if (ch == CPL_CH)
- ch = ch0;
- }
-}
-
-
-/** CRC-16 Polynomial */
-#define CRC16_POLY ((1 << 0) | (1 << 2) | (1 << 15) | (1 << 16))
-
-
-static unsigned int mul_poly(unsigned int a, unsigned int b, unsigned int poly)
-{
- unsigned int c;
-
- c = 0;
- while (a) {
- if (a & 1)
- c ^= b;
- a = a >> 1;
- b = b << 1;
- if (b & (1 << 16))
- b ^= poly;
- }
- return c;
-}
-
-
-static unsigned int pow_poly(unsigned int a, unsigned int n, unsigned int poly)
-{
- unsigned int r;
- r = 1;
- while (n) {
- if (n & 1)
- r = mul_poly(r, a, poly);
- a = mul_poly(a, a, poly);
- n >>= 1;
- }
- return r;
-}
-
-
-/*
- * Fill the end of the frame with 0's and compute the two CRCs.
- */
-static void output_frame_end(AC3EncodeContext *s)
-{
- const AVCRC *crc_ctx = av_crc_get_table(AV_CRC_16_ANSI);
- int frame_size_58, pad_bytes, crc1, crc2_partial, crc2, crc_inv;
- uint8_t *frame;
-
- frame_size_58 = ((s->frame_size >> 2) + (s->frame_size >> 4)) << 1;
-
- /* pad the remainder of the frame with zeros */
- av_assert2(s->frame_size * 8 - put_bits_count(&s->pb) >= 18);
- flush_put_bits(&s->pb);
- frame = s->pb.buf;
- pad_bytes = s->frame_size - (put_bits_ptr(&s->pb) - frame) - 2;
- av_assert2(pad_bytes >= 0);
- if (pad_bytes > 0)
- memset(put_bits_ptr(&s->pb), 0, pad_bytes);
-
- if (s->eac3) {
- /* compute crc2 */
- crc2_partial = av_crc(crc_ctx, 0, frame + 2, s->frame_size - 5);
- } else {
- /* compute crc1 */
- /* this is not so easy because it is at the beginning of the data... */
- crc1 = av_bswap16(av_crc(crc_ctx, 0, frame + 4, frame_size_58 - 4));
- crc_inv = s->crc_inv[s->frame_size > s->frame_size_min];
- crc1 = mul_poly(crc_inv, crc1, CRC16_POLY);
- AV_WB16(frame + 2, crc1);
-
- /* compute crc2 */
- crc2_partial = av_crc(crc_ctx, 0, frame + frame_size_58,
- s->frame_size - frame_size_58 - 3);
- }
- crc2 = av_crc(crc_ctx, crc2_partial, frame + s->frame_size - 3, 1);
- /* ensure crc2 does not match sync word by flipping crcrsv bit if needed */
- if (crc2 == 0x770B) {
- frame[s->frame_size - 3] ^= 0x1;
- crc2 = av_crc(crc_ctx, crc2_partial, frame + s->frame_size - 3, 1);
- }
- crc2 = av_bswap16(crc2);
- AV_WB16(frame + s->frame_size - 2, crc2);
-}
-
-
-/**
- * Write the frame to the output bitstream.
- *
- * @param s AC-3 encoder private context
- * @param frame output data buffer
- */
-void ff_ac3_output_frame(AC3EncodeContext *s, unsigned char *frame)
-{
- int blk;
-
- init_put_bits(&s->pb, frame, AC3_MAX_CODED_FRAME_SIZE);
-
- s->output_frame_header(s);
-
- for (blk = 0; blk < s->num_blocks; blk++)
- output_audio_block(s, blk);
-
- output_frame_end(s);
-}
-
-
-static void dprint_options(AC3EncodeContext *s)
-{
-#ifdef DEBUG
- AVCodecContext *avctx = s->avctx;
- AC3EncOptions *opt = &s->options;
- char strbuf[32];
-
- switch (s->bitstream_id) {
- case 6: av_strlcpy(strbuf, "AC-3 (alt syntax)", 32); break;
- case 8: av_strlcpy(strbuf, "AC-3 (standard)", 32); break;
- case 9: av_strlcpy(strbuf, "AC-3 (dnet half-rate)", 32); break;
- case 10: av_strlcpy(strbuf, "AC-3 (dnet quater-rate)", 32); break;
- case 16: av_strlcpy(strbuf, "E-AC-3 (enhanced)", 32); break;
- default: snprintf(strbuf, 32, "ERROR");
- }
- av_dlog(avctx, "bitstream_id: %s (%d)\n", strbuf, s->bitstream_id);
- av_dlog(avctx, "sample_fmt: %s\n", av_get_sample_fmt_name(avctx->sample_fmt));
- av_get_channel_layout_string(strbuf, 32, s->channels, avctx->channel_layout);
- av_dlog(avctx, "channel_layout: %s\n", strbuf);
- av_dlog(avctx, "sample_rate: %d\n", s->sample_rate);
- av_dlog(avctx, "bit_rate: %d\n", s->bit_rate);
- av_dlog(avctx, "blocks/frame: %d (code=%d)\n", s->num_blocks, s->num_blks_code);
- if (s->cutoff)
- av_dlog(avctx, "cutoff: %d\n", s->cutoff);
-
- av_dlog(avctx, "per_frame_metadata: %s\n",
- opt->allow_per_frame_metadata?"on":"off");
- if (s->has_center)
- av_dlog(avctx, "center_mixlev: %0.3f (%d)\n", opt->center_mix_level,
- s->center_mix_level);
- else
- av_dlog(avctx, "center_mixlev: {not written}\n");
- if (s->has_surround)
- av_dlog(avctx, "surround_mixlev: %0.3f (%d)\n", opt->surround_mix_level,
- s->surround_mix_level);
- else
- av_dlog(avctx, "surround_mixlev: {not written}\n");
- if (opt->audio_production_info) {
- av_dlog(avctx, "mixing_level: %ddB\n", opt->mixing_level);
- switch (opt->room_type) {
- case AC3ENC_OPT_NOT_INDICATED: av_strlcpy(strbuf, "notindicated", 32); break;
- case AC3ENC_OPT_LARGE_ROOM: av_strlcpy(strbuf, "large", 32); break;
- case AC3ENC_OPT_SMALL_ROOM: av_strlcpy(strbuf, "small", 32); break;
- default: snprintf(strbuf, 32, "ERROR (%d)", opt->room_type);
- }
- av_dlog(avctx, "room_type: %s\n", strbuf);
- } else {
- av_dlog(avctx, "mixing_level: {not written}\n");
- av_dlog(avctx, "room_type: {not written}\n");
- }
- av_dlog(avctx, "copyright: %s\n", opt->copyright?"on":"off");
- av_dlog(avctx, "dialnorm: %ddB\n", opt->dialogue_level);
- if (s->channel_mode == AC3_CHMODE_STEREO) {
- switch (opt->dolby_surround_mode) {
- case AC3ENC_OPT_NOT_INDICATED: av_strlcpy(strbuf, "notindicated", 32); break;
- case AC3ENC_OPT_MODE_ON: av_strlcpy(strbuf, "on", 32); break;
- case AC3ENC_OPT_MODE_OFF: av_strlcpy(strbuf, "off", 32); break;
- default: snprintf(strbuf, 32, "ERROR (%d)", opt->dolby_surround_mode);
- }
- av_dlog(avctx, "dsur_mode: %s\n", strbuf);
- } else {
- av_dlog(avctx, "dsur_mode: {not written}\n");
- }
- av_dlog(avctx, "original: %s\n", opt->original?"on":"off");
-
- if (s->bitstream_id == 6) {
- if (opt->extended_bsi_1) {
- switch (opt->preferred_stereo_downmix) {
- case AC3ENC_OPT_NOT_INDICATED: av_strlcpy(strbuf, "notindicated", 32); break;
- case AC3ENC_OPT_DOWNMIX_LTRT: av_strlcpy(strbuf, "ltrt", 32); break;
- case AC3ENC_OPT_DOWNMIX_LORO: av_strlcpy(strbuf, "loro", 32); break;
- default: snprintf(strbuf, 32, "ERROR (%d)", opt->preferred_stereo_downmix);
- }
- av_dlog(avctx, "dmix_mode: %s\n", strbuf);
- av_dlog(avctx, "ltrt_cmixlev: %0.3f (%d)\n",
- opt->ltrt_center_mix_level, s->ltrt_center_mix_level);
- av_dlog(avctx, "ltrt_surmixlev: %0.3f (%d)\n",
- opt->ltrt_surround_mix_level, s->ltrt_surround_mix_level);
- av_dlog(avctx, "loro_cmixlev: %0.3f (%d)\n",
- opt->loro_center_mix_level, s->loro_center_mix_level);
- av_dlog(avctx, "loro_surmixlev: %0.3f (%d)\n",
- opt->loro_surround_mix_level, s->loro_surround_mix_level);
- } else {
- av_dlog(avctx, "extended bitstream info 1: {not written}\n");
- }
- if (opt->extended_bsi_2) {
- switch (opt->dolby_surround_ex_mode) {
- case AC3ENC_OPT_NOT_INDICATED: av_strlcpy(strbuf, "notindicated", 32); break;
- case AC3ENC_OPT_MODE_ON: av_strlcpy(strbuf, "on", 32); break;
- case AC3ENC_OPT_MODE_OFF: av_strlcpy(strbuf, "off", 32); break;
- default: snprintf(strbuf, 32, "ERROR (%d)", opt->dolby_surround_ex_mode);
- }
- av_dlog(avctx, "dsurex_mode: %s\n", strbuf);
- switch (opt->dolby_headphone_mode) {
- case AC3ENC_OPT_NOT_INDICATED: av_strlcpy(strbuf, "notindicated", 32); break;
- case AC3ENC_OPT_MODE_ON: av_strlcpy(strbuf, "on", 32); break;
- case AC3ENC_OPT_MODE_OFF: av_strlcpy(strbuf, "off", 32); break;
- default: snprintf(strbuf, 32, "ERROR (%d)", opt->dolby_headphone_mode);
- }
- av_dlog(avctx, "dheadphone_mode: %s\n", strbuf);
-
- switch (opt->ad_converter_type) {
- case AC3ENC_OPT_ADCONV_STANDARD: av_strlcpy(strbuf, "standard", 32); break;
- case AC3ENC_OPT_ADCONV_HDCD: av_strlcpy(strbuf, "hdcd", 32); break;
- default: snprintf(strbuf, 32, "ERROR (%d)", opt->ad_converter_type);
- }
- av_dlog(avctx, "ad_conv_type: %s\n", strbuf);
- } else {
- av_dlog(avctx, "extended bitstream info 2: {not written}\n");
- }
- }
-#endif
-}
-
-
-#define FLT_OPTION_THRESHOLD 0.01
-
-static int validate_float_option(float v, const float *v_list, int v_list_size)
-{
- int i;
-
- for (i = 0; i < v_list_size; i++) {
- if (v < (v_list[i] + FLT_OPTION_THRESHOLD) &&
- v > (v_list[i] - FLT_OPTION_THRESHOLD))
- break;
- }
- if (i == v_list_size)
- return -1;
-
- return i;
-}
-
-
-static void validate_mix_level(void *log_ctx, const char *opt_name,
- float *opt_param, const float *list,
- int list_size, int default_value, int min_value,
- int *ctx_param)
-{
- int mixlev = validate_float_option(*opt_param, list, list_size);
- if (mixlev < min_value) {
- mixlev = default_value;
- if (*opt_param >= 0.0) {
- av_log(log_ctx, AV_LOG_WARNING, "requested %s is not valid. using "
- "default value: %0.3f\n", opt_name, list[mixlev]);
- }
- }
- *opt_param = list[mixlev];
- *ctx_param = mixlev;
-}
-
-
-/**
- * Validate metadata options as set by AVOption system.
- * These values can optionally be changed per-frame.
- *
- * @param s AC-3 encoder private context
- */
-int ff_ac3_validate_metadata(AC3EncodeContext *s)
-{
- AVCodecContext *avctx = s->avctx;
- AC3EncOptions *opt = &s->options;
-
- opt->audio_production_info = 0;
- opt->extended_bsi_1 = 0;
- opt->extended_bsi_2 = 0;
- opt->eac3_mixing_metadata = 0;
- opt->eac3_info_metadata = 0;
-
- /* determine mixing metadata / xbsi1 use */
- if (s->channel_mode > AC3_CHMODE_STEREO && opt->preferred_stereo_downmix != AC3ENC_OPT_NONE) {
- opt->extended_bsi_1 = 1;
- opt->eac3_mixing_metadata = 1;
- }
- if (s->has_center &&
- (opt->ltrt_center_mix_level >= 0 || opt->loro_center_mix_level >= 0)) {
- opt->extended_bsi_1 = 1;
- opt->eac3_mixing_metadata = 1;
- }
- if (s->has_surround &&
- (opt->ltrt_surround_mix_level >= 0 || opt->loro_surround_mix_level >= 0)) {
- opt->extended_bsi_1 = 1;
- opt->eac3_mixing_metadata = 1;
- }
-
- if (s->eac3) {
- /* determine info metadata use */
- if (avctx->audio_service_type != AV_AUDIO_SERVICE_TYPE_MAIN)
- opt->eac3_info_metadata = 1;
- if (opt->copyright != AC3ENC_OPT_NONE || opt->original != AC3ENC_OPT_NONE)
- opt->eac3_info_metadata = 1;
- if (s->channel_mode == AC3_CHMODE_STEREO &&
- (opt->dolby_headphone_mode != AC3ENC_OPT_NONE || opt->dolby_surround_mode != AC3ENC_OPT_NONE))
- opt->eac3_info_metadata = 1;
- if (s->channel_mode >= AC3_CHMODE_2F2R && opt->dolby_surround_ex_mode != AC3ENC_OPT_NONE)
- opt->eac3_info_metadata = 1;
- if (opt->mixing_level != AC3ENC_OPT_NONE || opt->room_type != AC3ENC_OPT_NONE ||
- opt->ad_converter_type != AC3ENC_OPT_NONE) {
- opt->audio_production_info = 1;
- opt->eac3_info_metadata = 1;
- }
- } else {
- /* determine audio production info use */
- if (opt->mixing_level != AC3ENC_OPT_NONE || opt->room_type != AC3ENC_OPT_NONE)
- opt->audio_production_info = 1;
-
- /* determine xbsi2 use */
- if (s->channel_mode >= AC3_CHMODE_2F2R && opt->dolby_surround_ex_mode != AC3ENC_OPT_NONE)
- opt->extended_bsi_2 = 1;
- if (s->channel_mode == AC3_CHMODE_STEREO && opt->dolby_headphone_mode != AC3ENC_OPT_NONE)
- opt->extended_bsi_2 = 1;
- if (opt->ad_converter_type != AC3ENC_OPT_NONE)
- opt->extended_bsi_2 = 1;
- }
-
- /* validate AC-3 mixing levels */
- if (!s->eac3) {
- if (s->has_center) {
- validate_mix_level(avctx, "center_mix_level", &opt->center_mix_level,
- cmixlev_options, CMIXLEV_NUM_OPTIONS, 1, 0,
- &s->center_mix_level);
- }
- if (s->has_surround) {
- validate_mix_level(avctx, "surround_mix_level", &opt->surround_mix_level,
- surmixlev_options, SURMIXLEV_NUM_OPTIONS, 1, 0,
- &s->surround_mix_level);
- }
- }
-
- /* validate extended bsi 1 / mixing metadata */
- if (opt->extended_bsi_1 || opt->eac3_mixing_metadata) {
- /* default preferred stereo downmix */
- if (opt->preferred_stereo_downmix == AC3ENC_OPT_NONE)
- opt->preferred_stereo_downmix = AC3ENC_OPT_NOT_INDICATED;
- if (!s->eac3 || s->has_center) {
- /* validate Lt/Rt center mix level */
- validate_mix_level(avctx, "ltrt_center_mix_level",
- &opt->ltrt_center_mix_level, extmixlev_options,
- EXTMIXLEV_NUM_OPTIONS, 5, 0,
- &s->ltrt_center_mix_level);
- /* validate Lo/Ro center mix level */
- validate_mix_level(avctx, "loro_center_mix_level",
- &opt->loro_center_mix_level, extmixlev_options,
- EXTMIXLEV_NUM_OPTIONS, 5, 0,
- &s->loro_center_mix_level);
- }
- if (!s->eac3 || s->has_surround) {
- /* validate Lt/Rt surround mix level */
- validate_mix_level(avctx, "ltrt_surround_mix_level",
- &opt->ltrt_surround_mix_level, extmixlev_options,
- EXTMIXLEV_NUM_OPTIONS, 6, 3,
- &s->ltrt_surround_mix_level);
- /* validate Lo/Ro surround mix level */
- validate_mix_level(avctx, "loro_surround_mix_level",
- &opt->loro_surround_mix_level, extmixlev_options,
- EXTMIXLEV_NUM_OPTIONS, 6, 3,
- &s->loro_surround_mix_level);
- }
- }
-
- /* validate audio service type / channels combination */
- if ((avctx->audio_service_type == AV_AUDIO_SERVICE_TYPE_KARAOKE &&
- avctx->channels == 1) ||
- ((avctx->audio_service_type == AV_AUDIO_SERVICE_TYPE_COMMENTARY ||
- avctx->audio_service_type == AV_AUDIO_SERVICE_TYPE_EMERGENCY ||
- avctx->audio_service_type == AV_AUDIO_SERVICE_TYPE_VOICE_OVER)
- && avctx->channels > 1)) {
- av_log(avctx, AV_LOG_ERROR, "invalid audio service type for the "
- "specified number of channels\n");
- return AVERROR(EINVAL);
- }
-
- /* validate extended bsi 2 / info metadata */
- if (opt->extended_bsi_2 || opt->eac3_info_metadata) {
- /* default dolby headphone mode */
- if (opt->dolby_headphone_mode == AC3ENC_OPT_NONE)
- opt->dolby_headphone_mode = AC3ENC_OPT_NOT_INDICATED;
- /* default dolby surround ex mode */
- if (opt->dolby_surround_ex_mode == AC3ENC_OPT_NONE)
- opt->dolby_surround_ex_mode = AC3ENC_OPT_NOT_INDICATED;
- /* default A/D converter type */
- if (opt->ad_converter_type == AC3ENC_OPT_NONE)
- opt->ad_converter_type = AC3ENC_OPT_ADCONV_STANDARD;
- }
-
- /* copyright & original defaults */
- if (!s->eac3 || opt->eac3_info_metadata) {
- /* default copyright */
- if (opt->copyright == AC3ENC_OPT_NONE)
- opt->copyright = AC3ENC_OPT_OFF;
- /* default original */
- if (opt->original == AC3ENC_OPT_NONE)
- opt->original = AC3ENC_OPT_ON;
- }
-
- /* dolby surround mode default */
- if (!s->eac3 || opt->eac3_info_metadata) {
- if (opt->dolby_surround_mode == AC3ENC_OPT_NONE)
- opt->dolby_surround_mode = AC3ENC_OPT_NOT_INDICATED;
- }
-
- /* validate audio production info */
- if (opt->audio_production_info) {
- if (opt->mixing_level == AC3ENC_OPT_NONE) {
- av_log(avctx, AV_LOG_ERROR, "mixing_level must be set if "
- "room_type is set\n");
- return AVERROR(EINVAL);
- }
- if (opt->mixing_level < 80) {
- av_log(avctx, AV_LOG_ERROR, "invalid mixing level. must be between "
- "80dB and 111dB\n");
- return AVERROR(EINVAL);
- }
- /* default room type */
- if (opt->room_type == AC3ENC_OPT_NONE)
- opt->room_type = AC3ENC_OPT_NOT_INDICATED;
- }
-
- /* set bitstream id for alternate bitstream syntax */
- if (!s->eac3 && (opt->extended_bsi_1 || opt->extended_bsi_2)) {
- if (s->bitstream_id > 8 && s->bitstream_id < 11) {
- static int warn_once = 1;
- if (warn_once) {
- av_log(avctx, AV_LOG_WARNING, "alternate bitstream syntax is "
- "not compatible with reduced samplerates. writing of "
- "extended bitstream information will be disabled.\n");
- warn_once = 0;
- }
- } else {
- s->bitstream_id = 6;
- }
- }
-
- return 0;
-}
-
-
-/**
- * Finalize encoding and free any memory allocated by the encoder.
- *
- * @param avctx Codec context
- */
-av_cold int ff_ac3_encode_close(AVCodecContext *avctx)
-{
- int blk, ch;
- AC3EncodeContext *s = avctx->priv_data;
-
- av_freep(&s->windowed_samples);
- if (s->planar_samples)
- for (ch = 0; ch < s->channels; ch++)
- av_freep(&s->planar_samples[ch]);
- av_freep(&s->planar_samples);
- av_freep(&s->bap_buffer);
- av_freep(&s->bap1_buffer);
- av_freep(&s->mdct_coef_buffer);
- av_freep(&s->fixed_coef_buffer);
- av_freep(&s->exp_buffer);
- av_freep(&s->grouped_exp_buffer);
- av_freep(&s->psd_buffer);
- av_freep(&s->band_psd_buffer);
- av_freep(&s->mask_buffer);
- av_freep(&s->qmant_buffer);
- av_freep(&s->cpl_coord_exp_buffer);
- av_freep(&s->cpl_coord_mant_buffer);
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- av_freep(&block->mdct_coef);
- av_freep(&block->fixed_coef);
- av_freep(&block->exp);
- av_freep(&block->grouped_exp);
- av_freep(&block->psd);
- av_freep(&block->band_psd);
- av_freep(&block->mask);
- av_freep(&block->qmant);
- av_freep(&block->cpl_coord_exp);
- av_freep(&block->cpl_coord_mant);
- }
-
- s->mdct_end(s);
-
- return 0;
-}
-
-
-/*
- * Set channel information during initialization.
- */
-static av_cold int set_channel_info(AC3EncodeContext *s, int channels,
- uint64_t *channel_layout)
-{
- int ch_layout;
-
- if (channels < 1 || channels > AC3_MAX_CHANNELS)
- return AVERROR(EINVAL);
- if (*channel_layout > 0x7FF)
- return AVERROR(EINVAL);
- ch_layout = *channel_layout;
- if (!ch_layout)
- ch_layout = av_get_default_channel_layout(channels);
-
- s->lfe_on = !!(ch_layout & AV_CH_LOW_FREQUENCY);
- s->channels = channels;
- s->fbw_channels = channels - s->lfe_on;
- s->lfe_channel = s->lfe_on ? s->fbw_channels + 1 : -1;
- if (s->lfe_on)
- ch_layout -= AV_CH_LOW_FREQUENCY;
-
- switch (ch_layout) {
- case AV_CH_LAYOUT_MONO: s->channel_mode = AC3_CHMODE_MONO; break;
- case AV_CH_LAYOUT_STEREO: s->channel_mode = AC3_CHMODE_STEREO; break;
- case AV_CH_LAYOUT_SURROUND: s->channel_mode = AC3_CHMODE_3F; break;
- case AV_CH_LAYOUT_2_1: s->channel_mode = AC3_CHMODE_2F1R; break;
- case AV_CH_LAYOUT_4POINT0: s->channel_mode = AC3_CHMODE_3F1R; break;
- case AV_CH_LAYOUT_QUAD:
- case AV_CH_LAYOUT_2_2: s->channel_mode = AC3_CHMODE_2F2R; break;
- case AV_CH_LAYOUT_5POINT0:
- case AV_CH_LAYOUT_5POINT0_BACK: s->channel_mode = AC3_CHMODE_3F2R; break;
- default:
- return AVERROR(EINVAL);
- }
- s->has_center = (s->channel_mode & 0x01) && s->channel_mode != AC3_CHMODE_MONO;
- s->has_surround = s->channel_mode & 0x04;
-
- s->channel_map = ff_ac3_enc_channel_map[s->channel_mode][s->lfe_on];
- *channel_layout = ch_layout;
- if (s->lfe_on)
- *channel_layout |= AV_CH_LOW_FREQUENCY;
-
- return 0;
-}
-
-
-static av_cold int validate_options(AC3EncodeContext *s)
-{
- AVCodecContext *avctx = s->avctx;
- int i, ret, max_sr;
-
- /* validate channel layout */
- if (!avctx->channel_layout) {
- av_log(avctx, AV_LOG_WARNING, "No channel layout specified. The "
- "encoder will guess the layout, but it "
- "might be incorrect.\n");
- }
- ret = set_channel_info(s, avctx->channels, &avctx->channel_layout);
- if (ret) {
- av_log(avctx, AV_LOG_ERROR, "invalid channel layout\n");
- return ret;
- }
-
- /* validate sample rate */
- /* note: max_sr could be changed from 2 to 5 for E-AC-3 once we find a
- decoder that supports half sample rate so we can validate that
- the generated files are correct. */
- max_sr = s->eac3 ? 2 : 8;
- for (i = 0; i <= max_sr; i++) {
- if ((ff_ac3_sample_rate_tab[i % 3] >> (i / 3)) == avctx->sample_rate)
- break;
- }
- if (i > max_sr) {
- av_log(avctx, AV_LOG_ERROR, "invalid sample rate\n");
- return AVERROR(EINVAL);
- }
- s->sample_rate = avctx->sample_rate;
- s->bit_alloc.sr_shift = i / 3;
- s->bit_alloc.sr_code = i % 3;
- s->bitstream_id = s->eac3 ? 16 : 8 + s->bit_alloc.sr_shift;
-
- /* select a default bit rate if not set by the user */
- if (!avctx->bit_rate) {
- switch (s->fbw_channels) {
- case 1: avctx->bit_rate = 96000; break;
- case 2: avctx->bit_rate = 192000; break;
- case 3: avctx->bit_rate = 320000; break;
- case 4: avctx->bit_rate = 384000; break;
- case 5: avctx->bit_rate = 448000; break;
- }
- }
-
- /* validate bit rate */
- if (s->eac3) {
- int max_br, min_br, wpf, min_br_dist, min_br_code;
- int num_blks_code, num_blocks, frame_samples;
-
- /* calculate min/max bitrate */
- /* TODO: More testing with 3 and 2 blocks. All E-AC-3 samples I've
- found use either 6 blocks or 1 block, even though 2 or 3 blocks
- would work as far as the bit rate is concerned. */
- for (num_blks_code = 3; num_blks_code >= 0; num_blks_code--) {
- num_blocks = ((int[]){ 1, 2, 3, 6 })[num_blks_code];
- frame_samples = AC3_BLOCK_SIZE * num_blocks;
- max_br = 2048 * s->sample_rate / frame_samples * 16;
- min_br = ((s->sample_rate + (frame_samples-1)) / frame_samples) * 16;
- if (avctx->bit_rate <= max_br)
- break;
- }
- if (avctx->bit_rate < min_br || avctx->bit_rate > max_br) {
- av_log(avctx, AV_LOG_ERROR, "invalid bit rate. must be %d to %d "
- "for this sample rate\n", min_br, max_br);
- return AVERROR(EINVAL);
- }
- s->num_blks_code = num_blks_code;
- s->num_blocks = num_blocks;
-
- /* calculate words-per-frame for the selected bitrate */
- wpf = (avctx->bit_rate / 16) * frame_samples / s->sample_rate;
- av_assert1(wpf > 0 && wpf <= 2048);
-
- /* find the closest AC-3 bitrate code to the selected bitrate.
- this is needed for lookup tables for bandwidth and coupling
- parameter selection */
- min_br_code = -1;
- min_br_dist = INT_MAX;
- for (i = 0; i < 19; i++) {
- int br_dist = abs(ff_ac3_bitrate_tab[i] * 1000 - avctx->bit_rate);
- if (br_dist < min_br_dist) {
- min_br_dist = br_dist;
- min_br_code = i;
- }
- }
-
- /* make sure the minimum frame size is below the average frame size */
- s->frame_size_code = min_br_code << 1;
- while (wpf > 1 && wpf * s->sample_rate / AC3_FRAME_SIZE * 16 > avctx->bit_rate)
- wpf--;
- s->frame_size_min = 2 * wpf;
- } else {
- int best_br = 0, best_code = 0, best_diff = INT_MAX;
- for (i = 0; i < 19; i++) {
- int br = (ff_ac3_bitrate_tab[i] >> s->bit_alloc.sr_shift) * 1000;
- int diff = abs(br - avctx->bit_rate);
- if (diff < best_diff) {
- best_br = br;
- best_code = i;
- best_diff = diff;
- }
- if (!best_diff)
- break;
- }
- avctx->bit_rate = best_br;
- s->frame_size_code = best_code << 1;
- s->frame_size_min = 2 * ff_ac3_frame_size_tab[s->frame_size_code][s->bit_alloc.sr_code];
- s->num_blks_code = 0x3;
- s->num_blocks = 6;
- }
- s->bit_rate = avctx->bit_rate;
- s->frame_size = s->frame_size_min;
-
- /* validate cutoff */
- if (avctx->cutoff < 0) {
- av_log(avctx, AV_LOG_ERROR, "invalid cutoff frequency\n");
- return AVERROR(EINVAL);
- }
- s->cutoff = avctx->cutoff;
- if (s->cutoff > (s->sample_rate >> 1))
- s->cutoff = s->sample_rate >> 1;
-
- ret = ff_ac3_validate_metadata(s);
- if (ret)
- return ret;
-
- s->rematrixing_enabled = s->options.stereo_rematrixing &&
- (s->channel_mode == AC3_CHMODE_STEREO);
-
- s->cpl_enabled = s->options.channel_coupling &&
- s->channel_mode >= AC3_CHMODE_STEREO;
-
- return 0;
-}
-
-
-/*
- * Set bandwidth for all channels.
- * The user can optionally supply a cutoff frequency. Otherwise an appropriate
- * default value will be used.
- */
-static av_cold void set_bandwidth(AC3EncodeContext *s)
-{
- int blk, ch, cpl_start;
-
- if (s->cutoff) {
- /* calculate bandwidth based on user-specified cutoff frequency */
- int fbw_coeffs;
- fbw_coeffs = s->cutoff * 2 * AC3_MAX_COEFS / s->sample_rate;
- s->bandwidth_code = av_clip((fbw_coeffs - 73) / 3, 0, 60);
- } else {
- /* use default bandwidth setting */
- s->bandwidth_code = ac3_bandwidth_tab[s->fbw_channels-1][s->bit_alloc.sr_code][s->frame_size_code/2];
- }
-
- /* set number of coefficients for each channel */
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- s->start_freq[ch] = 0;
- for (blk = 0; blk < s->num_blocks; blk++)
- s->blocks[blk].end_freq[ch] = s->bandwidth_code * 3 + 73;
- }
- /* LFE channel always has 7 coefs */
- if (s->lfe_on) {
- s->start_freq[s->lfe_channel] = 0;
- for (blk = 0; blk < s->num_blocks; blk++)
- s->blocks[blk].end_freq[ch] = 7;
- }
-
- /* initialize coupling strategy */
- if (s->cpl_enabled) {
- if (s->options.cpl_start != AC3ENC_OPT_AUTO) {
- cpl_start = s->options.cpl_start;
- } else {
- cpl_start = ac3_coupling_start_tab[s->channel_mode-2][s->bit_alloc.sr_code][s->frame_size_code/2];
- if (cpl_start < 0) {
- if (s->options.channel_coupling == AC3ENC_OPT_AUTO)
- s->cpl_enabled = 0;
- else
- cpl_start = 15;
- }
- }
- }
- if (s->cpl_enabled) {
- int i, cpl_start_band, cpl_end_band;
- uint8_t *cpl_band_sizes = s->cpl_band_sizes;
-
- cpl_end_band = s->bandwidth_code / 4 + 3;
- cpl_start_band = av_clip(cpl_start, 0, FFMIN(cpl_end_band-1, 15));
-
- s->num_cpl_subbands = cpl_end_band - cpl_start_band;
-
- s->num_cpl_bands = 1;
- *cpl_band_sizes = 12;
- for (i = cpl_start_band + 1; i < cpl_end_band; i++) {
- if (ff_eac3_default_cpl_band_struct[i]) {
- *cpl_band_sizes += 12;
- } else {
- s->num_cpl_bands++;
- cpl_band_sizes++;
- *cpl_band_sizes = 12;
- }
- }
-
- s->start_freq[CPL_CH] = cpl_start_band * 12 + 37;
- s->cpl_end_freq = cpl_end_band * 12 + 37;
- for (blk = 0; blk < s->num_blocks; blk++)
- s->blocks[blk].end_freq[CPL_CH] = s->cpl_end_freq;
- }
-}
-
-
-static av_cold int allocate_buffers(AC3EncodeContext *s)
-{
- AVCodecContext *avctx = s->avctx;
- int blk, ch;
- int channels = s->channels + 1; /* includes coupling channel */
- int channel_blocks = channels * s->num_blocks;
- int total_coefs = AC3_MAX_COEFS * channel_blocks;
-
- if (s->allocate_sample_buffers(s))
- goto alloc_fail;
-
- FF_ALLOC_OR_GOTO(avctx, s->bap_buffer, total_coefs *
- sizeof(*s->bap_buffer), alloc_fail);
- FF_ALLOC_OR_GOTO(avctx, s->bap1_buffer, total_coefs *
- sizeof(*s->bap1_buffer), alloc_fail);
- FF_ALLOCZ_OR_GOTO(avctx, s->mdct_coef_buffer, total_coefs *
- sizeof(*s->mdct_coef_buffer), alloc_fail);
- FF_ALLOC_OR_GOTO(avctx, s->exp_buffer, total_coefs *
- sizeof(*s->exp_buffer), alloc_fail);
- FF_ALLOC_OR_GOTO(avctx, s->grouped_exp_buffer, channel_blocks * 128 *
- sizeof(*s->grouped_exp_buffer), alloc_fail);
- FF_ALLOC_OR_GOTO(avctx, s->psd_buffer, total_coefs *
- sizeof(*s->psd_buffer), alloc_fail);
- FF_ALLOC_OR_GOTO(avctx, s->band_psd_buffer, channel_blocks * 64 *
- sizeof(*s->band_psd_buffer), alloc_fail);
- FF_ALLOC_OR_GOTO(avctx, s->mask_buffer, channel_blocks * 64 *
- sizeof(*s->mask_buffer), alloc_fail);
- FF_ALLOC_OR_GOTO(avctx, s->qmant_buffer, total_coefs *
- sizeof(*s->qmant_buffer), alloc_fail);
- if (s->cpl_enabled) {
- FF_ALLOC_OR_GOTO(avctx, s->cpl_coord_exp_buffer, channel_blocks * 16 *
- sizeof(*s->cpl_coord_exp_buffer), alloc_fail);
- FF_ALLOC_OR_GOTO(avctx, s->cpl_coord_mant_buffer, channel_blocks * 16 *
- sizeof(*s->cpl_coord_mant_buffer), alloc_fail);
- }
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- FF_ALLOCZ_OR_GOTO(avctx, block->mdct_coef, channels * sizeof(*block->mdct_coef),
- alloc_fail);
- FF_ALLOCZ_OR_GOTO(avctx, block->exp, channels * sizeof(*block->exp),
- alloc_fail);
- FF_ALLOCZ_OR_GOTO(avctx, block->grouped_exp, channels * sizeof(*block->grouped_exp),
- alloc_fail);
- FF_ALLOCZ_OR_GOTO(avctx, block->psd, channels * sizeof(*block->psd),
- alloc_fail);
- FF_ALLOCZ_OR_GOTO(avctx, block->band_psd, channels * sizeof(*block->band_psd),
- alloc_fail);
- FF_ALLOCZ_OR_GOTO(avctx, block->mask, channels * sizeof(*block->mask),
- alloc_fail);
- FF_ALLOCZ_OR_GOTO(avctx, block->qmant, channels * sizeof(*block->qmant),
- alloc_fail);
- if (s->cpl_enabled) {
- FF_ALLOCZ_OR_GOTO(avctx, block->cpl_coord_exp, channels * sizeof(*block->cpl_coord_exp),
- alloc_fail);
- FF_ALLOCZ_OR_GOTO(avctx, block->cpl_coord_mant, channels * sizeof(*block->cpl_coord_mant),
- alloc_fail);
- }
-
- for (ch = 0; ch < channels; ch++) {
- /* arrangement: block, channel, coeff */
- block->grouped_exp[ch] = &s->grouped_exp_buffer[128 * (blk * channels + ch)];
- block->psd[ch] = &s->psd_buffer [AC3_MAX_COEFS * (blk * channels + ch)];
- block->band_psd[ch] = &s->band_psd_buffer [64 * (blk * channels + ch)];
- block->mask[ch] = &s->mask_buffer [64 * (blk * channels + ch)];
- block->qmant[ch] = &s->qmant_buffer [AC3_MAX_COEFS * (blk * channels + ch)];
- if (s->cpl_enabled) {
- block->cpl_coord_exp[ch] = &s->cpl_coord_exp_buffer [16 * (blk * channels + ch)];
- block->cpl_coord_mant[ch] = &s->cpl_coord_mant_buffer[16 * (blk * channels + ch)];
- }
-
- /* arrangement: channel, block, coeff */
- block->exp[ch] = &s->exp_buffer [AC3_MAX_COEFS * (s->num_blocks * ch + blk)];
- block->mdct_coef[ch] = &s->mdct_coef_buffer [AC3_MAX_COEFS * (s->num_blocks * ch + blk)];
- }
- }
-
- if (!s->fixed_point) {
- FF_ALLOCZ_OR_GOTO(avctx, s->fixed_coef_buffer, total_coefs *
- sizeof(*s->fixed_coef_buffer), alloc_fail);
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- FF_ALLOCZ_OR_GOTO(avctx, block->fixed_coef, channels *
- sizeof(*block->fixed_coef), alloc_fail);
- for (ch = 0; ch < channels; ch++)
- block->fixed_coef[ch] = &s->fixed_coef_buffer[AC3_MAX_COEFS * (s->num_blocks * ch + blk)];
- }
- } else {
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- FF_ALLOCZ_OR_GOTO(avctx, block->fixed_coef, channels *
- sizeof(*block->fixed_coef), alloc_fail);
- for (ch = 0; ch < channels; ch++)
- block->fixed_coef[ch] = (int32_t *)block->mdct_coef[ch];
- }
- }
-
- return 0;
-alloc_fail:
- return AVERROR(ENOMEM);
-}
-
-
-av_cold int ff_ac3_encode_init(AVCodecContext *avctx)
-{
- AC3EncodeContext *s = avctx->priv_data;
- int ret, frame_size_58;
-
- s->avctx = avctx;
-
- s->eac3 = avctx->codec_id == AV_CODEC_ID_EAC3;
-
- ff_ac3_common_init();
-
- ret = validate_options(s);
- if (ret)
- return ret;
-
- avctx->frame_size = AC3_BLOCK_SIZE * s->num_blocks;
- avctx->delay = AC3_BLOCK_SIZE;
-
- s->bitstream_mode = avctx->audio_service_type;
- if (s->bitstream_mode == AV_AUDIO_SERVICE_TYPE_KARAOKE)
- s->bitstream_mode = 0x7;
-
- s->bits_written = 0;
- s->samples_written = 0;
-
- /* calculate crc_inv for both possible frame sizes */
- frame_size_58 = (( s->frame_size >> 2) + ( s->frame_size >> 4)) << 1;
- s->crc_inv[0] = pow_poly((CRC16_POLY >> 1), (8 * frame_size_58) - 16, CRC16_POLY);
- if (s->bit_alloc.sr_code == 1) {
- frame_size_58 = (((s->frame_size+2) >> 2) + ((s->frame_size+2) >> 4)) << 1;
- s->crc_inv[1] = pow_poly((CRC16_POLY >> 1), (8 * frame_size_58) - 16, CRC16_POLY);
- }
-
- /* set function pointers */
- if (CONFIG_AC3_FIXED_ENCODER && s->fixed_point) {
- s->mdct_end = ff_ac3_fixed_mdct_end;
- s->mdct_init = ff_ac3_fixed_mdct_init;
- s->allocate_sample_buffers = ff_ac3_fixed_allocate_sample_buffers;
- } else if (CONFIG_AC3_ENCODER || CONFIG_EAC3_ENCODER) {
- s->mdct_end = ff_ac3_float_mdct_end;
- s->mdct_init = ff_ac3_float_mdct_init;
- s->allocate_sample_buffers = ff_ac3_float_allocate_sample_buffers;
- }
- if (CONFIG_EAC3_ENCODER && s->eac3)
- s->output_frame_header = ff_eac3_output_frame_header;
- else
- s->output_frame_header = ac3_output_frame_header;
-
- set_bandwidth(s);
-
- exponent_init(s);
-
- bit_alloc_init(s);
-
- ret = s->mdct_init(s);
- if (ret)
- goto init_fail;
-
- ret = allocate_buffers(s);
- if (ret)
- goto init_fail;
-
- ff_dsputil_init(&s->dsp, avctx);
- avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
- ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT);
-
- dprint_options(s);
-
- return 0;
-init_fail:
- ff_ac3_encode_close(avctx);
- return ret;
-}
diff --git a/libavcodec/ac3enc.h b/libavcodec/ac3enc.h
deleted file mode 100644
index a04e704..0000000
--- a/libavcodec/ac3enc.h
+++ b/dev/null
@@ -1,308 +0,0 @@
-/*
- * AC-3 encoder & E-AC-3 encoder common header
- * Copyright (c) 2000 Fabrice Bellard
- * Copyright (c) 2006-2010 Justin Ruggles <justin.ruggles@gmail.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
- */
-
-/**
- * @file
- * AC-3 encoder & E-AC-3 encoder common header
- */
-
-#ifndef AVCODEC_AC3ENC_H
-#define AVCODEC_AC3ENC_H
-
-#include <stdint.h>
-
-#include "libavutil/float_dsp.h"
-#include "ac3.h"
-#include "ac3dsp.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "put_bits.h"
-#include "fft.h"
-
-#ifndef CONFIG_AC3ENC_FLOAT
-#define CONFIG_AC3ENC_FLOAT 0
-#endif
-
-#define OFFSET(param) offsetof(AC3EncodeContext, options.param)
-#define AC3ENC_PARAM (AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
-
-#define AC3ENC_TYPE_AC3_FIXED 0
-#define AC3ENC_TYPE_AC3 1
-#define AC3ENC_TYPE_EAC3 2
-
-#if CONFIG_AC3ENC_FLOAT
-#define AC3_NAME(x) ff_ac3_float_ ## x
-#define MAC_COEF(d,a,b) ((d)+=(a)*(b))
-#define COEF_MIN (-16777215.0/16777216.0)
-#define COEF_MAX ( 16777215.0/16777216.0)
-#define NEW_CPL_COORD_THRESHOLD 0.03
-typedef float SampleType;
-typedef float CoefType;
-typedef float CoefSumType;
-#else
-#define AC3_NAME(x) ff_ac3_fixed_ ## x
-#define MAC_COEF(d,a,b) MAC64(d,a,b)
-#define COEF_MIN -16777215
-#define COEF_MAX 16777215
-#define NEW_CPL_COORD_THRESHOLD 503317
-typedef int16_t SampleType;
-typedef int32_t CoefType;
-typedef int64_t CoefSumType;
-#endif
-
-/* common option values */
-#define AC3ENC_OPT_NONE -1
-#define AC3ENC_OPT_AUTO -1
-#define AC3ENC_OPT_OFF 0
-#define AC3ENC_OPT_ON 1
-#define AC3ENC_OPT_NOT_INDICATED 0
-#define AC3ENC_OPT_MODE_ON 2
-#define AC3ENC_OPT_MODE_OFF 1
-
-/* specific option values */
-#define AC3ENC_OPT_LARGE_ROOM 1
-#define AC3ENC_OPT_SMALL_ROOM 2
-#define AC3ENC_OPT_DOWNMIX_LTRT 1
-#define AC3ENC_OPT_DOWNMIX_LORO 2
-#define AC3ENC_OPT_ADCONV_STANDARD 0
-#define AC3ENC_OPT_ADCONV_HDCD 1
-
-
-/**
- * Encoding Options used by AVOption.
- */
-typedef struct AC3EncOptions {
- /* AC-3 metadata options*/
- int dialogue_level;
- int bitstream_mode;
- float center_mix_level;
- float surround_mix_level;
- int dolby_surround_mode;
- int audio_production_info;
- int mixing_level;
- int room_type;
- int copyright;
- int original;
- int extended_bsi_1;
- int preferred_stereo_downmix;
- float ltrt_center_mix_level;
- float ltrt_surround_mix_level;
- float loro_center_mix_level;
- float loro_surround_mix_level;
- int extended_bsi_2;
- int dolby_surround_ex_mode;
- int dolby_headphone_mode;
- int ad_converter_type;
- int eac3_mixing_metadata;
- int eac3_info_metadata;
-
- /* other encoding options */
- int allow_per_frame_metadata;
- int stereo_rematrixing;
- int channel_coupling;
- int cpl_start;
-} AC3EncOptions;
-
-/**
- * Data for a single audio block.
- */
-typedef struct AC3Block {
- CoefType **mdct_coef; ///< MDCT coefficients
- int32_t **fixed_coef; ///< fixed-point MDCT coefficients
- uint8_t **exp; ///< original exponents
- uint8_t **grouped_exp; ///< grouped exponents
- int16_t **psd; ///< psd per frequency bin
- int16_t **band_psd; ///< psd per critical band
- int16_t **mask; ///< masking curve
- uint16_t **qmant; ///< quantized mantissas
- uint8_t **cpl_coord_exp; ///< coupling coord exponents (cplcoexp)
- uint8_t **cpl_coord_mant; ///< coupling coord mantissas (cplcomant)
- uint8_t coeff_shift[AC3_MAX_CHANNELS]; ///< fixed-point coefficient shift values
- uint8_t new_rematrixing_strategy; ///< send new rematrixing flags in this block
- int num_rematrixing_bands; ///< number of rematrixing bands
- uint8_t rematrixing_flags[4]; ///< rematrixing flags
- int new_cpl_strategy; ///< send new coupling strategy
- int cpl_in_use; ///< coupling in use for this block (cplinu)
- uint8_t channel_in_cpl[AC3_MAX_CHANNELS]; ///< channel in coupling (chincpl)
- int num_cpl_channels; ///< number of channels in coupling
- uint8_t new_cpl_coords[AC3_MAX_CHANNELS]; ///< send new coupling coordinates (cplcoe)
- uint8_t cpl_master_exp[AC3_MAX_CHANNELS]; ///< coupling coord master exponents (mstrcplco)
- int new_snr_offsets; ///< send new SNR offsets
- int new_cpl_leak; ///< send new coupling leak info
- int end_freq[AC3_MAX_CHANNELS]; ///< end frequency bin (endmant)
-} AC3Block;
-
-/**
- * AC-3 encoder private context.
- */
-typedef struct AC3EncodeContext {
- AVClass *av_class; ///< AVClass used for AVOption
- AC3EncOptions options; ///< encoding options
- AVCodecContext *avctx; ///< parent AVCodecContext
- PutBitContext pb; ///< bitstream writer context
- DSPContext dsp;
- AVFloatDSPContext fdsp;
- AC3DSPContext ac3dsp; ///< AC-3 optimized functions
- FFTContext mdct; ///< FFT context for MDCT calculation
- const SampleType *mdct_window; ///< MDCT window function array
-
- AC3Block blocks[AC3_MAX_BLOCKS]; ///< per-block info
-
- int fixed_point; ///< indicates if fixed-point encoder is being used
- int eac3; ///< indicates if this is E-AC-3 vs. AC-3
- int bitstream_id; ///< bitstream id (bsid)
- int bitstream_mode; ///< bitstream mode (bsmod)
-
- int bit_rate; ///< target bit rate, in bits-per-second
- int sample_rate; ///< sampling frequency, in Hz
-
- int num_blks_code; ///< number of blocks code (numblkscod)
- int num_blocks; ///< number of blocks per frame
- int frame_size_min; ///< minimum frame size in case rounding is necessary
- int frame_size; ///< current frame size in bytes
- int frame_size_code; ///< frame size code (frmsizecod)
- uint16_t crc_inv[2];
- int64_t bits_written; ///< bit count (used to avg. bitrate)
- int64_t samples_written; ///< sample count (used to avg. bitrate)
-
- int fbw_channels; ///< number of full-bandwidth channels (nfchans)
- int channels; ///< total number of channels (nchans)
- int lfe_on; ///< indicates if there is an LFE channel (lfeon)
- int lfe_channel; ///< channel index of the LFE channel
- int has_center; ///< indicates if there is a center channel
- int has_surround; ///< indicates if there are one or more surround channels
- int channel_mode; ///< channel mode (acmod)
- const uint8_t *channel_map; ///< channel map used to reorder channels
-
- int center_mix_level; ///< center mix level code
- int surround_mix_level; ///< surround mix level code
- int ltrt_center_mix_level; ///< Lt/Rt center mix level code
- int ltrt_surround_mix_level; ///< Lt/Rt surround mix level code
- int loro_center_mix_level; ///< Lo/Ro center mix level code
- int loro_surround_mix_level; ///< Lo/Ro surround mix level code
-
- int cutoff; ///< user-specified cutoff frequency, in Hz
- int bandwidth_code; ///< bandwidth code (0 to 60) (chbwcod)
- int start_freq[AC3_MAX_CHANNELS]; ///< start frequency bin (strtmant)
- int cpl_end_freq; ///< coupling channel end frequency bin
-
- int cpl_on; ///< coupling turned on for this frame
- int cpl_enabled; ///< coupling enabled for all frames
- int num_cpl_subbands; ///< number of coupling subbands (ncplsubnd)
- int num_cpl_bands; ///< number of coupling bands (ncplbnd)
- uint8_t cpl_band_sizes[AC3_MAX_CPL_BANDS]; ///< number of coeffs in each coupling band
-
- int rematrixing_enabled; ///< stereo rematrixing enabled
-
- /* bitrate allocation control */
- int slow_gain_code; ///< slow gain code (sgaincod)
- int slow_decay_code; ///< slow decay code (sdcycod)
- int fast_decay_code; ///< fast decay code (fdcycod)
- int db_per_bit_code; ///< dB/bit code (dbpbcod)
- int floor_code; ///< floor code (floorcod)
- AC3BitAllocParameters bit_alloc; ///< bit allocation parameters
- int coarse_snr_offset; ///< coarse SNR offsets (csnroffst)
- int fast_gain_code[AC3_MAX_CHANNELS]; ///< fast gain codes (signal-to-mask ratio) (fgaincod)
- int fine_snr_offset[AC3_MAX_CHANNELS]; ///< fine SNR offsets (fsnroffst)
- int frame_bits_fixed; ///< number of non-coefficient bits for fixed parameters
- int frame_bits; ///< all frame bits except exponents and mantissas
- int exponent_bits; ///< number of bits used for exponents
-
- SampleType *windowed_samples;
- SampleType **planar_samples;
- uint8_t *bap_buffer;
- uint8_t *bap1_buffer;
- CoefType *mdct_coef_buffer;
- int32_t *fixed_coef_buffer;
- uint8_t *exp_buffer;
- uint8_t *grouped_exp_buffer;
- int16_t *psd_buffer;
- int16_t *band_psd_buffer;
- int16_t *mask_buffer;
- int16_t *qmant_buffer;
- uint8_t *cpl_coord_exp_buffer;
- uint8_t *cpl_coord_mant_buffer;
-
- uint8_t exp_strategy[AC3_MAX_CHANNELS][AC3_MAX_BLOCKS]; ///< exponent strategies
- uint8_t frame_exp_strategy[AC3_MAX_CHANNELS]; ///< frame exp strategy index
- int use_frame_exp_strategy; ///< indicates use of frame exp strategy
- uint8_t exp_ref_block[AC3_MAX_CHANNELS][AC3_MAX_BLOCKS]; ///< reference blocks for EXP_REUSE
- uint8_t *ref_bap [AC3_MAX_CHANNELS][AC3_MAX_BLOCKS]; ///< bit allocation pointers (bap)
- int ref_bap_set; ///< indicates if ref_bap pointers have been set
-
- /* fixed vs. float function pointers */
- void (*mdct_end)(struct AC3EncodeContext *s);
- int (*mdct_init)(struct AC3EncodeContext *s);
-
- /* fixed vs. float templated function pointers */
- int (*allocate_sample_buffers)(struct AC3EncodeContext *s);
-
- /* AC-3 vs. E-AC-3 function pointers */
- void (*output_frame_header)(struct AC3EncodeContext *s);
-} AC3EncodeContext;
-
-
-extern const uint64_t ff_ac3_channel_layouts[19];
-
-int ff_ac3_encode_init(AVCodecContext *avctx);
-
-int ff_ac3_encode_close(AVCodecContext *avctx);
-
-int ff_ac3_validate_metadata(AC3EncodeContext *s);
-
-void ff_ac3_adjust_frame_size(AC3EncodeContext *s);
-
-void ff_ac3_compute_coupling_strategy(AC3EncodeContext *s);
-
-void ff_ac3_apply_rematrixing(AC3EncodeContext *s);
-
-void ff_ac3_process_exponents(AC3EncodeContext *s);
-
-int ff_ac3_compute_bit_allocation(AC3EncodeContext *s);
-
-void ff_ac3_group_exponents(AC3EncodeContext *s);
-
-void ff_ac3_quantize_mantissas(AC3EncodeContext *s);
-
-void ff_ac3_output_frame(AC3EncodeContext *s, unsigned char *frame);
-
-
-/* prototypes for functions in ac3enc_fixed.c and ac3enc_float.c */
-
-void ff_ac3_fixed_mdct_end(AC3EncodeContext *s);
-void ff_ac3_float_mdct_end(AC3EncodeContext *s);
-
-int ff_ac3_fixed_mdct_init(AC3EncodeContext *s);
-int ff_ac3_float_mdct_init(AC3EncodeContext *s);
-
-
-/* prototypes for functions in ac3enc_template.c */
-
-int ff_ac3_fixed_allocate_sample_buffers(AC3EncodeContext *s);
-int ff_ac3_float_allocate_sample_buffers(AC3EncodeContext *s);
-
-int ff_ac3_fixed_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
- const AVFrame *frame, int *got_packet_ptr);
-int ff_ac3_float_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
- const AVFrame *frame, int *got_packet_ptr);
-
-#endif /* AVCODEC_AC3ENC_H */
diff --git a/libavcodec/ac3enc_fixed.c b/libavcodec/ac3enc_fixed.c
deleted file mode 100644
index b1f9c21..0000000
--- a/libavcodec/ac3enc_fixed.c
+++ b/dev/null
@@ -1,169 +0,0 @@
-/*
- * The simplest AC-3 encoder
- * Copyright (c) 2000 Fabrice Bellard
- * Copyright (c) 2006-2010 Justin Ruggles <justin.ruggles@gmail.com>
- * Copyright (c) 2006-2010 Prakash Punnoor <prakash@punnoor.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 Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * fixed-point AC-3 encoder.
- */
-
-#define CONFIG_FFT_FLOAT 0
-#undef CONFIG_AC3ENC_FLOAT
-#include "internal.h"
-#include "ac3enc.h"
-#include "eac3enc.h"
-
-#define AC3ENC_TYPE AC3ENC_TYPE_AC3_FIXED
-#include "ac3enc_opts_template.c"
-
-static const AVClass ac3enc_class = {
- .class_name = "Fixed-Point AC-3 Encoder",
- .item_name = av_default_item_name,
- .option = ac3_options,
- .version = LIBAVUTIL_VERSION_INT,
-};
-
-#include "ac3enc_template.c"
-
-
-/**
- * Finalize MDCT and free allocated memory.
- *
- * @param s AC-3 encoder private context
- */
-av_cold void AC3_NAME(mdct_end)(AC3EncodeContext *s)
-{
- ff_mdct_end(&s->mdct);
-}
-
-
-/**
- * Initialize MDCT tables.
- *
- * @param s AC-3 encoder private context
- * @return 0 on success, negative error code on failure
- */
-av_cold int AC3_NAME(mdct_init)(AC3EncodeContext *s)
-{
- int ret = ff_mdct_init(&s->mdct, 9, 0, -1.0);
- s->mdct_window = ff_ac3_window;
- return ret;
-}
-
-
-/*
- * Apply KBD window to input samples prior to MDCT.
- */
-static void apply_window(void *dsp, int16_t *output, const int16_t *input,
- const int16_t *window, unsigned int len)
-{
- DSPContext *dsp0 = dsp;
- dsp0->apply_window_int16(output, input, window, len);
-}
-
-
-/*
- * Normalize the input samples to use the maximum available precision.
- * This assumes signed 16-bit input samples.
- */
-static int normalize_samples(AC3EncodeContext *s)
-{
- int v = s->ac3dsp.ac3_max_msb_abs_int16(s->windowed_samples, AC3_WINDOW_SIZE);
- v = 14 - av_log2(v);
- if (v > 0)
- s->ac3dsp.ac3_lshift_int16(s->windowed_samples, AC3_WINDOW_SIZE, v);
- /* +6 to right-shift from 31-bit to 25-bit */
- return v + 6;
-}
-
-
-/*
- * Scale MDCT coefficients to 25-bit signed fixed-point.
- */
-static void scale_coefficients(AC3EncodeContext *s)
-{
- int blk, ch;
-
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- for (ch = 1; ch <= s->channels; ch++) {
- s->ac3dsp.ac3_rshift_int32(block->mdct_coef[ch], AC3_MAX_COEFS,
- block->coeff_shift[ch]);
- }
- }
-}
-
-static void sum_square_butterfly(AC3EncodeContext *s, int64_t sum[4],
- const int32_t *coef0, const int32_t *coef1,
- int len)
-{
- s->ac3dsp.sum_square_butterfly_int32(sum, coef0, coef1, len);
-}
-
-/*
- * Clip MDCT coefficients to allowable range.
- */
-static void clip_coefficients(DSPContext *dsp, int32_t *coef, unsigned int len)
-{
- dsp->vector_clip_int32(coef, coef, COEF_MIN, COEF_MAX, len);
-}
-
-
-/*
- * Calculate a single coupling coordinate.
- */
-static CoefType calc_cpl_coord(CoefSumType energy_ch, CoefSumType energy_cpl)
-{
- if (energy_cpl <= COEF_MAX) {
- return 1048576;
- } else {
- uint64_t coord = energy_ch / (energy_cpl >> 24);
- uint32_t coord32 = FFMIN(coord, 1073741824);
- coord32 = ff_sqrt(coord32) << 9;
- return FFMIN(coord32, COEF_MAX);
- }
-}
-
-
-static av_cold int ac3_fixed_encode_init(AVCodecContext *avctx)
-{
- AC3EncodeContext *s = avctx->priv_data;
- s->fixed_point = 1;
- return ff_ac3_encode_init(avctx);
-}
-
-
-AVCodec ff_ac3_fixed_encoder = {
- .name = "ac3_fixed",
- .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
- .type = AVMEDIA_TYPE_AUDIO,
- .id = AV_CODEC_ID_AC3,
- .priv_data_size = sizeof(AC3EncodeContext),
- .init = ac3_fixed_encode_init,
- .encode2 = ff_ac3_fixed_encode_frame,
- .close = ff_ac3_encode_close,
- .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16P,
- AV_SAMPLE_FMT_NONE },
- .priv_class = &ac3enc_class,
- .channel_layouts = ff_ac3_channel_layouts,
- .defaults = ac3_defaults,
-};
diff --git a/libavcodec/ac3enc_float.c b/libavcodec/ac3enc_float.c
deleted file mode 100644
index 532c56c..0000000
--- a/libavcodec/ac3enc_float.c
+++ b/dev/null
@@ -1,168 +0,0 @@
-/*
- * The simplest AC-3 encoder
- * Copyright (c) 2000 Fabrice Bellard
- * Copyright (c) 2006-2010 Justin Ruggles <justin.ruggles@gmail.com>
- * Copyright (c) 2006-2010 Prakash Punnoor <prakash@punnoor.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 Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * floating-point AC-3 encoder.
- */
-
-#define CONFIG_AC3ENC_FLOAT 1
-#include "internal.h"
-#include "ac3enc.h"
-#include "eac3enc.h"
-#include "kbdwin.h"
-
-
-#if CONFIG_AC3_ENCODER
-#define AC3ENC_TYPE AC3ENC_TYPE_AC3
-#include "ac3enc_opts_template.c"
-static const AVClass ac3enc_class = {
- .class_name = "AC-3 Encoder",
- .item_name = av_default_item_name,
- .option = ac3_options,
- .version = LIBAVUTIL_VERSION_INT,
-};
-#endif
-
-#include "ac3enc_template.c"
-
-
-/**
- * Finalize MDCT and free allocated memory.
- *
- * @param s AC-3 encoder private context
- */
-av_cold void ff_ac3_float_mdct_end(AC3EncodeContext *s)
-{
- ff_mdct_end(&s->mdct);
- av_freep(&s->mdct_window);
-}
-
-
-/**
- * Initialize MDCT tables.
- *
- * @param s AC-3 encoder private context
- * @return 0 on success, negative error code on failure
- */
-av_cold int ff_ac3_float_mdct_init(AC3EncodeContext *s)
-{
- float *window;
- int i, n, n2;
-
- n = 1 << 9;
- n2 = n >> 1;
-
- window = av_malloc(n * sizeof(*window));
- if (!window) {
- av_log(s->avctx, AV_LOG_ERROR, "Cannot allocate memory.\n");
- return AVERROR(ENOMEM);
- }
- ff_kbd_window_init(window, 5.0, n2);
- for (i = 0; i < n2; i++)
- window[n-1-i] = window[i];
- s->mdct_window = window;
-
- return ff_mdct_init(&s->mdct, 9, 0, -2.0 / n);
-}
-
-
-/*
- * Apply KBD window to input samples prior to MDCT.
- */
-static void apply_window(void *dsp, float *output,
- const float *input, const float *window,
- unsigned int len)
-{
- AVFloatDSPContext *fdsp = dsp;
- fdsp->vector_fmul(output, input, window, len);
-}
-
-
-/*
- * Normalize the input samples.
- * Not needed for the floating-point encoder.
- */
-static int normalize_samples(AC3EncodeContext *s)
-{
- return 0;
-}
-
-
-/*
- * Scale MDCT coefficients from float to 24-bit fixed-point.
- */
-static void scale_coefficients(AC3EncodeContext *s)
-{
- int chan_size = AC3_MAX_COEFS * s->num_blocks;
- int cpl = s->cpl_on;
- s->ac3dsp.float_to_fixed24(s->fixed_coef_buffer + (chan_size * !cpl),
- s->mdct_coef_buffer + (chan_size * !cpl),
- chan_size * (s->channels + cpl));
-}
-
-static void sum_square_butterfly(AC3EncodeContext *s, float sum[4],
- const float *coef0, const float *coef1,
- int len)
-{
- s->ac3dsp.sum_square_butterfly_float(sum, coef0, coef1, len);
-}
-
-/*
- * Clip MDCT coefficients to allowable range.
- */
-static void clip_coefficients(DSPContext *dsp, float *coef, unsigned int len)
-{
- dsp->vector_clipf(coef, coef, COEF_MIN, COEF_MAX, len);
-}
-
-
-/*
- * Calculate a single coupling coordinate.
- */
-static CoefType calc_cpl_coord(CoefSumType energy_ch, CoefSumType energy_cpl)
-{
- float coord = 0.125;
- if (energy_cpl > 0)
- coord *= sqrtf(energy_ch / energy_cpl);
- return FFMIN(coord, COEF_MAX);
-}
-
-
-#if CONFIG_AC3_ENCODER
-AVCodec ff_ac3_encoder = {
- .name = "ac3",
- .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
- .type = AVMEDIA_TYPE_AUDIO,
- .id = AV_CODEC_ID_AC3,
- .priv_data_size = sizeof(AC3EncodeContext),
- .init = ff_ac3_encode_init,
- .encode2 = ff_ac3_float_encode_frame,
- .close = ff_ac3_encode_close,
- .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
- AV_SAMPLE_FMT_NONE },
- .priv_class = &ac3enc_class,
- .channel_layouts = ff_ac3_channel_layouts,
- .defaults = ac3_defaults,
-};
-#endif
diff --git a/libavcodec/ac3enc_opts_template.c b/libavcodec/ac3enc_opts_template.c
deleted file mode 100644
index a252be9..0000000
--- a/libavcodec/ac3enc_opts_template.c
+++ b/dev/null
@@ -1,80 +0,0 @@
-/*
- * AC-3 encoder options
- * Copyright (c) 2011 Justin Ruggles <justin.ruggles@gmail.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
- */
-
-#include "libavutil/opt.h"
-#include "internal.h"
-#include "ac3.h"
-
-static const AVOption ac3_options[] = {
-/* Metadata Options */
-{"per_frame_metadata", "Allow Changing Metadata Per-Frame", OFFSET(allow_per_frame_metadata), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, AC3ENC_PARAM},
-#if AC3ENC_TYPE != AC3ENC_TYPE_EAC3
-/* AC-3 downmix levels */
-{"center_mixlev", "Center Mix Level", OFFSET(center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = LEVEL_MINUS_4POINT5DB }, 0.0, 1.0, AC3ENC_PARAM},
-{"surround_mixlev", "Surround Mix Level", OFFSET(surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = LEVEL_MINUS_6DB }, 0.0, 1.0, AC3ENC_PARAM},
-#endif
-/* audio production information */
-{"mixing_level", "Mixing Level", OFFSET(mixing_level), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 111, AC3ENC_PARAM},
-{"room_type", "Room Type", OFFSET(room_type), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_SMALL_ROOM, AC3ENC_PARAM, "room_type"},
- {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"},
- {"large", "Large Room", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_LARGE_ROOM }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"},
- {"small", "Small Room", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_SMALL_ROOM }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"},
-/* other metadata options */
-{"copyright", "Copyright Bit", OFFSET(copyright), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 1, AC3ENC_PARAM},
-{"dialnorm", "Dialogue Level (dB)", OFFSET(dialogue_level), AV_OPT_TYPE_INT, {.i64 = -31 }, -31, -1, AC3ENC_PARAM},
-{"dsur_mode", "Dolby Surround Mode", OFFSET(dolby_surround_mode), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_ON, AC3ENC_PARAM, "dsur_mode"},
- {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"},
- {"on", "Dolby Surround Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"},
- {"off", "Not Dolby Surround Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"},
-{"original", "Original Bit Stream", OFFSET(original), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 1, AC3ENC_PARAM},
-/* extended bitstream information */
-{"dmix_mode", "Preferred Stereo Downmix Mode", OFFSET(preferred_stereo_downmix), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_DOWNMIX_LORO, AC3ENC_PARAM, "dmix_mode"},
- {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"},
- {"ltrt", "Lt/Rt Downmix Preferred", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DOWNMIX_LTRT }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"},
- {"loro", "Lo/Ro Downmix Preferred", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DOWNMIX_LORO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"},
-{"ltrt_cmixlev", "Lt/Rt Center Mix Level", OFFSET(ltrt_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM},
-{"ltrt_surmixlev", "Lt/Rt Surround Mix Level", OFFSET(ltrt_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM},
-{"loro_cmixlev", "Lo/Ro Center Mix Level", OFFSET(loro_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM},
-{"loro_surmixlev", "Lo/Ro Surround Mix Level", OFFSET(loro_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM},
-{"dsurex_mode", "Dolby Surround EX Mode", OFFSET(dolby_surround_ex_mode), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_ON, AC3ENC_PARAM, "dsurex_mode"},
- {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"},
- {"on", "Dolby Surround EX Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"},
- {"off", "Not Dolby Surround EX Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"},
-{"dheadphone_mode", "Dolby Headphone Mode", OFFSET(dolby_headphone_mode), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_ON, AC3ENC_PARAM, "dheadphone_mode"},
- {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"},
- {"on", "Dolby Headphone Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"},
- {"off", "Not Dolby Headphone Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"},
-{"ad_conv_type", "A/D Converter Type", OFFSET(ad_converter_type), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_ADCONV_HDCD, AC3ENC_PARAM, "ad_conv_type"},
- {"standard", "Standard (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_ADCONV_STANDARD }, INT_MIN, INT_MAX, AC3ENC_PARAM, "ad_conv_type"},
- {"hdcd", "HDCD", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_ADCONV_HDCD }, INT_MIN, INT_MAX, AC3ENC_PARAM, "ad_conv_type"},
-/* Other Encoding Options */
-{"stereo_rematrixing", "Stereo Rematrixing", OFFSET(stereo_rematrixing), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_ON }, AC3ENC_OPT_OFF, AC3ENC_OPT_ON, AC3ENC_PARAM},
-{"channel_coupling", "Channel Coupling", OFFSET(channel_coupling), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_AUTO }, AC3ENC_OPT_AUTO, AC3ENC_OPT_ON, AC3ENC_PARAM, "channel_coupling"},
- {"auto", "Selected by the Encoder", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_AUTO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "channel_coupling"},
-{"cpl_start_band", "Coupling Start Band", OFFSET(cpl_start), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_AUTO }, AC3ENC_OPT_AUTO, 15, AC3ENC_PARAM, "cpl_start_band"},
- {"auto", "Selected by the Encoder", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_AUTO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "cpl_start_band"},
-{NULL}
-};
-
-static const AVCodecDefault ac3_defaults[] = {
- { "b", "0" },
- { NULL }
-};
diff --git a/libavcodec/ac3enc_template.c b/libavcodec/ac3enc_template.c
deleted file mode 100644
index 354be53..0000000
--- a/libavcodec/ac3enc_template.c
+++ b/dev/null
@@ -1,447 +0,0 @@
-/*
- * AC-3 encoder float/fixed template
- * Copyright (c) 2000 Fabrice Bellard
- * Copyright (c) 2006-2011 Justin Ruggles <justin.ruggles@gmail.com>
- * Copyright (c) 2006-2010 Prakash Punnoor <prakash@punnoor.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 Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AC-3 encoder float/fixed template
- */
-
-#include <stdint.h>
-
-#include "libavutil/internal.h"
-
-/* prototypes for static functions in ac3enc_fixed.c and ac3enc_float.c */
-
-static void scale_coefficients(AC3EncodeContext *s);
-
-static void apply_window(void *dsp, SampleType *output,
- const SampleType *input, const SampleType *window,
- unsigned int len);
-
-static int normalize_samples(AC3EncodeContext *s);
-
-static void clip_coefficients(DSPContext *dsp, CoefType *coef, unsigned int len);
-
-static CoefType calc_cpl_coord(CoefSumType energy_ch, CoefSumType energy_cpl);
-
-static void sum_square_butterfly(AC3EncodeContext *s, CoefSumType sum[4],
- const CoefType *coef0, const CoefType *coef1,
- int len);
-
-int AC3_NAME(allocate_sample_buffers)(AC3EncodeContext *s)
-{
- int ch;
-
- FF_ALLOC_OR_GOTO(s->avctx, s->windowed_samples, AC3_WINDOW_SIZE *
- sizeof(*s->windowed_samples), alloc_fail);
- FF_ALLOC_OR_GOTO(s->avctx, s->planar_samples, s->channels * sizeof(*s->planar_samples),
- alloc_fail);
- for (ch = 0; ch < s->channels; ch++) {
- FF_ALLOCZ_OR_GOTO(s->avctx, s->planar_samples[ch],
- (AC3_FRAME_SIZE+AC3_BLOCK_SIZE) * sizeof(**s->planar_samples),
- alloc_fail);
- }
-
- return 0;
-alloc_fail:
- return AVERROR(ENOMEM);
-}
-
-
-/*
- * Copy input samples.
- * Channels are reordered from FFmpeg's default order to AC-3 order.
- */
-static void copy_input_samples(AC3EncodeContext *s, SampleType **samples)
-{
- int ch;
-
- /* copy and remap input samples */
- for (ch = 0; ch < s->channels; ch++) {
- /* copy last 256 samples of previous frame to the start of the current frame */
- memcpy(&s->planar_samples[ch][0], &s->planar_samples[ch][AC3_BLOCK_SIZE * s->num_blocks],
- AC3_BLOCK_SIZE * sizeof(s->planar_samples[0][0]));
-
- /* copy new samples for current frame */
- memcpy(&s->planar_samples[ch][AC3_BLOCK_SIZE],
- samples[s->channel_map[ch]],
- AC3_BLOCK_SIZE * s->num_blocks * sizeof(s->planar_samples[0][0]));
- }
-}
-
-
-/*
- * Apply the MDCT to input samples to generate frequency coefficients.
- * This applies the KBD window and normalizes the input to reduce precision
- * loss due to fixed-point calculations.
- */
-static void apply_mdct(AC3EncodeContext *s)
-{
- int blk, ch;
-
- for (ch = 0; ch < s->channels; ch++) {
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- const SampleType *input_samples = &s->planar_samples[ch][blk * AC3_BLOCK_SIZE];
-
-#if CONFIG_AC3ENC_FLOAT
- apply_window(&s->fdsp, s->windowed_samples, input_samples,
- s->mdct_window, AC3_WINDOW_SIZE);
-#else
- apply_window(&s->dsp, s->windowed_samples, input_samples,
- s->mdct_window, AC3_WINDOW_SIZE);
-#endif
-
- if (s->fixed_point)
- block->coeff_shift[ch+1] = normalize_samples(s);
-
- s->mdct.mdct_calcw(&s->mdct, block->mdct_coef[ch+1],
- s->windowed_samples);
- }
- }
-}
-
-
-/*
- * Calculate coupling channel and coupling coordinates.
- */
-static void apply_channel_coupling(AC3EncodeContext *s)
-{
- LOCAL_ALIGNED_16(CoefType, cpl_coords, [AC3_MAX_BLOCKS], [AC3_MAX_CHANNELS][16]);
-#if CONFIG_AC3ENC_FLOAT
- LOCAL_ALIGNED_16(int32_t, fixed_cpl_coords, [AC3_MAX_BLOCKS], [AC3_MAX_CHANNELS][16]);
-#else
- int32_t (*fixed_cpl_coords)[AC3_MAX_CHANNELS][16] = cpl_coords;
-#endif
- int av_uninit(blk), ch, bnd, i, j;
- CoefSumType energy[AC3_MAX_BLOCKS][AC3_MAX_CHANNELS][16] = {{{0}}};
- int cpl_start, num_cpl_coefs;
-
- memset(cpl_coords, 0, AC3_MAX_BLOCKS * sizeof(*cpl_coords));
-#if CONFIG_AC3ENC_FLOAT
- memset(fixed_cpl_coords, 0, AC3_MAX_BLOCKS * sizeof(*cpl_coords));
-#endif
-
- /* align start to 16-byte boundary. align length to multiple of 32.
- note: coupling start bin % 4 will always be 1 */
- cpl_start = s->start_freq[CPL_CH] - 1;
- num_cpl_coefs = FFALIGN(s->num_cpl_subbands * 12 + 1, 32);
- cpl_start = FFMIN(256, cpl_start + num_cpl_coefs) - num_cpl_coefs;
-
- /* calculate coupling channel from fbw channels */
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- CoefType *cpl_coef = &block->mdct_coef[CPL_CH][cpl_start];
- if (!block->cpl_in_use)
- continue;
- memset(cpl_coef, 0, num_cpl_coefs * sizeof(*cpl_coef));
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- CoefType *ch_coef = &block->mdct_coef[ch][cpl_start];
- if (!block->channel_in_cpl[ch])
- continue;
- for (i = 0; i < num_cpl_coefs; i++)
- cpl_coef[i] += ch_coef[i];
- }
-
- /* coefficients must be clipped in order to be encoded */
- clip_coefficients(&s->dsp, cpl_coef, num_cpl_coefs);
- }
-
- /* calculate energy in each band in coupling channel and each fbw channel */
- /* TODO: possibly use SIMD to speed up energy calculation */
- bnd = 0;
- i = s->start_freq[CPL_CH];
- while (i < s->cpl_end_freq) {
- int band_size = s->cpl_band_sizes[bnd];
- for (ch = CPL_CH; ch <= s->fbw_channels; ch++) {
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- if (!block->cpl_in_use || (ch > CPL_CH && !block->channel_in_cpl[ch]))
- continue;
- for (j = 0; j < band_size; j++) {
- CoefType v = block->mdct_coef[ch][i+j];
- MAC_COEF(energy[blk][ch][bnd], v, v);
- }
- }
- }
- i += band_size;
- bnd++;
- }
-
- /* calculate coupling coordinates for all blocks for all channels */
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- if (!block->cpl_in_use)
- continue;
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- if (!block->channel_in_cpl[ch])
- continue;
- for (bnd = 0; bnd < s->num_cpl_bands; bnd++) {
- cpl_coords[blk][ch][bnd] = calc_cpl_coord(energy[blk][ch][bnd],
- energy[blk][CPL_CH][bnd]);
- }
- }
- }
-
- /* determine which blocks to send new coupling coordinates for */
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- AC3Block *block0 = blk ? &s->blocks[blk-1] : NULL;
-
- memset(block->new_cpl_coords, 0, sizeof(block->new_cpl_coords));
-
- if (block->cpl_in_use) {
- /* send new coordinates if this is the first block, if previous
- * block did not use coupling but this block does, the channels
- * using coupling has changed from the previous block, or the
- * coordinate difference from the last block for any channel is
- * greater than a threshold value. */
- if (blk == 0 || !block0->cpl_in_use) {
- for (ch = 1; ch <= s->fbw_channels; ch++)
- block->new_cpl_coords[ch] = 1;
- } else {
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- if (!block->channel_in_cpl[ch])
- continue;
- if (!block0->channel_in_cpl[ch]) {
- block->new_cpl_coords[ch] = 1;
- } else {
- CoefSumType coord_diff = 0;
- for (bnd = 0; bnd < s->num_cpl_bands; bnd++) {
- coord_diff += FFABS(cpl_coords[blk-1][ch][bnd] -
- cpl_coords[blk ][ch][bnd]);
- }
- coord_diff /= s->num_cpl_bands;
- if (coord_diff > NEW_CPL_COORD_THRESHOLD)
- block->new_cpl_coords[ch] = 1;
- }
- }
- }
- }
- }
-
- /* calculate final coupling coordinates, taking into account reusing of
- coordinates in successive blocks */
- for (bnd = 0; bnd < s->num_cpl_bands; bnd++) {
- blk = 0;
- while (blk < s->num_blocks) {
- int av_uninit(blk1);
- AC3Block *block = &s->blocks[blk];
-
- if (!block->cpl_in_use) {
- blk++;
- continue;
- }
-
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- CoefSumType energy_ch, energy_cpl;
- if (!block->channel_in_cpl[ch])
- continue;
- energy_cpl = energy[blk][CPL_CH][bnd];
- energy_ch = energy[blk][ch][bnd];
- blk1 = blk+1;
- while (!s->blocks[blk1].new_cpl_coords[ch] && blk1 < s->num_blocks) {
- if (s->blocks[blk1].cpl_in_use) {
- energy_cpl += energy[blk1][CPL_CH][bnd];
- energy_ch += energy[blk1][ch][bnd];
- }
- blk1++;
- }
- cpl_coords[blk][ch][bnd] = calc_cpl_coord(energy_ch, energy_cpl);
- }
- blk = blk1;
- }
- }
-
- /* calculate exponents/mantissas for coupling coordinates */
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- if (!block->cpl_in_use)
- continue;
-
-#if CONFIG_AC3ENC_FLOAT
- s->ac3dsp.float_to_fixed24(fixed_cpl_coords[blk][1],
- cpl_coords[blk][1],
- s->fbw_channels * 16);
-#endif
- s->ac3dsp.extract_exponents(block->cpl_coord_exp[1],
- fixed_cpl_coords[blk][1],
- s->fbw_channels * 16);
-
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- int bnd, min_exp, max_exp, master_exp;
-
- if (!block->new_cpl_coords[ch])
- continue;
-
- /* determine master exponent */
- min_exp = max_exp = block->cpl_coord_exp[ch][0];
- for (bnd = 1; bnd < s->num_cpl_bands; bnd++) {
- int exp = block->cpl_coord_exp[ch][bnd];
- min_exp = FFMIN(exp, min_exp);
- max_exp = FFMAX(exp, max_exp);
- }
- master_exp = ((max_exp - 15) + 2) / 3;
- master_exp = FFMAX(master_exp, 0);
- while (min_exp < master_exp * 3)
- master_exp--;
- for (bnd = 0; bnd < s->num_cpl_bands; bnd++) {
- block->cpl_coord_exp[ch][bnd] = av_clip(block->cpl_coord_exp[ch][bnd] -
- master_exp * 3, 0, 15);
- }
- block->cpl_master_exp[ch] = master_exp;
-
- /* quantize mantissas */
- for (bnd = 0; bnd < s->num_cpl_bands; bnd++) {
- int cpl_exp = block->cpl_coord_exp[ch][bnd];
- int cpl_mant = (fixed_cpl_coords[blk][ch][bnd] << (5 + cpl_exp + master_exp * 3)) >> 24;
- if (cpl_exp == 15)
- cpl_mant >>= 1;
- else
- cpl_mant -= 16;
-
- block->cpl_coord_mant[ch][bnd] = cpl_mant;
- }
- }
- }
-
- if (CONFIG_EAC3_ENCODER && s->eac3)
- ff_eac3_set_cpl_states(s);
-}
-
-
-/*
- * Determine rematrixing flags for each block and band.
- */
-static void compute_rematrixing_strategy(AC3EncodeContext *s)
-{
- int nb_coefs;
- int blk, bnd;
- AC3Block *block, *block0 = NULL;
-
- if (s->channel_mode != AC3_CHMODE_STEREO)
- return;
-
- for (blk = 0; blk < s->num_blocks; blk++) {
- block = &s->blocks[blk];
- block->new_rematrixing_strategy = !blk;
-
- block->num_rematrixing_bands = 4;
- if (block->cpl_in_use) {
- block->num_rematrixing_bands -= (s->start_freq[CPL_CH] <= 61);
- block->num_rematrixing_bands -= (s->start_freq[CPL_CH] == 37);
- if (blk && block->num_rematrixing_bands != block0->num_rematrixing_bands)
- block->new_rematrixing_strategy = 1;
- }
- nb_coefs = FFMIN(block->end_freq[1], block->end_freq[2]);
-
- if (!s->rematrixing_enabled) {
- block0 = block;
- continue;
- }
-
- for (bnd = 0; bnd < block->num_rematrixing_bands; bnd++) {
- /* calculate sum of squared coeffs for one band in one block */
- int start = ff_ac3_rematrix_band_tab[bnd];
- int end = FFMIN(nb_coefs, ff_ac3_rematrix_band_tab[bnd+1]);
- CoefSumType sum[4];
- sum_square_butterfly(s, sum, block->mdct_coef[1] + start,
- block->mdct_coef[2] + start, end - start);
-
- /* compare sums to determine if rematrixing will be used for this band */
- if (FFMIN(sum[2], sum[3]) < FFMIN(sum[0], sum[1]))
- block->rematrixing_flags[bnd] = 1;
- else
- block->rematrixing_flags[bnd] = 0;
-
- /* determine if new rematrixing flags will be sent */
- if (blk &&
- block->rematrixing_flags[bnd] != block0->rematrixing_flags[bnd]) {
- block->new_rematrixing_strategy = 1;
- }
- }
- block0 = block;
- }
-}
-
-
-int AC3_NAME(encode_frame)(AVCodecContext *avctx, AVPacket *avpkt,
- const AVFrame *frame, int *got_packet_ptr)
-{
- AC3EncodeContext *s = avctx->priv_data;
- int ret;
-
- if (s->options.allow_per_frame_metadata) {
- ret = ff_ac3_validate_metadata(s);
- if (ret)
- return ret;
- }
-
- if (s->bit_alloc.sr_code == 1 || s->eac3)
- ff_ac3_adjust_frame_size(s);
-
- copy_input_samples(s, (SampleType **)frame->extended_data);
-
- apply_mdct(s);
-
- if (s->fixed_point)
- scale_coefficients(s);
-
- clip_coefficients(&s->dsp, s->blocks[0].mdct_coef[1],
- AC3_MAX_COEFS * s->num_blocks * s->channels);
-
- s->cpl_on = s->cpl_enabled;
- ff_ac3_compute_coupling_strategy(s);
-
- if (s->cpl_on)
- apply_channel_coupling(s);
-
- compute_rematrixing_strategy(s);
-
- if (!s->fixed_point)
- scale_coefficients(s);
-
- ff_ac3_apply_rematrixing(s);
-
- ff_ac3_process_exponents(s);
-
- ret = ff_ac3_compute_bit_allocation(s);
- if (ret) {
- av_log(avctx, AV_LOG_ERROR, "Bit allocation failed. Try increasing the bitrate.\n");
- return ret;
- }
-
- ff_ac3_group_exponents(s);
-
- ff_ac3_quantize_mantissas(s);
-
- if ((ret = ff_alloc_packet2(avctx, avpkt, s->frame_size)) < 0)
- return ret;
- ff_ac3_output_frame(s, avpkt->data);
-
- if (frame->pts != AV_NOPTS_VALUE)
- avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);
-
- *got_packet_ptr = 1;
- return 0;
-}
diff --git a/libavcodec/arm/ac3dsp_arm.S b/libavcodec/arm/ac3dsp_arm.S
deleted file mode 100644
index 1aea190..0000000
--- a/libavcodec/arm/ac3dsp_arm.S
+++ b/dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2011 Mans Rullgard <mans@mansr.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
- */
-
-#include "libavutil/arm/asm.S"
-
-function ff_ac3_update_bap_counts_arm, export=1
- push {lr}
- ldrb lr, [r1], #1
-1:
- lsl r3, lr, #1
- ldrh r12, [r0, r3]
- subs r2, r2, #1
- it gt
- ldrbgt lr, [r1], #1
- add r12, r12, #1
- strh r12, [r0, r3]
- bgt 1b
- pop {pc}
-endfunc
diff --git a/libavcodec/arm/ac3dsp_armv6.S b/libavcodec/arm/ac3dsp_armv6.S
deleted file mode 100644
index 1d2563d..0000000
--- a/libavcodec/arm/ac3dsp_armv6.S
+++ b/dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2011 Mans Rullgard <mans@mansr.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
- */
-
-#include "libavutil/arm/asm.S"
-
-function ff_ac3_bit_alloc_calc_bap_armv6, export=1
- ldr r12, [sp]
- cmp r12, #-960
- beq 4f
- push {r4-r11,lr}
- add r5, sp, #40
- movrelx r4, X(ff_ac3_bin_to_band_tab), r11
- movrelx lr, X(ff_ac3_band_start_tab)
- ldm r5, {r5-r7}
- ldrb r4, [r4, r2]
- add r1, r1, r2, lsl #1 @ psd + start
- add r0, r0, r4, lsl #1 @ mask + band
- add r4, r4, lr
- add r7, r7, r2 @ bap + start
-1:
- ldrsh r9, [r0], #2 @ mask[band]
- mov r8, #0xff0
- sub r9, r9, r12 @ - snr_offset
- ldrb r10, [r4, #1]! @ band_start_tab[++band]
- subs r9, r9, r5 @ - floor
- it lt
- movlt r9, #0
- cmp r10, r3 @ - end
- and r9, r9, r8, lsl #1 @ & 0x1fe0
- ite gt
- subgt r8, r3, r2
- suble r8, r10, r2
- mov r2, r10
- add r9, r9, r5 @ + floor => m
- tst r8, #1
- add r11, r7, r8
- bne 3f
- b 5f
-2:
- ldrsh r8, [r1], #2
- ldrsh lr, [r1], #2
- sub r8, r8, r9
- sub lr, lr, r9
- usat r8, #6, r8, asr #5 @ address
- usat lr, #6, lr, asr #5
- ldrb r8, [r6, r8] @ bap_tab[address]
- ldrb lr, [r6, lr]
- strb r8, [r7], #1 @ bap[bin]
- strb lr, [r7], #1
-5: cmp r7, r11
- blo 2b
- cmp r3, r10
- bgt 1b
- pop {r4-r11,pc}
-3:
- ldrsh r8, [r1], #2 @ psd[bin]
- sub r8, r8, r9 @ - m
- usat r8, #6, r8, asr #5 @ address
- ldrb r8, [r6, r8] @ bap_tab[address]
- strb r8, [r7], #1 @ bap[bin]
- b 5b
-4:
- ldr r0, [sp, #12]
- mov r1, #0
- mov r2, #256
- b X(memset)
-endfunc
diff --git a/libavcodec/arm/ac3dsp_init_arm.c b/libavcodec/arm/ac3dsp_init_arm.c
deleted file mode 100644
index ffe0747..0000000
--- a/libavcodec/arm/ac3dsp_init_arm.c
+++ b/dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2011 Mans Rullgard <mans@mansr.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
- */
-
-#include <stdint.h>
-
-#include "libavutil/arm/cpu.h"
-#include "libavutil/attributes.h"
-#include "libavcodec/ac3dsp.h"
-#include "config.h"
-
-void ff_ac3_exponent_min_neon(uint8_t *exp, int num_reuse_blocks, int nb_coefs);
-int ff_ac3_max_msb_abs_int16_neon(const int16_t *src, int len);
-void ff_ac3_lshift_int16_neon(int16_t *src, unsigned len, unsigned shift);
-void ff_ac3_rshift_int32_neon(int32_t *src, unsigned len, unsigned shift);
-void ff_float_to_fixed24_neon(int32_t *dst, const float *src, unsigned int len);
-void ff_ac3_extract_exponents_neon(uint8_t *exp, int32_t *coef, int nb_coefs);
-void ff_ac3_sum_square_butterfly_int32_neon(int64_t sum[4],
- const int32_t *coef0,
- const int32_t *coef1,
- int len);
-void ff_ac3_sum_square_butterfly_float_neon(float sum[4],
- const float *coef0,
- const float *coef1,
- int len);
-
-void ff_ac3_bit_alloc_calc_bap_armv6(int16_t *mask, int16_t *psd,
- int start, int end,
- int snr_offset, int floor,
- const uint8_t *bap_tab, uint8_t *bap);
-
-void ff_ac3_update_bap_counts_arm(uint16_t mant_cnt[16], uint8_t *bap, int len);
-
-av_cold void ff_ac3dsp_init_arm(AC3DSPContext *c, int bit_exact)
-{
- int cpu_flags = av_get_cpu_flags();
-
- c->update_bap_counts = ff_ac3_update_bap_counts_arm;
-
- if (have_armv6(cpu_flags)) {
- c->bit_alloc_calc_bap = ff_ac3_bit_alloc_calc_bap_armv6;
- }
-
- if (have_neon(cpu_flags)) {
- c->ac3_exponent_min = ff_ac3_exponent_min_neon;
- c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_neon;
- c->ac3_lshift_int16 = ff_ac3_lshift_int16_neon;
- c->ac3_rshift_int32 = ff_ac3_rshift_int32_neon;
- c->float_to_fixed24 = ff_float_to_fixed24_neon;
- c->extract_exponents = ff_ac3_extract_exponents_neon;
- c->sum_square_butterfly_int32 = ff_ac3_sum_square_butterfly_int32_neon;
- c->sum_square_butterfly_float = ff_ac3_sum_square_butterfly_float_neon;
- }
-}
diff --git a/libavcodec/arm/ac3dsp_neon.S b/libavcodec/arm/ac3dsp_neon.S
deleted file mode 100644
index 381f158..0000000
--- a/libavcodec/arm/ac3dsp_neon.S
+++ b/dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (c) 2011 Mans Rullgard <mans@mansr.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
- */
-
-#include "libavutil/arm/asm.S"
-
-function ff_ac3_max_msb_abs_int16_neon, export=1
- vmov.i16 q0, #0
- vmov.i16 q2, #0
-1: vld1.16 {q1}, [r0,:128]!
- vabs.s16 q1, q1
- vld1.16 {q3}, [r0,:128]!
- vabs.s16 q3, q3
- vorr q0, q0, q1
- vorr q2, q2, q3
- subs r1, r1, #16
- bgt 1b
- vorr q0, q0, q2
- vorr d0, d0, d1
- vpmax.u16 d0, d0, d0
- vpmax.u16 d0, d0, d0
- vmov.u16 r0, d0[0]
- bx lr
-endfunc
-
-function ff_ac3_exponent_min_neon, export=1
- cmp r1, #0
- it eq
- bxeq lr
- push {lr}
- mov r12, #256
-1:
- vld1.8 {q0}, [r0,:128]
- mov lr, r1
- add r3, r0, #256
-2: vld1.8 {q1}, [r3,:128], r12
- subs lr, lr, #1
- vmin.u8 q0, q0, q1
- bgt 2b
- subs r2, r2, #16
- vst1.8 {q0}, [r0,:128]!
- bgt 1b
- pop {pc}
-endfunc
-
-function ff_ac3_lshift_int16_neon, export=1
- vdup.16 q0, r2
-1: vld1.16 {q1}, [r0,:128]
- vshl.s16 q1, q1, q0
- vst1.16 {q1}, [r0,:128]!
- subs r1, r1, #8
- bgt 1b
- bx lr
-endfunc
-
-function ff_ac3_rshift_int32_neon, export=1
- rsb r2, r2, #0
- vdup.32 q0, r2
-1: vld1.32 {q1}, [r0,:128]
- vshl.s32 q1, q1, q0
- vst1.32 {q1}, [r0,:128]!
- subs r1, r1, #4
- bgt 1b
- bx lr
-endfunc
-
-function ff_float_to_fixed24_neon, export=1
-1: vld1.32 {q0-q1}, [r1,:128]!
- vcvt.s32.f32 q0, q0, #24
- vld1.32 {q2-q3}, [r1,:128]!
- vcvt.s32.f32 q1, q1, #24
- vcvt.s32.f32 q2, q2, #24
- vst1.32 {q0-q1}, [r0,:128]!
- vcvt.s32.f32 q3, q3, #24
- vst1.32 {q2-q3}, [r0,:128]!
- subs r2, r2, #16
- bgt 1b
- bx lr
-endfunc
-
-function ff_ac3_extract_exponents_neon, export=1
- vmov.i32 q15, #8
-1:
- vld1.32 {q0}, [r1,:128]!
- vabs.s32 q1, q0
- vclz.i32 q3, q1
- vsub.i32 q3, q3, q15
- vmovn.i32 d6, q3
- vmovn.i16 d6, q3
- vst1.32 {d6[0]}, [r0,:32]!
- subs r2, r2, #4
- bgt 1b
- bx lr
-endfunc
-
-function ff_ac3_sum_square_butterfly_int32_neon, export=1
- vmov.i64 q0, #0
- vmov.i64 q1, #0
- vmov.i64 q2, #0
- vmov.i64 q3, #0
-1:
- vld1.32 {d16}, [r1]!
- vld1.32 {d17}, [r2]!
- vadd.s32 d18, d16, d17
- vsub.s32 d19, d16, d17
- vmlal.s32 q0, d16, d16
- vmlal.s32 q1, d17, d17
- vmlal.s32 q2, d18, d18
- vmlal.s32 q3, d19, d19
- subs r3, r3, #2
- bgt 1b
- vadd.s64 d0, d0, d1
- vadd.s64 d1, d2, d3
- vadd.s64 d2, d4, d5
- vadd.s64 d3, d6, d7
- vst1.64 {q0-q1}, [r0]
- bx lr
-endfunc
-
-function ff_ac3_sum_square_butterfly_float_neon, export=1
- vmov.f32 q0, #0.0
- vmov.f32 q1, #0.0
-1:
- vld1.32 {d16}, [r1]!
- vld1.32 {d17}, [r2]!
- vadd.f32 d18, d16, d17
- vsub.f32 d19, d16, d17
- vmla.f32 d0, d16, d16
- vmla.f32 d1, d17, d17
- vmla.f32 d2, d18, d18
- vmla.f32 d3, d19, d19
- subs r3, r3, #2
- bgt 1b
- vpadd.f32 d0, d0, d1
- vpadd.f32 d1, d2, d3
- vst1.32 {q0}, [r0]
- bx lr
-endfunc
diff --git a/libavcodec/arm/dca.h b/libavcodec/arm/dca.h
deleted file mode 100644
index 35971a8..0000000
--- a/libavcodec/arm/dca.h
+++ b/dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2011 Mans Rullgard <mans@mansr.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
- */
-
-#ifndef AVCODEC_ARM_DCA_H
-#define AVCODEC_ARM_DCA_H
-
-#include <stdint.h>
-
-#include "config.h"
-#include "libavcodec/mathops.h"
-
-#if HAVE_ARMV6_INLINE && AV_GCC_VERSION_AT_LEAST(4,4) && !CONFIG_THUMB
-
-#define decode_blockcodes decode_blockcodes
-static inline int decode_blockcodes(int code1, int code2, int levels,
- int32_t *values)
-{
- int32_t v0, v1, v2, v3, v4, v5;
-
- __asm__ ("smmul %0, %6, %10 \n"
- "smmul %3, %7, %10 \n"
- "smlabb %6, %0, %9, %6 \n"
- "smlabb %7, %3, %9, %7 \n"
- "smmul %1, %0, %10 \n"
- "smmul %4, %3, %10 \n"
- "sub %6, %6, %8, lsr #1 \n"
- "sub %7, %7, %8, lsr #1 \n"
- "smlabb %0, %1, %9, %0 \n"
- "smlabb %3, %4, %9, %3 \n"
- "smmul %2, %1, %10 \n"
- "smmul %5, %4, %10 \n"
- "str %6, [%11, #0] \n"
- "str %7, [%11, #16] \n"
- "sub %0, %0, %8, lsr #1 \n"
- "sub %3, %3, %8, lsr #1 \n"
- "smlabb %1, %2, %9, %1 \n"
- "smlabb %4, %5, %9, %4 \n"
- "smmul %6, %2, %10 \n"
- "smmul %7, %5, %10 \n"
- "str %0, [%11, #4] \n"
- "str %3, [%11, #20] \n"
- "sub %1, %1, %8, lsr #1 \n"
- "sub %4, %4, %8, lsr #1 \n"
- "smlabb %2, %6, %9, %2 \n"
- "smlabb %5, %7, %9, %5 \n"
- "str %1, [%11, #8] \n"
- "str %4, [%11, #24] \n"
- "sub %2, %2, %8, lsr #1 \n"
- "sub %5, %5, %8, lsr #1 \n"
- "str %2, [%11, #12] \n"
- "str %5, [%11, #28] \n"
- : "=&r"(v0), "=&r"(v1), "=&r"(v2),
- "=&r"(v3), "=&r"(v4), "=&r"(v5),
- "+&r"(code1), "+&r"(code2)
- : "r"(levels - 1), "r"(-levels),
- "r"(ff_inverse[levels]), "r"(values)
- : "memory");
-
- return code1 | code2;
-}
-
-#endif
-
-#if HAVE_NEON_INLINE && HAVE_ASM_MOD_Y
-
-#define int8x8_fmul_int32 int8x8_fmul_int32
-static inline void int8x8_fmul_int32(float *dst, const int8_t *src, int scale)
-{
- __asm__ ("vcvt.f32.s32 %2, %2, #4 \n"
- "vld1.8 {d0}, [%1,:64] \n"
- "vmovl.s8 q0, d0 \n"
- "vmovl.s16 q1, d1 \n"
- "vmovl.s16 q0, d0 \n"
- "vcvt.f32.s32 q0, q0 \n"
- "vcvt.f32.s32 q1, q1 \n"
- "vmul.f32 q0, q0, %y2 \n"
- "vmul.f32 q1, q1, %y2 \n"
- "vst1.32 {q0-q1}, [%m0,:128] \n"
- : "=Um"(*(float (*)[8])dst)
- : "r"(src), "x"(scale)
- : "d0", "d1", "d2", "d3");
-}
-
-#endif
-
-#endif /* AVCODEC_ARM_DCA_H */
diff --git a/libavcodec/arm/dcadsp_init_arm.c b/libavcodec/arm/dcadsp_init_arm.c
deleted file mode 100644
index 8893f48..0000000
--- a/libavcodec/arm/dcadsp_init_arm.c
+++ b/dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2010 Mans Rullgard <mans@mansr.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
- */
-
-#include "config.h"
-
-#include "libavutil/arm/cpu.h"
-#include "libavutil/attributes.h"
-#include "libavcodec/dcadsp.h"
-
-void ff_dca_lfe_fir_vfp(float *out, const float *in, const float *coefs,
- int decifactor, float scale);
-void ff_dca_qmf_32_subbands_vfp(float samples_in[32][8], int sb_act,
- SynthFilterContext *synth, FFTContext *imdct,
- float synth_buf_ptr[512],
- int *synth_buf_offset, float synth_buf2[32],
- const float window[512], float *samples_out,
- float raXin[32], float scale);
-void ff_dca_lfe_fir_neon(float *out, const float *in, const float *coefs,
- int decifactor, float scale);
-
-void ff_synth_filter_float_vfp(FFTContext *imdct,
- float *synth_buf_ptr, int *synth_buf_offset,
- float synth_buf2[32], const float window[512],
- float out[32], const float in[32],
- float scale);
-
-void ff_synth_filter_float_neon(FFTContext *imdct,
- float *synth_buf_ptr, int *synth_buf_offset,
- float synth_buf2[32], const float window[512],
- float out[32], const float in[32],
- float scale);
-
-av_cold void ff_dcadsp_init_arm(DCADSPContext *s)
-{
- int cpu_flags = av_get_cpu_flags();
-
- if (have_vfp(cpu_flags) && !have_vfpv3(cpu_flags)) {
- s->lfe_fir = ff_dca_lfe_fir_vfp;
- s->qmf_32_subbands = ff_dca_qmf_32_subbands_vfp;
- }
- if (have_neon(cpu_flags))
- s->lfe_fir = ff_dca_lfe_fir_neon;
-}
-
-av_cold void ff_synth_filter_init_arm(SynthFilterContext *s)
-{
- int cpu_flags = av_get_cpu_flags();
-
- if (have_vfp(cpu_flags) && !have_vfpv3(cpu_flags))
- s->synth_filter_float = ff_synth_filter_float_vfp;
- if (have_neon(cpu_flags))
- s->synth_filter_float = ff_synth_filter_float_neon;
-}
diff --git a/libavcodec/arm/dcadsp_neon.S b/libavcodec/arm/dcadsp_neon.S
deleted file mode 100644
index 6a6c77a..0000000
--- a/libavcodec/arm/dcadsp_neon.S
+++ b/dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2010 Mans Rullgard <mans@mansr.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
- */
-
-#include "libavutil/arm/asm.S"
-
-function ff_dca_lfe_fir_neon, export=1
- push {r4-r6,lr}
-
- add r4, r0, r3, lsl #2 @ out2
- add r5, r2, #256*4-16 @ cf1
- sub r1, r1, #12
- cmp r3, #32
- ite eq
- moveq r6, #256/32
- movne r6, #256/64
-NOVFP vldr s0, [sp, #16] @ scale
- mov lr, #-16
-1:
- vmov.f32 q2, #0.0 @ v0
- vmov.f32 q3, #0.0 @ v1
- mov r12, r6
-2:
- vld1.32 {q8}, [r2,:128]! @ cf0
- vld1.32 {q9}, [r5,:128], lr @ cf1
- vld1.32 {q1}, [r1], lr @ in
- subs r12, r12, #4
- vrev64.32 q10, q8
- vmla.f32 q3, q1, q9
- vmla.f32 d4, d2, d21
- vmla.f32 d5, d3, d20
- bne 2b
-
- add r1, r1, r6, lsl #2
- subs r3, r3, #1
- vadd.f32 d4, d4, d5
- vadd.f32 d6, d6, d7
- vpadd.f32 d4, d4, d6
- vmul.f32 d5, d4, d0[0]
- vst1.32 {d5[0]}, [r0,:32]!
- vst1.32 {d5[1]}, [r4,:32]!
- bne 1b
-
- pop {r4-r6,pc}
-endfunc
diff --git a/libavcodec/arm/dcadsp_vfp.S b/libavcodec/arm/dcadsp_vfp.S
deleted file mode 100644
index b23ce4a..0000000
--- a/libavcodec/arm/dcadsp_vfp.S
+++ b/dev/null
@@ -1,493 +0,0 @@
-/*
- * Copyright (c) 2013 RISC OS Open Ltd
- * Author: Ben Avison <bavison@riscosopen.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 "libavutil/arm/asm.S"
-
-POUT .req a1
-PIN .req a2
-PCOEF .req a3
-DECIFACTOR .req a4
-OLDFPSCR .req a4
-COUNTER .req ip
-
-SCALE32 .req s28 @ use vector of 4 in place of 9th scalar when decifactor=32 / JMAX=8
-SCALE64 .req s0 @ spare register in scalar bank when decifactor=64 / JMAX=4
-IN0 .req s4
-IN1 .req s5
-IN2 .req s6
-IN3 .req s7
-IN4 .req s0
-IN5 .req s1
-IN6 .req s2
-IN7 .req s3
-COEF0 .req s8 @ coefficient elements
-COEF1 .req s9
-COEF2 .req s10
-COEF3 .req s11
-COEF4 .req s12
-COEF5 .req s13
-COEF6 .req s14
-COEF7 .req s15
-ACCUM0 .req s16 @ double-buffered multiply-accumulate results
-ACCUM4 .req s20
-POST0 .req s24 @ do long-latency post-multiply in this vector in parallel
-POST1 .req s25
-POST2 .req s26
-POST3 .req s27
-
-
-.macro inner_loop decifactor, dir, tail, head
- .ifc "\dir","up"
- .set X, 0
- .set Y, 4
- .else
- .set X, 4*JMAX*4 - 4
- .set Y, -4
- .endif
- .ifnc "\head",""
- vldr COEF0, [PCOEF, #X + (0*JMAX + 0) * Y]
- vldr COEF1, [PCOEF, #X + (1*JMAX + 0) * Y]
- vldr COEF2, [PCOEF, #X + (2*JMAX + 0) * Y]
- vldr COEF3, [PCOEF, #X + (3*JMAX + 0) * Y]
- .endif
- .ifnc "\tail",""
- vadd.f POST0, ACCUM0, ACCUM4 @ vector operation
- .endif
- .ifnc "\head",""
- vmul.f ACCUM0, COEF0, IN0 @ vector = vector * scalar
- vldr COEF4, [PCOEF, #X + (0*JMAX + 1) * Y]
- vldr COEF5, [PCOEF, #X + (1*JMAX + 1) * Y]
- vldr COEF6, [PCOEF, #X + (2*JMAX + 1) * Y]
- .endif
- .ifnc "\tail",""
- vmul.f POST0, POST0, SCALE\decifactor @ vector operation (SCALE may be scalar)
- .endif
- .ifnc "\head",""
- vldr COEF7, [PCOEF, #X + (3*JMAX + 1) * Y]
- .ifc "\tail",""
- vmul.f ACCUM4, COEF4, IN1 @ vector operation
- .endif
- vldr COEF0, [PCOEF, #X + (0*JMAX + 2) * Y]
- vldr COEF1, [PCOEF, #X + (1*JMAX + 2) * Y]
- .ifnc "\tail",""
- vmul.f ACCUM4, COEF4, IN1 @ vector operation
- .endif
- vldr COEF2, [PCOEF, #X + (2*JMAX + 2) * Y]
- vldr COEF3, [PCOEF, #X + (3*JMAX + 2) * Y]
- .endif
- .ifnc "\tail",""
- vstmia POUT!, {POST0-POST3}
- .endif
- .ifnc "\head",""
- vmla.f ACCUM0, COEF0, IN2 @ vector = vector * scalar
- vldr COEF4, [PCOEF, #X + (0*JMAX + 3) * Y]
- vldr COEF5, [PCOEF, #X + (1*JMAX + 3) * Y]
- vldr COEF6, [PCOEF, #X + (2*JMAX + 3) * Y]
- vldr COEF7, [PCOEF, #X + (3*JMAX + 3) * Y]
- vmla.f ACCUM4, COEF4, IN3 @ vector = vector * scalar
- .if \decifactor == 32
- vldr COEF0, [PCOEF, #X + (0*JMAX + 4) * Y]
- vldr COEF1, [PCOEF, #X + (1*JMAX + 4) * Y]
- vldr COEF2, [PCOEF, #X + (2*JMAX + 4) * Y]
- vldr COEF3, [PCOEF, #X + (3*JMAX + 4) * Y]
- vmla.f ACCUM0, COEF0, IN4 @ vector = vector * scalar
- vldr COEF4, [PCOEF, #X + (0*JMAX + 5) * Y]
- vldr COEF5, [PCOEF, #X + (1*JMAX + 5) * Y]
- vldr COEF6, [PCOEF, #X + (2*JMAX + 5) * Y]
- vldr COEF7, [PCOEF, #X + (3*JMAX + 5) * Y]
- vmla.f ACCUM4, COEF4, IN5 @ vector = vector * scalar
- vldr COEF0, [PCOEF, #X + (0*JMAX + 6) * Y]
- vldr COEF1, [PCOEF, #X + (1*JMAX + 6) * Y]
- vldr COEF2, [PCOEF, #X + (2*JMAX + 6) * Y]
- vldr COEF3, [PCOEF, #X + (3*JMAX + 6) * Y]
- vmla.f ACCUM0, COEF0, IN6 @ vector = vector * scalar
- vldr COEF4, [PCOEF, #X + (0*JMAX + 7) * Y]
- vldr COEF5, [PCOEF, #X + (1*JMAX + 7) * Y]
- vldr COEF6, [PCOEF, #X + (2*JMAX + 7) * Y]
- vldr COEF7, [PCOEF, #X + (3*JMAX + 7) * Y]
- vmla.f ACCUM4, COEF4, IN7 @ vector = vector * scalar
- .endif
- .endif
-.endm
-
-.macro dca_lfe_fir decifactor
- .if \decifactor == 32
- .set JMAX, 8
- vpush {s16-s31}
- vmov SCALE32, s0 @ duplicate scalar across vector
- vldr IN4, [PIN, #-4*4]
- vldr IN5, [PIN, #-5*4]
- vldr IN6, [PIN, #-6*4]
- vldr IN7, [PIN, #-7*4]
- .else
- .set JMAX, 4
- vpush {s16-s27}
- .endif
-
- mov COUNTER, #\decifactor/4 - 1
- inner_loop \decifactor, up,, head
-1: add PCOEF, PCOEF, #4*JMAX*4
- subs COUNTER, COUNTER, #1
- inner_loop \decifactor, up, tail, head
- bne 1b
- inner_loop \decifactor, up, tail
-
- mov COUNTER, #\decifactor/4 - 1
- inner_loop \decifactor, down,, head
-1: sub PCOEF, PCOEF, #4*JMAX*4
- subs COUNTER, COUNTER, #1
- inner_loop \decifactor, down, tail, head
- bne 1b
- inner_loop \decifactor, down, tail
-
- .if \decifactor == 32
- vpop {s16-s31}
- .else
- vpop {s16-s27}
- .endif
- fmxr FPSCR, OLDFPSCR
- bx lr
-.endm
-
-
-/* void ff_dca_lfe_fir_vfp(float *out, const float *in, const float *coefs,
- * int decifactor, float scale)
- */
-function ff_dca_lfe_fir_vfp, export=1
- teq DECIFACTOR, #32
- fmrx OLDFPSCR, FPSCR
- ldr ip, =0x03030000 @ RunFast mode, short vectors of length 4, stride 1
- fmxr FPSCR, ip
-NOVFP vldr s0, [sp]
- vldr IN0, [PIN, #-0*4]
- vldr IN1, [PIN, #-1*4]
- vldr IN2, [PIN, #-2*4]
- vldr IN3, [PIN, #-3*4]
- beq 32f
-64: dca_lfe_fir 64
- .ltorg
-32: dca_lfe_fir 32
-endfunc
-
- .unreq POUT
- .unreq PIN
- .unreq PCOEF
- .unreq DECIFACTOR
- .unreq OLDFPSCR
- .unreq COUNTER
-
- .unreq SCALE32
- .unreq SCALE64
- .unreq IN0
- .unreq IN1
- .unreq IN2
- .unreq IN3
- .unreq IN4
- .unreq IN5
- .unreq IN6
- .unreq IN7
- .unreq COEF0
- .unreq COEF1
- .unreq COEF2
- .unreq COEF3
- .unreq COEF4
- .unreq COEF5
- .unreq COEF6
- .unreq COEF7
- .unreq ACCUM0
- .unreq ACCUM4
- .unreq POST0
- .unreq POST1
- .unreq POST2
- .unreq POST3
-
-
-IN .req a1
-SBACT .req a2
-OLDFPSCR .req a3
-IMDCT .req a4
-WINDOW .req v1
-OUT .req v2
-BUF .req v3
-SCALEINT .req v4 @ only used in softfp case
-COUNT .req v5
-
-SCALE .req s0
-
-/* Stack layout differs in softfp and hardfp cases:
- *
- * hardfp
- * fp -> 6 arg words saved by caller
- * a3,a4,v1-v3,v5,fp,lr on entry (a3 just to pad to 8 bytes)
- * s16-s23 on entry
- * align 16
- * buf -> 8*32*4 bytes buffer
- * s0 on entry
- * sp -> 3 arg words for callee
- *
- * softfp
- * fp -> 7 arg words saved by caller
- * a4,v1-v5,fp,lr on entry
- * s16-s23 on entry
- * align 16
- * buf -> 8*32*4 bytes buffer
- * sp -> 4 arg words for callee
- */
-
-/* void ff_dca_qmf_32_subbands_vfp(float samples_in[32][8], int sb_act,
- * SynthFilterContext *synth, FFTContext *imdct,
- * float (*synth_buf_ptr)[512],
- * int *synth_buf_offset, float (*synth_buf2)[32],
- * const float (*window)[512], float *samples_out,
- * float (*raXin)[32], float scale);
- */
-function ff_dca_qmf_32_subbands_vfp, export=1
-VFP push {a3-a4,v1-v3,v5,fp,lr}
-NOVFP push {a4,v1-v5,fp,lr}
- add fp, sp, #8*4
- vpush {s16-s23}
- @ The buffer pointed at by raXin isn't big enough for us to do a
- @ complete matrix transposition as we want to, so allocate an
- @ alternative buffer from the stack. Align to 4 words for speed.
- sub BUF, sp, #8*32*4
- bic BUF, BUF, #15
- mov sp, BUF
- ldr lr, =0x03330000 @ RunFast mode, short vectors of length 4, stride 2
- fmrx OLDFPSCR, FPSCR
- fmxr FPSCR, lr
- @ COUNT is used to count down 2 things at once:
- @ bits 0-4 are the number of word pairs remaining in the output row
- @ bits 5-31 are the number of words to copy (with possible negation)
- @ from the source matrix before we start zeroing the remainder
- mov COUNT, #(-4 << 5) + 16
- adds COUNT, COUNT, SBACT, lsl #5
- bmi 2f
-1:
- vldr s8, [IN, #(0*8+0)*4]
- vldr s10, [IN, #(0*8+1)*4]
- vldr s12, [IN, #(0*8+2)*4]
- vldr s14, [IN, #(0*8+3)*4]
- vldr s16, [IN, #(0*8+4)*4]
- vldr s18, [IN, #(0*8+5)*4]
- vldr s20, [IN, #(0*8+6)*4]
- vldr s22, [IN, #(0*8+7)*4]
- vneg.f s8, s8
- vldr s9, [IN, #(1*8+0)*4]
- vldr s11, [IN, #(1*8+1)*4]
- vldr s13, [IN, #(1*8+2)*4]
- vldr s15, [IN, #(1*8+3)*4]
- vneg.f s16, s16
- vldr s17, [IN, #(1*8+4)*4]
- vldr s19, [IN, #(1*8+5)*4]
- vldr s21, [IN, #(1*8+6)*4]
- vldr s23, [IN, #(1*8+7)*4]
- vstr d4, [BUF, #(0*32+0)*4]
- vstr d5, [BUF, #(1*32+0)*4]
- vstr d6, [BUF, #(2*32+0)*4]
- vstr d7, [BUF, #(3*32+0)*4]
- vstr d8, [BUF, #(4*32+0)*4]
- vstr d9, [BUF, #(5*32+0)*4]
- vstr d10, [BUF, #(6*32+0)*4]
- vstr d11, [BUF, #(7*32+0)*4]
- vldr s9, [IN, #(3*8+0)*4]
- vldr s11, [IN, #(3*8+1)*4]
- vldr s13, [IN, #(3*8+2)*4]
- vldr s15, [IN, #(3*8+3)*4]
- vldr s17, [IN, #(3*8+4)*4]
- vldr s19, [IN, #(3*8+5)*4]
- vldr s21, [IN, #(3*8+6)*4]
- vldr s23, [IN, #(3*8+7)*4]
- vneg.f s9, s9
- vldr s8, [IN, #(2*8+0)*4]
- vldr s10, [IN, #(2*8+1)*4]
- vldr s12, [IN, #(2*8+2)*4]
- vldr s14, [IN, #(2*8+3)*4]
- vneg.f s17, s17
- vldr s16, [IN, #(2*8+4)*4]
- vldr s18, [IN, #(2*8+5)*4]
- vldr s20, [IN, #(2*8+6)*4]
- vldr s22, [IN, #(2*8+7)*4]
- vstr d4, [BUF, #(0*32+2)*4]
- vstr d5, [BUF, #(1*32+2)*4]
- vstr d6, [BUF, #(2*32+2)*4]
- vstr d7, [BUF, #(3*32+2)*4]
- vstr d8, [BUF, #(4*32+2)*4]
- vstr d9, [BUF, #(5*32+2)*4]
- vstr d10, [BUF, #(6*32+2)*4]
- vstr d11, [BUF, #(7*32+2)*4]
- add IN, IN, #4*8*4
- add BUF, BUF, #4*4
- subs COUNT, COUNT, #(4 << 5) + 2
- bpl 1b
-2: @ Now deal with trailing < 4 samples
- adds COUNT, COUNT, #3 << 5
- bmi 4f @ sb_act was a multiple of 4
- bics lr, COUNT, #0x1F
- bne 3f
- @ sb_act was n*4+1
- vldr s8, [IN, #(0*8+0)*4]
- vldr s10, [IN, #(0*8+1)*4]
- vldr s12, [IN, #(0*8+2)*4]
- vldr s14, [IN, #(0*8+3)*4]
- vldr s16, [IN, #(0*8+4)*4]
- vldr s18, [IN, #(0*8+5)*4]
- vldr s20, [IN, #(0*8+6)*4]
- vldr s22, [IN, #(0*8+7)*4]
- vneg.f s8, s8
- vldr s9, zero
- vldr s11, zero
- vldr s13, zero
- vldr s15, zero
- vneg.f s16, s16
- vldr s17, zero
- vldr s19, zero
- vldr s21, zero
- vldr s23, zero
- vstr d4, [BUF, #(0*32+0)*4]
- vstr d5, [BUF, #(1*32+0)*4]
- vstr d6, [BUF, #(2*32+0)*4]
- vstr d7, [BUF, #(3*32+0)*4]
- vstr d8, [BUF, #(4*32+0)*4]
- vstr d9, [BUF, #(5*32+0)*4]
- vstr d10, [BUF, #(6*32+0)*4]
- vstr d11, [BUF, #(7*32+0)*4]
- add BUF, BUF, #2*4
- sub COUNT, COUNT, #1
- b 4f
-3: @ sb_act was n*4+2 or n*4+3, so do the first 2
- vldr s8, [IN, #(0*8+0)*4]
- vldr s10, [IN, #(0*8+1)*4]
- vldr s12, [IN, #(0*8+2)*4]
- vldr s14, [IN, #(0*8+3)*4]
- vldr s16, [IN, #(0*8+4)*4]
- vldr s18, [IN, #(0*8+5)*4]
- vldr s20, [IN, #(0*8+6)*4]
- vldr s22, [IN, #(0*8+7)*4]
- vneg.f s8, s8
- vldr s9, [IN, #(1*8+0)*4]
- vldr s11, [IN, #(1*8+1)*4]
- vldr s13, [IN, #(1*8+2)*4]
- vldr s15, [IN, #(1*8+3)*4]
- vneg.f s16, s16
- vldr s17, [IN, #(1*8+4)*4]
- vldr s19, [IN, #(1*8+5)*4]
- vldr s21, [IN, #(1*8+6)*4]
- vldr s23, [IN, #(1*8+7)*4]
- vstr d4, [BUF, #(0*32+0)*4]
- vstr d5, [BUF, #(1*32+0)*4]
- vstr d6, [BUF, #(2*32+0)*4]
- vstr d7, [BUF, #(3*32+0)*4]
- vstr d8, [BUF, #(4*32+0)*4]
- vstr d9, [BUF, #(5*32+0)*4]
- vstr d10, [BUF, #(6*32+0)*4]
- vstr d11, [BUF, #(7*32+0)*4]
- add BUF, BUF, #2*4
- sub COUNT, COUNT, #(2 << 5) + 1
- bics lr, COUNT, #0x1F
- bne 4f
- @ sb_act was n*4+3
- vldr s8, [IN, #(2*8+0)*4]
- vldr s10, [IN, #(2*8+1)*4]
- vldr s12, [IN, #(2*8+2)*4]
- vldr s14, [IN, #(2*8+3)*4]
- vldr s16, [IN, #(2*8+4)*4]
- vldr s18, [IN, #(2*8+5)*4]
- vldr s20, [IN, #(2*8+6)*4]
- vldr s22, [IN, #(2*8+7)*4]
- vldr s9, zero
- vldr s11, zero
- vldr s13, zero
- vldr s15, zero
- vldr s17, zero
- vldr s19, zero
- vldr s21, zero
- vldr s23, zero
- vstr d4, [BUF, #(0*32+0)*4]
- vstr d5, [BUF, #(1*32+0)*4]
- vstr d6, [BUF, #(2*32+0)*4]
- vstr d7, [BUF, #(3*32+0)*4]
- vstr d8, [BUF, #(4*32+0)*4]
- vstr d9, [BUF, #(5*32+0)*4]
- vstr d10, [BUF, #(6*32+0)*4]
- vstr d11, [BUF, #(7*32+0)*4]
- add BUF, BUF, #2*4
- sub COUNT, COUNT, #1
-4: @ Now fill the remainder with 0
- vldr s8, zero
- vldr s9, zero
- ands COUNT, COUNT, #0x1F
- beq 6f
-5: vstr d4, [BUF, #(0*32+0)*4]
- vstr d4, [BUF, #(1*32+0)*4]
- vstr d4, [BUF, #(2*32+0)*4]
- vstr d4, [BUF, #(3*32+0)*4]
- vstr d4, [BUF, #(4*32+0)*4]
- vstr d4, [BUF, #(5*32+0)*4]
- vstr d4, [BUF, #(6*32+0)*4]
- vstr d4, [BUF, #(7*32+0)*4]
- add BUF, BUF, #2*4
- subs COUNT, COUNT, #1
- bne 5b
-6:
- fmxr FPSCR, OLDFPSCR
- ldr WINDOW, [fp, #3*4]
- ldr OUT, [fp, #4*4]
- sub BUF, BUF, #32*4
-NOVFP ldr SCALEINT, [fp, #6*4]
- mov COUNT, #8
-VFP vpush {SCALE}
-VFP sub sp, sp, #3*4
-NOVFP sub sp, sp, #4*4
-7:
-VFP ldr a1, [fp, #-7*4] @ imdct
-NOVFP ldr a1, [fp, #-8*4]
- ldmia fp, {a2-a4}
-VFP stmia sp, {WINDOW, OUT, BUF}
-NOVFP stmia sp, {WINDOW, OUT, BUF, SCALEINT}
-VFP vldr SCALE, [sp, #3*4]
- bl X(ff_synth_filter_float_vfp)
- add OUT, OUT, #32*4
- add BUF, BUF, #32*4
- subs COUNT, COUNT, #1
- bne 7b
-
-A sub sp, fp, #(8+8)*4
-T sub fp, fp, #(8+8)*4
-T mov sp, fp
- vpop {s16-s23}
-VFP pop {a3-a4,v1-v3,v5,fp,pc}
-NOVFP pop {a4,v1-v5,fp,pc}
-endfunc
-
- .unreq IN
- .unreq SBACT
- .unreq OLDFPSCR
- .unreq IMDCT
- .unreq WINDOW
- .unreq OUT
- .unreq BUF
- .unreq SCALEINT
- .unreq COUNT
-
- .unreq SCALE
-
- .align 2
-zero: .word 0
diff --git a/libavcodec/dcadata.h b/libavcodec/dcadata.h
deleted file mode 100644
index 15df49e..0000000
--- a/libavcodec/dcadata.h
+++ b/dev/null
@@ -1,7664 +0,0 @@
-/*
- * DCA compatible decoder data
- * Copyright (C) 2004 Gildas Bazin
- * 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
- */
-
-#ifndef AVCODEC_DCADATA_H
-#define AVCODEC_DCADATA_H
-
-#include <stdint.h>
-#include "libavutil/mem.h"
-
-/* Generic tables */
-
-static const uint32_t dca_bit_rates[32] =
-{
- 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[16] =
-{
- 1, 2, 2, 2, 2, 3, 3, 4, 4, 5, 6, 6, 6, 7, 8, 8
-};
-
-static const uint8_t dca_bits_per_sample[7] =
-{
- 16, 16, 20, 20, 0, 24, 24
-};
-
-
-/* Adpcm data */
-
-/* 16bits signed fractional Q13 binary codes */
-static const 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 }
-};
-
-/* quantization tables */
-
-static const uint32_t scale_factor_quant6[64] = {
- 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
-};
-
-static const uint32_t scale_factor_quant7[128] = {
- 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 */
-static const uint32_t lossy_quant[32] = {
- 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
-};
-
-static const float lossy_quant_d[32] = {
- 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 */
-static const uint32_t lossless_quant[32] = {
- 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
-};
-
-static const float lossless_quant_d[32] = {
- 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
-};
-
-
-/* Vector quantization tables */
-
-DECLARE_ALIGNED(8, static const 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 }
-};
-
-
-/* FIR filter coefficients, they can be cut on half and maybe use float instead of double*/
-
-DECLARE_ALIGNED(16, static const float, fir_32bands_perfect)[] =
-{
-+1.135985195E-010,
-+7.018770981E-011,
--1.608403011E-008,
--5.083275667E-008,
--1.543309907E-007,
--3.961981463E-007,
--7.342250683E-007,
--3.970030775E-007,
--4.741137047E-007,
--6.022448247E-007,
--6.628192182E-007,
--6.982898526E-007,
--7.020648809E-007,
--6.767839409E-007,
--6.262345096E-007,
--5.564140224E-007,
-+7.003467317E-007,
-+8.419976893E-007,
-+9.742954035E-007,
-+1.085227950E-006,
-+1.162929266E-006,
-+1.194632091E-006,
-+1.179182050E-006,
-+1.033426656E-006,
-+9.451737242E-007,
-+1.975324267E-006,
-+1.190443072E-006,
-+5.234479659E-007,
-+2.014677420E-007,
-+7.834767501E-008,
--6.702406963E-010,
--1.613285505E-009,
--2.682709610E-009,
--3.399493131E-009,
-+1.314406006E-008,
-+7.506701927E-009,
-+2.788728892E-008,
-+1.444918922E-007,
-+3.132386439E-007,
-+1.399798180E-006,
-+2.032118118E-006,
-+2.715013807E-006,
-+3.453840463E-006,
-+4.195037945E-006,
-+4.896494374E-006,
-+5.516381407E-006,
-+6.015239251E-006,
-+6.361419310E-006,
-+8.006985809E-006,
-+8.087732567E-006,
-+7.941360309E-006,
-+7.568834008E-006,
-+6.986399967E-006,
-+6.225028756E-006,
-+5.315936960E-006,
-+4.429412002E-006,
-+3.332600045E-006,
-+8.427224429E-007,
-+4.341498823E-007,
-+9.458596395E-008,
-+2.975164826E-008,
-+6.402664354E-008,
--3.246264413E-008,
--3.809887872E-008,
-+8.434094667E-008,
-+6.437721822E-008,
-+1.189317118E-006,
-+2.497214155E-006,
-+3.617151151E-006,
-+3.157242645E-006,
-+2.319611212E-006,
-+7.869333785E-006,
-+9.826449968E-006,
-+1.177108606E-005,
-+1.379448349E-005,
-+1.571428584E-005,
-+1.743183020E-005,
-+1.884208177E-005,
-+1.987093310E-005,
-+2.042970118E-005,
--3.144468428E-005,
--3.334947178E-005,
--3.460439257E-005,
--3.515914432E-005,
--3.495384954E-005,
--3.397853652E-005,
--3.225446198E-005,
--2.978993689E-005,
--2.677291741E-005,
--1.806914770E-005,
--1.776598037E-005,
--1.661818715E-005,
--1.207003334E-005,
--6.993315310E-006,
--5.633860383E-007,
--9.984935332E-007,
--1.470520488E-006,
--1.853591357E-006,
-+7.198007665E-007,
-+3.086857760E-006,
-+6.084746474E-006,
-+9.561075785E-006,
-+1.309637537E-005,
-+2.263354872E-005,
-+2.847247197E-005,
-+3.415624451E-005,
-+3.946387005E-005,
-+4.425736552E-005,
-+4.839275425E-005,
-+5.176846025E-005,
-+5.429694284E-005,
-+5.595519906E-005,
-+4.916387297E-006,
-+9.299508747E-006,
-+1.356193479E-005,
-+1.751866148E-005,
-+2.093936746E-005,
-+2.362549276E-005,
-+2.537086584E-005,
-+2.618136386E-005,
-+2.554462844E-005,
-+3.018750249E-005,
-+2.570833203E-005,
-+1.985177369E-005,
-+1.191342653E-005,
-+2.525620175E-006,
--1.521241393E-005,
--1.617751332E-005,
-+1.992636317E-005,
-+1.774702469E-005,
-+4.624524081E-005,
-+5.610509834E-005,
-+6.568001118E-005,
-+7.513730816E-005,
-+8.413690375E-005,
-+8.757545584E-005,
-+9.517164290E-005,
-+1.020687996E-004,
-+1.084438481E-004,
-+1.140582463E-004,
-+1.187910311E-004,
-+1.224978914E-004,
-+1.250260248E-004,
-+1.262027217E-004,
-+1.226499153E-004,
-+1.213575742E-004,
-+1.180980107E-004,
-+1.126275165E-004,
-+1.047207043E-004,
-+9.417100227E-005,
-+8.078388782E-005,
-+6.447290798E-005,
-+4.491530854E-005,
-+2.470704203E-005,
--1.714242217E-006,
--3.193307566E-005,
--6.541742187E-005,
--1.024175072E-004,
--1.312203676E-004,
--1.774113771E-004,
--2.233728592E-004,
--2.682086197E-004,
--3.347633174E-004,
--3.906481725E-004,
--4.490280990E-004,
--5.099929986E-004,
--5.729619297E-004,
--6.358824321E-004,
--7.021900383E-004,
--7.698345580E-004,
--8.385353722E-004,
--9.078957955E-004,
--9.775133803E-004,
--1.046945457E-003,
--1.115717343E-003,
--1.183370827E-003,
--1.252829796E-003,
--1.316190348E-003,
--1.376571832E-003,
--1.433344092E-003,
--1.485876855E-003,
--1.533520175E-003,
--1.575609902E-003,
--1.611457788E-003,
--1.640390139E-003,
--1.661288203E-003,
--1.674512983E-003,
--1.678415807E-003,
--1.672798418E-003,
--1.656501088E-003,
--1.633993932E-003,
--1.593449386E-003,
-+1.542080659E-003,
-+1.479332102E-003,
-+1.395521569E-003,
-+1.303116791E-003,
-+1.196175464E-003,
-+1.073757303E-003,
-+9.358961834E-004,
-+7.817269652E-004,
-+6.114174030E-004,
-+4.244441516E-004,
-+2.206075296E-004,
--2.719412748E-007,
--2.382978710E-004,
--4.935106263E-004,
--7.658848190E-004,
--1.055365428E-003,
--1.361547387E-003,
--1.684492454E-003,
--2.023874084E-003,
--2.379294252E-003,
--2.750317100E-003,
--3.136433195E-003,
--3.537061159E-003,
--3.951539751E-003,
--4.379155114E-003,
--4.819062538E-003,
--5.270531867E-003,
--5.732392892E-003,
--6.203945260E-003,
--6.683901884E-003,
--7.170005701E-003,
--7.664063945E-003,
--8.162760176E-003,
--8.665001951E-003,
--9.170533158E-003,
--9.676489048E-003,
--1.018219907E-002,
--1.068630442E-002,
--1.118756086E-002,
--1.168460958E-002,
--1.217562053E-002,
--1.265939046E-002,
--1.313448418E-002,
--1.359948888E-002,
--1.405300573E-002,
--1.449365262E-002,
--1.492007636E-002,
--1.533095632E-002,
--1.572482102E-002,
--1.610082202E-002,
--1.645756140E-002,
--1.679391414E-002,
--1.710879989E-002,
--1.740120351E-002,
--1.767017506E-002,
--1.791484281E-002,
--1.813439466E-002,
--1.832821220E-002,
--1.849545911E-002,
--1.863567345E-002,
--1.874836907E-002,
--1.883326657E-002,
--1.889026538E-002,
--1.891860925E-002,
-+1.891860925E-002,
-+1.889026538E-002,
-+1.883326657E-002,
-+1.874836907E-002,
-+1.863567345E-002,
-+1.849545911E-002,
-+1.832821220E-002,
-+1.813439466E-002,
-+1.791484281E-002,
-+1.767017506E-002,
-+1.740120351E-002,
-+1.710879989E-002,
-+1.679391414E-002,
-+1.645756140E-002,
-+1.610082202E-002,
-+1.572482102E-002,
-+1.533095632E-002,
-+1.492007636E-002,
-+1.449365262E-002,
-+1.405300573E-002,
-+1.359948888E-002,
-+1.313448418E-002,
-+1.265939046E-002,
-+1.217562053E-002,
-+1.168460958E-002,
-+1.118756086E-002,
-+1.068630442E-002,
-+1.018219907E-002,
-+9.676489048E-003,
-+9.170533158E-003,
-+8.665001951E-003,
-+8.162760176E-003,
-+7.664063945E-003,
-+7.170005701E-003,
-+6.683901884E-003,
-+6.203945260E-003,
-+5.732392892E-003,
-+5.270531867E-003,
-+4.819062538E-003,
-+4.379155114E-003,
-+3.951539751E-003,
-+3.537061159E-003,
-+3.136433195E-003,
-+2.750317100E-003,
-+2.379294252E-003,
-+2.023874084E-003,
-+1.684492454E-003,
-+1.361547387E-003,
-+1.055365428E-003,
-+7.658848190E-004,
-+4.935106263E-004,
-+2.382978710E-004,
-+2.719412748E-007,
--2.206075296E-004,
--4.244441516E-004,
--6.114174030E-004,
--7.817269652E-004,
--9.358961834E-004,
--1.073757303E-003,
--1.196175464E-003,
--1.303116791E-003,
--1.395521569E-003,
--1.479332102E-003,
--1.542080659E-003,
-+1.593449386E-003,
-+1.633993932E-003,
-+1.656501088E-003,
-+1.672798418E-003,
-+1.678415807E-003,
-+1.674512983E-003,
-+1.661288203E-003,
-+1.640390139E-003,
-+1.611457788E-003,
-+1.575609902E-003,
-+1.533520175E-003,
-+1.485876855E-003,
-+1.433344092E-003,
-+1.376571832E-003,
-+1.316190348E-003,
-+1.252829796E-003,
-+1.183370827E-003,
-+1.115717343E-003,
-+1.046945457E-003,
-+9.775133803E-004,
-+9.078957955E-004,
-+8.385353722E-004,
-+7.698345580E-004,
-+7.021900383E-004,
-+6.358824321E-004,
-+5.729619297E-004,
-+5.099929986E-004,
-+4.490280990E-004,
-+3.906481725E-004,
-+3.347633174E-004,
-+2.682086197E-004,
-+2.233728592E-004,
-+1.774113771E-004,
-+1.312203676E-004,
-+1.024175072E-004,
-+6.541742187E-005,
-+3.193307566E-005,
-+1.714242217E-006,
--2.470704203E-005,
--4.491530854E-005,
--6.447290798E-005,
--8.078388782E-005,
--9.417100227E-005,
--1.047207043E-004,
--1.126275165E-004,
--1.180980107E-004,
--1.213575742E-004,
--1.226499153E-004,
--1.262027217E-004,
--1.250260248E-004,
--1.224978914E-004,
--1.187910311E-004,
--1.140582463E-004,
--1.084438481E-004,
--1.020687996E-004,
--9.517164290E-005,
--8.757545584E-005,
--8.413690375E-005,
--7.513730816E-005,
--6.568001118E-005,
--5.610509834E-005,
--4.624524081E-005,
--1.774702469E-005,
--1.992636317E-005,
-+1.617751332E-005,
-+1.521241393E-005,
--2.525620175E-006,
--1.191342653E-005,
--1.985177369E-005,
--2.570833203E-005,
--3.018750249E-005,
--2.554462844E-005,
--2.618136386E-005,
--2.537086584E-005,
--2.362549276E-005,
--2.093936746E-005,
--1.751866148E-005,
--1.356193479E-005,
--9.299508747E-006,
--4.916387297E-006,
--5.595519906E-005,
--5.429694284E-005,
--5.176846025E-005,
--4.839275425E-005,
--4.425736552E-005,
--3.946387005E-005,
--3.415624451E-005,
--2.847247197E-005,
--2.263354872E-005,
--1.309637537E-005,
--9.561075785E-006,
--6.084746474E-006,
--3.086857760E-006,
--7.198007665E-007,
-+1.853591357E-006,
-+1.470520488E-006,
-+9.984935332E-007,
-+5.633860383E-007,
-+6.993315310E-006,
-+1.207003334E-005,
-+1.661818715E-005,
-+1.776598037E-005,
-+1.806914770E-005,
-+2.677291741E-005,
-+2.978993689E-005,
-+3.225446198E-005,
-+3.397853652E-005,
-+3.495384954E-005,
-+3.515914432E-005,
-+3.460439257E-005,
-+3.334947178E-005,
-+3.144468428E-005,
--2.042970118E-005,
--1.987093310E-005,
--1.884208177E-005,
--1.743183020E-005,
--1.571428584E-005,
--1.379448349E-005,
--1.177108606E-005,
--9.826449968E-006,
--7.869333785E-006,
--2.319611212E-006,
--3.157242645E-006,
--3.617151151E-006,
--2.497214155E-006,
--1.189317118E-006,
--6.437721822E-008,
--8.434094667E-008,
-+3.809887872E-008,
-+3.246264413E-008,
--6.402664354E-008,
--2.975164826E-008,
--9.458596395E-008,
--4.341498823E-007,
--8.427224429E-007,
--3.332600045E-006,
--4.429412002E-006,
--5.315936960E-006,
--6.225028756E-006,
--6.986399967E-006,
--7.568834008E-006,
--7.941360309E-006,
--8.087732567E-006,
--8.006985809E-006,
--6.361419310E-006,
--6.015239251E-006,
--5.516381407E-006,
--4.896494374E-006,
--4.195037945E-006,
--3.453840463E-006,
--2.715013807E-006,
--2.032118118E-006,
--1.399798180E-006,
--3.132386439E-007,
--1.444918922E-007,
--2.788728892E-008,
--7.506701927E-009,
--1.314406006E-008,
-+3.399493131E-009,
-+2.682709610E-009,
-+1.613285505E-009,
-+6.702406963E-010,
--7.834767501E-008,
--2.014677420E-007,
--5.234479659E-007,
--1.190443072E-006,
--1.975324267E-006,
--9.451737242E-007,
--1.033426656E-006,
--1.179182050E-006,
--1.194632091E-006,
--1.162929266E-006,
--1.085227950E-006,
--9.742954035E-007,
--8.419976893E-007,
--7.003467317E-007,
-+5.564140224E-007,
-+6.262345096E-007,
-+6.767839409E-007,
-+7.020648809E-007,
-+6.982898526E-007,
-+6.628192182E-007,
-+6.022448247E-007,
-+4.741137047E-007,
-+3.970030775E-007,
-+7.342250683E-007,
-+3.961981463E-007,
-+1.543309907E-007,
-+5.083275667E-008,
-+1.608403011E-008,
--7.018770981E-011,
--1.135985195E-010
-};
-
-DECLARE_ALIGNED(16, static const float, 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
-};
-
-DECLARE_ALIGNED(16, static const float, lfe_fir_64)[] =
-{
- 2.658434386830777e-4, 9.029330685734748e-3,
- 7.939263433218002e-2, 2.425158768892288e-1,
- 3.430179357528686e-1, 2.398228943347931e-1,
- 7.746443897485733e-2, 8.622321300208569e-3,
- 8.179365249816328e-5, 9.450953453779220e-3,
- 8.134882897138596e-2, 2.451938837766648e-1,
- 3.429597318172455e-1, 2.371159791946411e-1,
- 7.556436210870743e-2, 8.229630999267101e-3,
- 9.439323912374676e-5, 9.887560270726680e-3,
- 8.333285897970200e-2, 2.478559017181396e-1,
- 3.428434133529663e-1, 2.343961596488952e-1,
- 7.369252294301987e-2, 7.850865833461285e-3,
- 1.082170274457894e-4, 1.033949479460716e-2,
- 8.534456789493561e-2, 2.505008876323700e-1,
- 3.426689505577088e-1, 2.316644787788391e-1,
- 7.184901088476181e-2, 7.485736627131701e-3,
- 1.233371440321207e-4, 1.080708485096693e-2,
- 8.738376945257187e-2, 2.531278133392334e-1,
- 3.424364924430847e-1, 2.289219647645950e-1,
- 7.003392279148102e-2, 7.133882027119398e-3,
- 1.397485757479444e-4, 1.129068247973919e-2,
- 8.945026248693466e-2, 2.557355761528015e-1,
- 3.421461284160614e-1, 2.261696159839630e-1,
- 6.824731826782227e-2, 6.794991903007030e-3,
- 1.575958012836054e-4, 1.179065089672804e-2,
- 9.154383838176728e-2, 2.583232223987580e-1,
- 3.417979776859284e-1, 2.234084606170654e-1,
- 6.648923456668854e-2, 6.468691397458315e-3,
- 1.769922382663936e-4, 1.230732165277004e-2,
- 9.366425126791000e-2, 2.608896791934967e-1,
- 3.413922190666198e-1, 2.206395119428635e-1,
- 6.475970894098282e-2, 6.154712289571762e-3,
- 1.981738605536520e-4, 1.284105982631445e-2,
- 9.581124037504196e-2, 2.634339034557342e-1,
- 3.409290313720703e-1, 2.178637981414795e-1,
- 6.305878609418869e-2, 5.852684378623962e-3,
- 2.211847313446924e-4, 1.339218579232693e-2,
- 9.798453748226166e-2, 2.659549415111542e-1,
- 3.404086530208588e-1, 2.150822728872299e-1,
- 6.138643622398376e-2, 5.562345497310162e-3,
- 2.460231189616024e-4, 1.396108977496624e-2,
- 1.001838669180870e-1, 2.684516608715058e-1,
- 3.398312926292420e-1, 2.122959494590759e-1,
- 5.974265560507774e-2, 5.283284001052380e-3,
- 2.726115926634520e-4, 1.454808749258518e-2,
- 1.024089083075523e-1, 2.709231376647949e-1,
- 3.391972482204438e-1, 2.095058411359787e-1,
- 5.812742188572884e-2, 5.015311297029257e-3,
- 3.013863170053810e-4, 1.515355054289102e-2,
- 1.046593263745308e-1, 2.733682692050934e-1,
- 3.385068178176880e-1, 2.067128717899322e-1,
- 5.654069408774376e-2, 4.758012015372515e-3,
- 3.328395541757345e-4, 1.577781140804291e-2,
- 1.069347932934761e-1, 2.757860720157624e-1,
- 3.377602994441986e-1, 2.039180546998978e-1,
- 5.498242005705833e-2, 4.511159844696522e-3,
- 3.658991190604866e-4, 1.642123050987720e-2,
- 1.092349365353584e-1, 2.781755328178406e-1,
- 3.369580209255218e-1, 2.011223286390304e-1,
- 5.345252528786659e-2, 4.274417180567980e-3,
- 4.018281470052898e-4, 1.708412915468216e-2,
- 1.115593686699867e-1, 2.805356979370117e-1,
- 3.361004292964936e-1, 1.983266174793244e-1,
- 5.195093154907227e-2, 4.047499038279056e-3,
- 4.401875485200435e-4, 1.776690222322941e-2,
- 1.139076948165894e-1, 2.828655838966370e-1,
- 3.351879119873047e-1, 1.955319195985794e-1,
- 5.047753453254700e-2, 3.830091329291463e-3,
- 4.812776169274002e-4, 1.846982724964619e-2,
- 1.162794977426529e-1, 2.851640880107880e-1,
- 3.342207968235016e-1, 1.927391141653061e-1,
- 4.903224110603333e-2, 3.621967276558280e-3,
- 5.252459668554366e-4, 1.919330470263958e-2,
- 1.186743453145027e-1, 2.874303460121155e-1,
- 3.331996202468872e-1, 1.899491697549820e-1,
- 4.761491715908051e-2, 3.422776935622096e-3,
- 5.721592460758984e-4, 1.993762329220772e-2,
- 1.210917681455612e-1, 2.896633744239807e-1,
- 3.321248590946198e-1, 1.871629506349564e-1,
- 4.622544348239899e-2, 3.232272574678064e-3,
- 6.222130032256246e-4, 2.070316113531590e-2,
- 1.235313042998314e-1, 2.918621897697448e-1,
- 3.309969604015350e-1, 1.843813359737396e-1,
- 4.486365616321564e-2, 3.050152910873294e-3,
- 6.755515350960195e-4, 2.149021252989769e-2,
- 1.259924471378326e-1, 2.940258979797364e-1,
- 3.298164308071136e-1, 1.816052496433258e-1,
- 4.352942481637001e-2, 2.876190468668938e-3,
- 7.324148900806904e-4, 2.229913882911205e-2,
- 1.284746825695038e-1, 2.961534857749939e-1,
- 3.285838961601258e-1, 1.788355410099030e-1,
- 4.222255200147629e-2, 2.710093278437853e-3,
- 7.928516715764999e-4, 2.313023805618286e-2,
- 1.309774816036224e-1, 2.982441186904907e-1,
- 3.272998929023742e-1, 1.760730892419815e-1,
- 4.094288870692253e-2, 2.551567042246461e-3,
- 8.570110658183694e-4, 2.398385666310787e-2,
- 1.335003077983856e-1, 3.002967536449432e-1,
- 3.259649574756622e-1, 1.733186990022659e-1,
- 3.969023004174232e-2, 2.400433411821723e-3,
- 9.251192095689476e-4, 2.486028522253036e-2,
- 1.360425949096680e-1, 3.023106753826142e-1,
- 3.245797157287598e-1, 1.705732345581055e-1,
- 3.846437484025955e-2, 2.256359672173858e-3,
- 9.974770946428180e-4, 2.575986087322235e-2,
- 1.386037617921829e-1, 3.042849004268646e-1,
- 3.231448531150818e-1, 1.678375005722046e-1,
- 3.726511076092720e-2, 2.119151875376701e-3,
- 1.073930296115577e-3, 2.668286114931106e-2,
- 1.411831974983215e-1, 3.062185347080230e-1,
- 3.216609656810760e-1, 1.651122719049454e-1,
- 3.609224036335945e-2, 1.988604199141264e-3,
- 1.155023579485714e-3, 2.762960828840732e-2,
- 1.437802612781525e-1, 3.081108033657074e-1,
- 3.201287388801574e-1, 1.623983532190323e-1,
- 3.494550660252571e-2, 1.864377525635064e-3,
- 1.240676851011813e-3, 2.860039286315441e-2,
- 1.463943719863892e-1, 3.099608123302460e-1,
- 3.185488879680634e-1, 1.596965193748474e-1,
- 3.382468968629837e-2, 1.746327499859035e-3,
- 1.331258914433420e-3, 2.959549613296986e-2,
- 1.490248143672943e-1, 3.117676973342896e-1,
- 3.169221282005310e-1, 1.570075154304504e-1,
- 3.272953629493714e-2, 1.634211512282491e-3,
- 1.426893868483603e-3, 3.061520494520664e-2,
- 1.516709625720978e-1, 3.135308027267456e-1,
- 3.152491748332978e-1, 1.543320864439010e-1,
- 3.165979683399200e-2, 1.527829794213176e-3,
-};
-
-DECLARE_ALIGNED(16, static const float, lfe_fir_128)[] =
-{
- 0.00053168571, 0.15878495574, 0.68603444099, 0.15492856503,
- 0.00016358691, 0.16269733012, 0.68591803312, 0.15112841129,
- 0.00018878609, 0.16666537523, 0.68568539619, 0.14738474786,
- 0.00021643363, 0.17068879306, 0.68533653021, 0.14369773865,
- 0.00024667382, 0.17476719618, 0.68487155437, 0.14006754756,
- 0.00027949660, 0.17890018225, 0.68429082632, 0.13649433851,
- 0.00031519096, 0.18308731914, 0.68359452486, 0.13297818601,
- 0.00035398375, 0.18732811511, 0.68278300762, 0.12951917946,
- 0.00039634691, 0.19162209332, 0.68185669184, 0.12611730397,
- 0.00044236859, 0.19596865773, 0.68081587553, 0.12277261168,
- 0.00049204525, 0.20036731660, 0.67966115475, 0.11948505789,
- 0.00054522208, 0.20481738448, 0.67839306593, 0.11625462025,
- 0.00060277141, 0.20931822062, 0.67701220512, 0.11308115721,
- 0.00066567765, 0.21386915445, 0.67551922798, 0.10996460915,
- 0.00073179678, 0.21846942604, 0.67391467094, 0.10690483451,
- 0.00080365466, 0.22311829031, 0.67219948769, 0.10390164703,
- 0.00088037323, 0.22781492770, 0.67037439346, 0.10095486045,
- 0.00096255314, 0.23255851865, 0.66844022274, 0.09806428105,
- 0.00105048984, 0.23734821379, 0.66639786959, 0.09522963315,
- 0.00114431616, 0.24218304455, 0.66424828768, 0.09245070815,
- 0.00124442333, 0.24706205726, 0.66199249029, 0.08972713351,
- 0.00135110028, 0.25198432803, 0.65963155031, 0.08705867827,
- 0.00146482687, 0.25694879889, 0.65716648102, 0.08444493264,
- 0.00158570008, 0.26195442677, 0.65459835529, 0.08188561350,
- 0.00171401864, 0.26700007915, 0.65192854404, 0.07938029617,
- 0.00185023469, 0.27208462358, 0.64915806055, 0.07692859322,
- 0.00199495023, 0.27720692754, 0.64628833532, 0.07453006506,
- 0.00214785640, 0.28236576915, 0.64332056046, 0.07218432426,
- 0.00231004250, 0.28755992651, 0.64025616646, 0.06989086419,
- 0.00248134881, 0.29278811812, 0.63709646463, 0.06764923781,
- 0.00266251224, 0.29804900289, 0.63384294510, 0.06545893103,
- 0.00285378192, 0.30334126949, 0.63049703836, 0.06331945211,
- 0.00305565330, 0.30866351724, 0.62706029415, 0.06123027951,
- 0.00326841651, 0.31401440501, 0.62353414297, 0.05919086933,
- 0.00349264755, 0.31939238310, 0.61992025375, 0.05720067024,
- 0.00372874714, 0.32479602098, 0.61622029543, 0.05525910854,
- 0.00397720048, 0.33022382855, 0.61243581772, 0.05336561054,
- 0.00423829490, 0.33567428589, 0.60856848955, 0.05151961371,
- 0.00451271003, 0.34114575386, 0.60462015867, 0.04972046614,
- 0.00480085658, 0.34663668275, 0.60059231520, 0.04796761274,
- 0.00510312291, 0.35214546323, 0.59648692608, 0.04626038298,
- 0.00542017492, 0.35767036676, 0.59230577946, 0.04459818453,
- 0.00575236930, 0.36320972443, 0.58805054426, 0.04298033938,
- 0.00610029325, 0.36876192689, 0.58372318745, 0.04140623659,
- 0.00646453211, 0.37432509661, 0.57932555676, 0.03987516090,
- 0.00684553990, 0.37989753485, 0.57485944033, 0.03838652745,
- 0.00724391919, 0.38547745347, 0.57032698393, 0.03693958372,
- 0.00766016589, 0.39106300473, 0.56572991610, 0.03553372994,
- 0.00809498038, 0.39665243030, 0.56107026339, 0.03416819125,
- 0.00854881573, 0.40224379301, 0.55634999275, 0.03284239396,
- 0.00902230106, 0.40783521533, 0.55157101154, 0.03155555204,
- 0.00951600447, 0.41342487931, 0.54673534632, 0.03030703776,
- 0.01003060210, 0.41901078820, 0.54184508324, 0.02909611352,
- 0.01056654565, 0.42459106445, 0.53690224886, 0.02792212367,
- 0.01112466771, 0.43016362190, 0.53190881014, 0.02678431384,
- 0.01170534454, 0.43572667241, 0.52686679363, 0.02568206564,
- 0.01230939943, 0.44127810001, 0.52177828550, 0.02461459488,
- 0.01293735672, 0.44681602716, 0.51664537191, 0.02358125709,
- 0.01358995494, 0.45233830810, 0.51147013903, 0.02258131653,
- 0.01426773332, 0.45784294605, 0.50625455379, 0.02161412500,
- 0.01497144438, 0.46332800388, 0.50100076199, 0.02067894675,
- 0.01570170000, 0.46879136562, 0.49571081996, 0.01977507770,
- 0.01645922661, 0.47423094511, 0.49038675427, 0.01890186779,
- 0.01724460535, 0.47964480519, 0.48503074050, 0.01805862412,
-};
-
-/* 10^-(dB/20), with dB being a list of dB values ranging from 0 to -72 */
-/* do a 20*log10(dca_downmix_coeffs) to reconvert the values */
-
-static const float dca_downmix_coeffs[65] = {
- 1.000000000000000, 0.988553094656939, 0.971627951577106, 0.944060876285923, 0.917275935389780, 0.891250938133746,
- 0.865964323360065, 0.841395141645195, 0.817523037943650, 0.794328234724281, 0.771791515585012, 0.749894209332456,
- 0.728618174513228, 0.707945784384138, 0.687859912308808, 0.668343917568615, 0.649381631576211, 0.630957344480193,
- 0.613055792149821, 0.595662143529010, 0.578761988349121, 0.562341325190349, 0.546386549881854, 0.530884444230988,
- 0.515822165072306, 0.501187233627272, 0.446683592150963, 0.398107170553497, 0.354813389233575, 0.316227766016838,
- 0.281838293126445, 0.251188643150958, 0.223872113856834, 0.199526231496888, 0.177827941003892, 0.158489319246111,
- 0.141253754462275, 0.125892541179417, 0.112201845430196, 0.100000000000000, 0.089125093813374, 0.079432823472428,
- 0.070794578438414, 0.063095734448019, 0.053088444423099, 0.044668359215096, 0.037583740428844, 0.031622776601684,
- 0.026607250597988, 0.022387211385683, 0.018836490894898, 0.015848931924611, 0.013335214321633, 0.011220184543020,
- 0.009440608762859, 0.007943282347243, 0.005623413251903, 0.003981071705535, 0.002818382931264, 0.001995262314969,
- 0.001412537544623, 0.001000000000000, 0.000501187233627, 0.000251188643151, 0.000000000000000,
-};
-
-static const float dca_downmix_scale_factors[241] = {
- 0.001000, 0.001059, 0.001122, 0.001189, 0.001259, 0.001334, 0.001413, 0.001496,
- 0.001585, 0.001679, 0.001778, 0.001884, 0.001995, 0.002113, 0.002239, 0.002371,
- 0.002512, 0.002661, 0.002818, 0.002985, 0.003162, 0.003350, 0.003548, 0.003758,
- 0.003981, 0.004217, 0.004467, 0.004732, 0.005012, 0.005309, 0.005623, 0.005957,
- 0.006310, 0.006683, 0.007079, 0.007499, 0.007943, 0.008414, 0.008913, 0.009441,
- 0.010000, 0.010593, 0.011220, 0.011885, 0.012589, 0.013335, 0.014125, 0.014962,
- 0.015849, 0.016788, 0.017783, 0.018836, 0.019953, 0.021135, 0.022387, 0.023714,
- 0.025119, 0.026607, 0.028184, 0.029854, 0.031623, 0.032546, 0.033497, 0.034475,
- 0.035481, 0.036517, 0.037584, 0.038681, 0.039811, 0.040973, 0.042170, 0.043401,
- 0.044668, 0.045973, 0.047315, 0.048697, 0.050119, 0.051582, 0.053088, 0.054639,
- 0.056234, 0.057876, 0.059566, 0.061306, 0.063096, 0.064938, 0.066834, 0.068786,
- 0.070795, 0.072862, 0.074989, 0.077179, 0.079433, 0.081752, 0.084140, 0.086596,
- 0.089125, 0.091728, 0.094406, 0.097163, 0.100000, 0.102920, 0.105925, 0.109018,
- 0.112202, 0.115478, 0.118850, 0.122321, 0.125893, 0.129569, 0.133352, 0.137246,
- 0.141254, 0.145378, 0.149624, 0.153993, 0.158489, 0.163117, 0.167880, 0.172783,
- 0.177828, 0.180406, 0.183021, 0.185674, 0.188365, 0.191095, 0.193865, 0.196675,
- 0.199526, 0.202418, 0.205353, 0.208329, 0.211349, 0.214412, 0.217520, 0.220673,
- 0.223872, 0.227117, 0.230409, 0.233749, 0.237137, 0.240575, 0.244062, 0.247600,
- 0.251189, 0.254830, 0.258523, 0.262271, 0.266073, 0.269929, 0.273842, 0.277811,
- 0.281838, 0.285924, 0.290068, 0.294273, 0.298538, 0.302866, 0.307256, 0.311709,
- 0.316228, 0.320812, 0.325462, 0.330179, 0.334965, 0.339821, 0.344747, 0.349744,
- 0.354813, 0.359956, 0.365174, 0.370467, 0.375837, 0.381285, 0.386812, 0.392419,
- 0.398107, 0.403878, 0.409732, 0.415671, 0.421697, 0.427809, 0.434010, 0.440301,
- 0.446684, 0.453158, 0.459727, 0.466391, 0.473151, 0.480010, 0.486968, 0.494026,
- 0.501187, 0.508452, 0.515822, 0.523299, 0.530884, 0.538580, 0.546387, 0.554307,
- 0.562341, 0.570493, 0.578762, 0.587151, 0.595662, 0.604296, 0.613056, 0.621942,
- 0.630957, 0.640103, 0.649382, 0.658795, 0.668344, 0.678032, 0.687860, 0.697831,
- 0.707107, 0.718208, 0.728618, 0.739180, 0.749894, 0.760764, 0.771792, 0.782979,
- 0.794328, 0.805842, 0.817523, 0.829373, 0.841395, 0.853591, 0.865964, 0.878517,
- 0.891251, 0.904170, 0.917276, 0.930572, 0.944061, 0.957745, 0.971628, 0.985712,
- 1.000000
-};
-
-static const uint8_t dca_default_coeffs[10][5][2] = {
- { { 13, 13 }, },
- { { 0, 64 }, { 64, 0 }, },
- { { 0, 64 }, { 64, 0 }, },
- { { 0, 64 }, { 64, 0 }, },
- { { 0, 64 }, { 64, 0 }, },
- { { 6, 6 }, { 0, 25 }, { 25, 0 }, },
- { { 0, 25 }, { 25, 0 }, { 13, 13 }, },
- { { 6, 6 }, { 0, 25 }, { 25, 0 }, { 13, 13 }, },
- { { 0, 25 }, { 25, 0 }, { 0, 13 }, { 13, 0 }, },
- { { 6, 6 }, { 0, 25 }, { 25, 0 }, { 0, 13 }, { 13, 0 }, },
-};
-
-/* downmix coeffs
-
- TABLE 9
-______________________________________
-Down-mix coefficients for 8-channel source
-audio (5 + 3 format)
- lt
- cen- rt lt ctr rt
-lt ter ctr center
- rt srd srd srd
-______________________________________
-1 0.71 0.74 1.0 0.71 0.71 0.58 0.58 0.58
-2 left 1.0 0.89 0.71 0.46 0.71 0.50
- rt 0.45 0.71 0.89 1.0 0.50 0.71
-3 lt 1.0 0.89 0.71 0.45
- rt 0.45 0.71 0.89 1.0
- srd 0.71 0.71 0.71
-4 lt 1.0 0.89 0.71 0.45
- rt 0.45 0.71 0.89 1.0
- lt srd 1.0 0.71
- rt srd 0.71 0.71
-4 lt 1.0 0.5
- ctr 0.87 1.0 0.87
- rt 0.5 1.0
- srd 0.71 0.71 0.71
-5 lt 1.0 0.5
- ctr 0.87 1.0 0.87
- rt 0.5 1.0
- lt srd 1.0 0.71
- rt srd 0.71 1.0
-6 lt 1.0 0.5
- lt ctr 0.87 0.71
- rt ctr 0.71 0.87
- rt 0.5 1.0
- lt srd 1.0 0.71
- rt srd 0.71 1.0
-6 lt 1.0 0.5
- ctr 0.86 1.0 0.86
- rt 0.5 1.0
- lt srd 1.0
- ctr srd 1.0
- rt srd 1.0
-7 lt 1.0
- lt ctr 1.0
- ctr 1.0
- rt ctr 1.0
- rt 1.0
- lt srd 1.0 0.71
- rt srd 0.71 1.0
-7 lt 1.0 0.5
- lt ctr 0.87 0.71
- rt ctr 0.71 0.87
- rt 0.5 1.0
- lt srd 1.0
- ctr srd 1.0
- rt srd 1.0
-8 lt 1.0 0.5
- lt ctr 0.87 0.71
- rt ctr 0.71 0.87
- rt 0.5 1.0
- lt 1 srd 0.87 0.35
- lt 2 srd 0.5 0.61
- rt 2 srd 0.61 0.50
- rt 2 srd 0.35 0.87
-
- Generation of Lt Rt
-
-In the case when the playback system has analog or digital surround multi-channel capability, a down matrix from 5, 4, or 3 channel to Lt Rt may be desirable. In the case when the number of decoded audio channels exceeds 5, 4 or 3 respectively a first stage down mix to 5, 4 or 3 chs should be used as described above.
-
-The down matrixing equations for 5-channel source audio to a two-channel Lt Rt playback system are given by:
-
-Left left+0.7*center-0.7*(lt surround+rt surround)
-
-Right=right+0.7*center+0.7*(lt surround+rt surround)
-
-Embedded mixing to 2-channel
-
-One concern arising from the proliferation of multi-channel audio systems is that most home systems presently have only two channel playback capability. To accommodate this a fixed 2-channel down matrix processes is commonly used following the multi-channel decoding stage. However, for music only applications the image quality etc. of the down matrixed signal may not match that of an equivalent stereo recording found on CD.
-
-The concept of embedded mixing is to allow the producer to dynamically specify the matrixing coefficients within the audio frame itself. In this way the stereo down mix at the decoder may be better matched to a 2-channel playback environment.
-
-CHS*2, 7-bit down mix indexes (MCOEFFS) are transmitted along with the multi-channel audio once in every frame. The indexes are converted to attenuation factors using a 7 bit LUT. The 2-ch down mix equations are as follows,
-
-Left Ch=sum (MCOEFF[n]*Ch[n]) for n=1, CHS
-
-Right Ch sum (MCOEFF[n+CHS]*Ch[n]) for n=1, CHS
-
-where Ch(n) represents the subband samples in the (n)th audio channel.
-
-
-*/
-
-#endif /* AVCODEC_DCADATA_H */
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
deleted file mode 100644
index 613e60b..0000000
--- a/libavcodec/dcadec.c
+++ b/dev/null
@@ -1,2521 +0,0 @@
-/*
- * DCA compatible decoder
- * Copyright (C) 2004 Gildas Bazin
- * Copyright (C) 2004 Benjamin Zores
- * Copyright (C) 2006 Benjamin Larsson
- * Copyright (C) 2007 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 <math.h>
-#include <stddef.h>
-#include <stdio.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/float_dsp.h"
-#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/samplefmt.h"
-#include "avcodec.h"
-#include "fft.h"
-#include "get_bits.h"
-#include "dcadata.h"
-#include "dcahuff.h"
-#include "dca.h"
-#include "mathops.h"
-#include "synth_filter.h"
-#include "dcadsp.h"
-#include "fmtconvert.h"
-#include "internal.h"
-
-#if ARCH_ARM
-# include "arm/dca.h"
-#endif
-
-//#define TRACE
-
-#define DCA_PRIM_CHANNELS_MAX (7)
-#define DCA_SUBBANDS (64)
-#define DCA_ABITS_MAX (32) /* Should be 28 */
-#define DCA_SUBSUBFRAMES_MAX (4)
-#define DCA_SUBFRAMES_MAX (16)
-#define DCA_BLOCKS_MAX (16)
-#define DCA_LFE_MAX (3)
-#define DCA_CHSETS_MAX (4)
-#define DCA_CHSET_CHANS_MAX (8)
-
-enum DCAMode {
- DCA_MONO = 0,
- DCA_CHANNEL,
- DCA_STEREO,
- DCA_STEREO_SUMDIFF,
- DCA_STEREO_TOTAL,
- DCA_3F,
- DCA_2F1R,
- DCA_3F1R,
- DCA_2F2R,
- DCA_3F2R,
- DCA_4F2R
-};
-
-/* these are unconfirmed but should be mostly correct */
-enum DCAExSSSpeakerMask {
- DCA_EXSS_FRONT_CENTER = 0x0001,
- DCA_EXSS_FRONT_LEFT_RIGHT = 0x0002,
- DCA_EXSS_SIDE_REAR_LEFT_RIGHT = 0x0004,
- DCA_EXSS_LFE = 0x0008,
- DCA_EXSS_REAR_CENTER = 0x0010,
- DCA_EXSS_FRONT_HIGH_LEFT_RIGHT = 0x0020,
- DCA_EXSS_REAR_LEFT_RIGHT = 0x0040,
- DCA_EXSS_FRONT_HIGH_CENTER = 0x0080,
- DCA_EXSS_OVERHEAD = 0x0100,
- DCA_EXSS_CENTER_LEFT_RIGHT = 0x0200,
- DCA_EXSS_WIDE_LEFT_RIGHT = 0x0400,
- DCA_EXSS_SIDE_LEFT_RIGHT = 0x0800,
- DCA_EXSS_LFE2 = 0x1000,
- DCA_EXSS_SIDE_HIGH_LEFT_RIGHT = 0x2000,
- DCA_EXSS_REAR_HIGH_CENTER = 0x4000,
- DCA_EXSS_REAR_HIGH_LEFT_RIGHT = 0x8000,
-};
-
-enum DCAXxchSpeakerMask {
- DCA_XXCH_FRONT_CENTER = 0x0000001,
- DCA_XXCH_FRONT_LEFT = 0x0000002,
- DCA_XXCH_FRONT_RIGHT = 0x0000004,
- DCA_XXCH_SIDE_REAR_LEFT = 0x0000008,
- DCA_XXCH_SIDE_REAR_RIGHT = 0x0000010,
- DCA_XXCH_LFE1 = 0x0000020,
- DCA_XXCH_REAR_CENTER = 0x0000040,
- DCA_XXCH_SURROUND_REAR_LEFT = 0x0000080,
- DCA_XXCH_SURROUND_REAR_RIGHT = 0x0000100,
- DCA_XXCH_SIDE_SURROUND_LEFT = 0x0000200,
- DCA_XXCH_SIDE_SURROUND_RIGHT = 0x0000400,
- DCA_XXCH_FRONT_CENTER_LEFT = 0x0000800,
- DCA_XXCH_FRONT_CENTER_RIGHT = 0x0001000,
- DCA_XXCH_FRONT_HIGH_LEFT = 0x0002000,
- DCA_XXCH_FRONT_HIGH_CENTER = 0x0004000,
- DCA_XXCH_FRONT_HIGH_RIGHT = 0x0008000,
- DCA_XXCH_LFE2 = 0x0010000,
- DCA_XXCH_SIDE_FRONT_LEFT = 0x0020000,
- DCA_XXCH_SIDE_FRONT_RIGHT = 0x0040000,
- DCA_XXCH_OVERHEAD = 0x0080000,
- DCA_XXCH_SIDE_HIGH_LEFT = 0x0100000,
- DCA_XXCH_SIDE_HIGH_RIGHT = 0x0200000,
- DCA_XXCH_REAR_HIGH_CENTER = 0x0400000,
- DCA_XXCH_REAR_HIGH_LEFT = 0x0800000,
- DCA_XXCH_REAR_HIGH_RIGHT = 0x1000000,
- DCA_XXCH_REAR_LOW_CENTER = 0x2000000,
- DCA_XXCH_REAR_LOW_LEFT = 0x4000000,
- DCA_XXCH_REAR_LOW_RIGHT = 0x8000000,
-};
-
-static const uint32_t map_xxch_to_native[28] = {
- AV_CH_FRONT_CENTER,
- AV_CH_FRONT_LEFT,
- AV_CH_FRONT_RIGHT,
- AV_CH_SIDE_LEFT,
- AV_CH_SIDE_RIGHT,
- AV_CH_LOW_FREQUENCY,
- AV_CH_BACK_CENTER,
- AV_CH_BACK_LEFT,
- AV_CH_BACK_RIGHT,
- AV_CH_SIDE_LEFT, /* side surround left -- dup sur side L */
- AV_CH_SIDE_RIGHT, /* side surround right -- dup sur side R */
- AV_CH_FRONT_LEFT_OF_CENTER,
- AV_CH_FRONT_RIGHT_OF_CENTER,
- AV_CH_TOP_FRONT_LEFT,
- AV_CH_TOP_FRONT_CENTER,
- AV_CH_TOP_FRONT_RIGHT,
- AV_CH_LOW_FREQUENCY, /* lfe2 -- duplicate lfe1 position */
- AV_CH_FRONT_LEFT_OF_CENTER, /* side front left -- dup front cntr L */
- AV_CH_FRONT_RIGHT_OF_CENTER,/* side front right -- dup front cntr R */
- AV_CH_TOP_CENTER, /* overhead */
- AV_CH_TOP_FRONT_LEFT, /* side high left -- dup */
- AV_CH_TOP_FRONT_RIGHT, /* side high right -- dup */
- AV_CH_TOP_BACK_CENTER,
- AV_CH_TOP_BACK_LEFT,
- AV_CH_TOP_BACK_RIGHT,
- AV_CH_BACK_CENTER, /* rear low center -- dup */
- AV_CH_BACK_LEFT, /* rear low left -- dup */
- AV_CH_BACK_RIGHT /* read low right -- dup */
-};
-
-enum DCAExtensionMask {
- DCA_EXT_CORE = 0x001, ///< core in core substream
- DCA_EXT_XXCH = 0x002, ///< XXCh channels extension in core substream
- DCA_EXT_X96 = 0x004, ///< 96/24 extension in core substream
- DCA_EXT_XCH = 0x008, ///< XCh channel extension in core substream
- DCA_EXT_EXSS_CORE = 0x010, ///< core in ExSS (extension substream)
- DCA_EXT_EXSS_XBR = 0x020, ///< extended bitrate extension in ExSS
- DCA_EXT_EXSS_XXCH = 0x040, ///< XXCh channels extension in ExSS
- DCA_EXT_EXSS_X96 = 0x080, ///< 96/24 extension in ExSS
- DCA_EXT_EXSS_LBR = 0x100, ///< low bitrate component in ExSS
- DCA_EXT_EXSS_XLL = 0x200, ///< lossless extension in ExSS
-};
-
-/* -1 are reserved or unknown */
-static const int dca_ext_audio_descr_mask[] = {
- DCA_EXT_XCH,
- -1,
- DCA_EXT_X96,
- DCA_EXT_XCH | DCA_EXT_X96,
- -1,
- -1,
- DCA_EXT_XXCH,
- -1,
-};
-
-/* extensions that reside in core substream */
-#define DCA_CORE_EXTS (DCA_EXT_XCH | DCA_EXT_XXCH | DCA_EXT_X96)
-
-/* Tables for mapping dts channel configurations to libavcodec multichannel api.
- * Some compromises have been made for special configurations. Most configurations
- * are never used so complete accuracy is not needed.
- *
- * L = left, R = right, C = center, S = surround, F = front, R = rear, T = total, OV = overhead.
- * S -> side, when both rear and back are configured move one of them to the side channel
- * OV -> center back
- * All 2 channel configurations -> AV_CH_LAYOUT_STEREO
- */
-static const uint64_t dca_core_channel_layout[] = {
- AV_CH_FRONT_CENTER, ///< 1, A
- AV_CH_LAYOUT_STEREO, ///< 2, A + B (dual mono)
- AV_CH_LAYOUT_STEREO, ///< 2, L + R (stereo)
- AV_CH_LAYOUT_STEREO, ///< 2, (L + R) + (L - R) (sum-difference)
- AV_CH_LAYOUT_STEREO, ///< 2, LT + RT (left and right total)
- AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER, ///< 3, C + L + R
- AV_CH_LAYOUT_STEREO | AV_CH_BACK_CENTER, ///< 3, L + R + S
- AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER | AV_CH_BACK_CENTER, ///< 4, C + L + R + S
- AV_CH_LAYOUT_STEREO | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT, ///< 4, L + R + SL + SR
-
- AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER | AV_CH_SIDE_LEFT |
- AV_CH_SIDE_RIGHT, ///< 5, C + L + R + SL + SR
-
- AV_CH_LAYOUT_STEREO | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT |
- AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER, ///< 6, CL + CR + L + R + SL + SR
-
- AV_CH_LAYOUT_STEREO | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT |
- AV_CH_FRONT_CENTER | AV_CH_BACK_CENTER, ///< 6, C + L + R + LR + RR + OV
-
- AV_CH_FRONT_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER |
- AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_BACK_CENTER |
- AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT, ///< 6, CF + CR + LF + RF + LR + RR
-
- AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_CENTER |
- AV_CH_FRONT_RIGHT_OF_CENTER | AV_CH_LAYOUT_STEREO |
- AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT, ///< 7, CL + C + CR + L + R + SL + SR
-
- AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER |
- AV_CH_LAYOUT_STEREO | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT |
- AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT, ///< 8, CL + CR + L + R + SL1 + SL2 + SR1 + SR2
-
- AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_CENTER |
- AV_CH_FRONT_RIGHT_OF_CENTER | AV_CH_LAYOUT_STEREO |
- AV_CH_SIDE_LEFT | AV_CH_BACK_CENTER | AV_CH_SIDE_RIGHT, ///< 8, CL + C + CR + L + R + SL + S + SR
-};
-
-static const int8_t dca_lfe_index[] = {
- 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 1, 3, 2, 3
-};
-
-static const int8_t dca_channel_reorder_lfe[][9] = {
- { 0, -1, -1, -1, -1, -1, -1, -1, -1},
- { 0, 1, -1, -1, -1, -1, -1, -1, -1},
- { 0, 1, -1, -1, -1, -1, -1, -1, -1},
- { 0, 1, -1, -1, -1, -1, -1, -1, -1},
- { 0, 1, -1, -1, -1, -1, -1, -1, -1},
- { 2, 0, 1, -1, -1, -1, -1, -1, -1},
- { 0, 1, 3, -1, -1, -1, -1, -1, -1},
- { 2, 0, 1, 4, -1, -1, -1, -1, -1},
- { 0, 1, 3, 4, -1, -1, -1, -1, -1},
- { 2, 0, 1, 4, 5, -1, -1, -1, -1},
- { 3, 4, 0, 1, 5, 6, -1, -1, -1},
- { 2, 0, 1, 4, 5, 6, -1, -1, -1},
- { 0, 6, 4, 5, 2, 3, -1, -1, -1},
- { 4, 2, 5, 0, 1, 6, 7, -1, -1},
- { 5, 6, 0, 1, 7, 3, 8, 4, -1},
- { 4, 2, 5, 0, 1, 6, 8, 7, -1},
-};
-
-static const int8_t dca_channel_reorder_lfe_xch[][9] = {
- { 0, 2, -1, -1, -1, -1, -1, -1, -1},
- { 0, 1, 3, -1, -1, -1, -1, -1, -1},
- { 0, 1, 3, -1, -1, -1, -1, -1, -1},
- { 0, 1, 3, -1, -1, -1, -1, -1, -1},
- { 0, 1, 3, -1, -1, -1, -1, -1, -1},
- { 2, 0, 1, 4, -1, -1, -1, -1, -1},
- { 0, 1, 3, 4, -1, -1, -1, -1, -1},
- { 2, 0, 1, 4, 5, -1, -1, -1, -1},
- { 0, 1, 4, 5, 3, -1, -1, -1, -1},
- { 2, 0, 1, 5, 6, 4, -1, -1, -1},
- { 3, 4, 0, 1, 6, 7, 5, -1, -1},
- { 2, 0, 1, 4, 5, 6, 7, -1, -1},
- { 0, 6, 4, 5, 2, 3, 7, -1, -1},
- { 4, 2, 5, 0, 1, 7, 8, 6, -1},
- { 5, 6, 0, 1, 8, 3, 9, 4, 7},
- { 4, 2, 5, 0, 1, 6, 9, 8, 7},
-};
-
-static const int8_t dca_channel_reorder_nolfe[][9] = {
- { 0, -1, -1, -1, -1, -1, -1, -1, -1},
- { 0, 1, -1, -1, -1, -1, -1, -1, -1},
- { 0, 1, -1, -1, -1, -1, -1, -1, -1},
- { 0, 1, -1, -1, -1, -1, -1, -1, -1},
- { 0, 1, -1, -1, -1, -1, -1, -1, -1},
- { 2, 0, 1, -1, -1, -1, -1, -1, -1},
- { 0, 1, 2, -1, -1, -1, -1, -1, -1},
- { 2, 0, 1, 3, -1, -1, -1, -1, -1},
- { 0, 1, 2, 3, -1, -1, -1, -1, -1},
- { 2, 0, 1, 3, 4, -1, -1, -1, -1},
- { 2, 3, 0, 1, 4, 5, -1, -1, -1},
- { 2, 0, 1, 3, 4, 5, -1, -1, -1},
- { 0, 5, 3, 4, 1, 2, -1, -1, -1},
- { 3, 2, 4, 0, 1, 5, 6, -1, -1},
- { 4, 5, 0, 1, 6, 2, 7, 3, -1},
- { 3, 2, 4, 0, 1, 5, 7, 6, -1},
-};
-
-static const int8_t dca_channel_reorder_nolfe_xch[][9] = {
- { 0, 1, -1, -1, -1, -1, -1, -1, -1},
- { 0, 1, 2, -1, -1, -1, -1, -1, -1},
- { 0, 1, 2, -1, -1, -1, -1, -1, -1},
- { 0, 1, 2, -1, -1, -1, -1, -1, -1},
- { 0, 1, 2, -1, -1, -1, -1, -1, -1},
- { 2, 0, 1, 3, -1, -1, -1, -1, -1},
- { 0, 1, 2, 3, -1, -1, -1, -1, -1},
- { 2, 0, 1, 3, 4, -1, -1, -1, -1},
- { 0, 1, 3, 4, 2, -1, -1, -1, -1},
- { 2, 0, 1, 4, 5, 3, -1, -1, -1},
- { 2, 3, 0, 1, 5, 6, 4, -1, -1},
- { 2, 0, 1, 3, 4, 5, 6, -1, -1},
- { 0, 5, 3, 4, 1, 2, 6, -1, -1},
- { 3, 2, 4, 0, 1, 6, 7, 5, -1},
- { 4, 5, 0, 1, 7, 2, 8, 3, 6},
- { 3, 2, 4, 0, 1, 5, 8, 7, 6},
-};
-
-#define DCA_DOLBY 101 /* FIXME */
-
-#define DCA_CHANNEL_BITS 6
-#define DCA_CHANNEL_MASK 0x3F
-
-#define DCA_LFE 0x80
-
-#define HEADER_SIZE 14
-
-#define DCA_MAX_FRAME_SIZE 16384
-#define DCA_MAX_EXSS_HEADER_SIZE 4096
-
-#define DCA_BUFFER_PADDING_SIZE 1024
-
-/** Bit allocation */
-typedef struct {
- int offset; ///< code values offset
- int maxbits[8]; ///< max bits in VLC
- int wrap; ///< wrap for get_vlc2()
- VLC vlc[8]; ///< actual codes
-} BitAlloc;
-
-static BitAlloc dca_bitalloc_index; ///< indexes for samples VLC select
-static BitAlloc dca_tmode; ///< transition mode VLCs
-static BitAlloc dca_scalefactor; ///< scalefactor VLCs
-static BitAlloc dca_smpl_bitalloc[11]; ///< samples VLCs
-
-static av_always_inline int get_bitalloc(GetBitContext *gb, BitAlloc *ba,
- int idx)
-{
- return get_vlc2(gb, ba->vlc[idx].table, ba->vlc[idx].bits, ba->wrap) +
- ba->offset;
-}
-
-typedef struct {
- AVCodecContext *avctx;
- /* 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 bit_rate_index; ///< transmission bit rate index
-
- 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 total_channels; ///< number of channels including extensions
- int prim_channels; ///< number of primary audio channels
- int subband_activity[DCA_PRIM_CHANNELS_MAX]; ///< subband activity count
- int vq_start_subband[DCA_PRIM_CHANNELS_MAX]; ///< high frequency vq start subband
- int joint_intensity[DCA_PRIM_CHANNELS_MAX]; ///< joint intensity coding index
- int transient_huffman[DCA_PRIM_CHANNELS_MAX]; ///< transient mode code book
- int scalefactor_huffman[DCA_PRIM_CHANNELS_MAX]; ///< scale factor code book
- int bitalloc_huffman[DCA_PRIM_CHANNELS_MAX]; ///< bit allocation quantizer select
- int quant_index_huffman[DCA_PRIM_CHANNELS_MAX][DCA_ABITS_MAX]; ///< quantization index codebook select
- float scalefactor_adj[DCA_PRIM_CHANNELS_MAX][DCA_ABITS_MAX]; ///< scale factor adjustment
-
- /* Primary audio coding side information */
- int subsubframes[DCA_SUBFRAMES_MAX]; ///< number of subsubframes
- int partial_samples[DCA_SUBFRAMES_MAX]; ///< partial subsubframe samples count
- int prediction_mode[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< prediction mode (ADPCM used or not)
- int prediction_vq[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< prediction VQ coefs
- int bitalloc[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< bit allocation index
- int transition_mode[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< transition mode (transients)
- int scale_factor[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][2]; ///< scale factors (2 if transient)
- int joint_huff[DCA_PRIM_CHANNELS_MAX]; ///< joint subband scale factors codebook
- int joint_scale_factor[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< joint subband scale factors
- int downmix_coef[DCA_PRIM_CHANNELS_MAX][2]; ///< stereo downmix coefficients
- int dynrange_coef; ///< dynamic range coefficient
-
- int high_freq_vq[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< VQ encoded high frequency subbands
-
- float lfe_data[2 * DCA_LFE_MAX * (DCA_BLOCKS_MAX + 4)]; ///< Low frequency effect data
- int lfe_scale_factor;
-
- /* Subband samples history (for ADPCM) */
- DECLARE_ALIGNED(16, float, subband_samples_hist)[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][4];
- DECLARE_ALIGNED(32, float, subband_fir_hist)[DCA_PRIM_CHANNELS_MAX][512];
- DECLARE_ALIGNED(32, float, subband_fir_noidea)[DCA_PRIM_CHANNELS_MAX][32];
- int hist_index[DCA_PRIM_CHANNELS_MAX];
- DECLARE_ALIGNED(32, float, raXin)[32];
-
- int output; ///< type of output
-
- DECLARE_ALIGNED(32, float, subband_samples)[DCA_BLOCKS_MAX][DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][8];
- float *samples_chanptr[DCA_PRIM_CHANNELS_MAX + 1];
- float *extra_channels[DCA_PRIM_CHANNELS_MAX + 1];
- uint8_t *extra_channels_buffer;
- unsigned int extra_channels_buffer_size;
-
- uint8_t dca_buffer[DCA_MAX_FRAME_SIZE + DCA_MAX_EXSS_HEADER_SIZE + DCA_BUFFER_PADDING_SIZE];
- int dca_buffer_size; ///< how much data is in the dca_buffer
-
- const int8_t *channel_order_tab; ///< channel reordering table, lfe and non lfe
- GetBitContext gb;
- /* Current position in DCA frame */
- int current_subframe;
- int current_subsubframe;
-
- int core_ext_mask; ///< present extensions in the core substream
-
- /* XCh extension information */
- int xch_present; ///< XCh extension present and valid
- int xch_base_channel; ///< index of first (only) channel containing XCH data
-
- /* XXCH extension information */
- int xxch_chset;
- int xxch_nbits_spk_mask;
- uint32_t xxch_core_spkmask;
- uint32_t xxch_spk_masks[4]; /* speaker masks, last element is core mask */
- int xxch_chset_nch[4];
- float xxch_dmix_sf[DCA_CHSETS_MAX];
-
- uint32_t xxch_dmix_embedded; /* lower layer has mix pre-embedded, per chset */
- float xxch_dmix_coeff[DCA_PRIM_CHANNELS_MAX][32]; /* worst case sizing */
-
- int8_t xxch_order_tab[32];
- int8_t lfe_index;
-
- /* ExSS header parser */
- int static_fields; ///< static fields present
- int mix_metadata; ///< mixing metadata present
- int num_mix_configs; ///< number of mix out configurations
- int mix_config_num_ch[4]; ///< number of channels in each mix out configuration
-
- int profile;
-
- int debug_flag; ///< used for suppressing repeated error messages output
- AVFloatDSPContext fdsp;
- FFTContext imdct;
- SynthFilterContext synth;
- DCADSPContext dcadsp;
- FmtConvertContext fmt_conv;
-} DCAContext;
-
-static const uint16_t dca_vlc_offs[] = {
- 0, 512, 640, 768, 1282, 1794, 2436, 3080, 3770, 4454, 5364,
- 5372, 5380, 5388, 5392, 5396, 5412, 5420, 5428, 5460, 5492, 5508,
- 5572, 5604, 5668, 5796, 5860, 5892, 6412, 6668, 6796, 7308, 7564,
- 7820, 8076, 8620, 9132, 9388, 9910, 10166, 10680, 11196, 11726, 12240,
- 12752, 13298, 13810, 14326, 14840, 15500, 16022, 16540, 17158, 17678, 18264,
- 18796, 19352, 19926, 20468, 21472, 22398, 23014, 23622,
-};
-
-static av_cold void dca_init_vlcs(void)
-{
- static int vlcs_initialized = 0;
- int i, j, c = 14;
- static VLC_TYPE dca_table[23622][2];
-
- if (vlcs_initialized)
- return;
-
- dca_bitalloc_index.offset = 1;
- dca_bitalloc_index.wrap = 2;
- for (i = 0; i < 5; i++) {
- dca_bitalloc_index.vlc[i].table = &dca_table[dca_vlc_offs[i]];
- dca_bitalloc_index.vlc[i].table_allocated = dca_vlc_offs[i + 1] - dca_vlc_offs[i];
- init_vlc(&dca_bitalloc_index.vlc[i], bitalloc_12_vlc_bits[i], 12,
- bitalloc_12_bits[i], 1, 1,
- bitalloc_12_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
- }
- dca_scalefactor.offset = -64;
- dca_scalefactor.wrap = 2;
- for (i = 0; i < 5; i++) {
- dca_scalefactor.vlc[i].table = &dca_table[dca_vlc_offs[i + 5]];
- dca_scalefactor.vlc[i].table_allocated = dca_vlc_offs[i + 6] - dca_vlc_offs[i + 5];
- init_vlc(&dca_scalefactor.vlc[i], SCALES_VLC_BITS, 129,
- scales_bits[i], 1, 1,
- scales_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
- }
- dca_tmode.offset = 0;
- dca_tmode.wrap = 1;
- for (i = 0; i < 4; i++) {
- dca_tmode.vlc[i].table = &dca_table[dca_vlc_offs[i + 10]];
- dca_tmode.vlc[i].table_allocated = dca_vlc_offs[i + 11] - dca_vlc_offs[i + 10];
- init_vlc(&dca_tmode.vlc[i], tmode_vlc_bits[i], 4,
- tmode_bits[i], 1, 1,
- tmode_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
- }
-
- for (i = 0; i < 10; i++)
- for (j = 0; j < 7; j++) {
- if (!bitalloc_codes[i][j])
- break;
- dca_smpl_bitalloc[i + 1].offset = bitalloc_offsets[i];
- dca_smpl_bitalloc[i + 1].wrap = 1 + (j > 4);
- dca_smpl_bitalloc[i + 1].vlc[j].table = &dca_table[dca_vlc_offs[c]];
- dca_smpl_bitalloc[i + 1].vlc[j].table_allocated = dca_vlc_offs[c + 1] - dca_vlc_offs[c];
-
- init_vlc(&dca_smpl_bitalloc[i + 1].vlc[j], bitalloc_maxbits[i][j],
- bitalloc_sizes[i],
- bitalloc_bits[i][j], 1, 1,
- bitalloc_codes[i][j], 2, 2, INIT_VLC_USE_NEW_STATIC);
- c++;
- }
- vlcs_initialized = 1;
-}
-
-static inline void get_array(GetBitContext *gb, int *dst, int len, int bits)
-{
- while (len--)
- *dst++ = get_bits(gb, bits);
-}
-
-static inline int dca_xxch2index(DCAContext *s, int xxch_ch)
-{
- int i, base, mask;
-
- /* locate channel set containing the channel */
- for (i = -1, base = 0, mask = (s->xxch_core_spkmask & ~DCA_XXCH_LFE1);
- i <= s->xxch_chset && !(mask & xxch_ch); mask = s->xxch_spk_masks[++i])
- base += av_popcount(mask);
-
- return base + av_popcount(mask & (xxch_ch - 1));
-}
-
-static int dca_parse_audio_coding_header(DCAContext *s, int base_channel,
- int xxch)
-{
- int i, j;
- static const float adj_table[4] = { 1.0, 1.1250, 1.2500, 1.4375 };
- static const int bitlen[11] = { 0, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3 };
- static const int thr[11] = { 0, 1, 3, 3, 3, 3, 7, 7, 7, 7, 7 };
- int hdr_pos = 0, hdr_size = 0;
- float sign, mag, scale_factor;
- int this_chans, acc_mask;
- int embedded_downmix;
- int nchans, mask[8];
- int coeff, ichan;
-
- /* xxch has arbitrary sized audio coding headers */
- if (xxch) {
- hdr_pos = get_bits_count(&s->gb);
- hdr_size = get_bits(&s->gb, 7) + 1;
- }
-
- nchans = get_bits(&s->gb, 3) + 1;
- s->total_channels = nchans + base_channel;
- s->prim_channels = s->total_channels;
-
- /* obtain speaker layout mask & downmix coefficients for XXCH */
- if (xxch) {
- acc_mask = s->xxch_core_spkmask;
-
- this_chans = get_bits(&s->gb, s->xxch_nbits_spk_mask - 6) << 6;
- s->xxch_spk_masks[s->xxch_chset] = this_chans;
- s->xxch_chset_nch[s->xxch_chset] = nchans;
-
- for (i = 0; i <= s->xxch_chset; i++)
- acc_mask |= s->xxch_spk_masks[i];
-
- /* check for downmixing information */
- if (get_bits1(&s->gb)) {
- embedded_downmix = get_bits1(&s->gb);
- scale_factor =
- 1.0f / dca_downmix_scale_factors[(get_bits(&s->gb, 6) - 1) << 2];
-
- s->xxch_dmix_sf[s->xxch_chset] = scale_factor;
-
- for (i = base_channel; i < s->prim_channels; i++) {
- mask[i] = get_bits(&s->gb, s->xxch_nbits_spk_mask);
- }
-
- for (j = base_channel; j < s->prim_channels; j++) {
- memset(s->xxch_dmix_coeff[j], 0, sizeof(s->xxch_dmix_coeff[0]));
- s->xxch_dmix_embedded |= (embedded_downmix << j);
- for (i = 0; i < s->xxch_nbits_spk_mask; i++) {
- if (mask[j] & (1 << i)) {
- if ((1 << i) == DCA_XXCH_LFE1) {
- av_log(s->avctx, AV_LOG_WARNING,
- "DCA-XXCH: dmix to LFE1 not supported.\n");
- continue;
- }
-
- coeff = get_bits(&s->gb, 7);
- sign = (coeff & 64) ? 1.0 : -1.0;
- mag = dca_downmix_scale_factors[((coeff & 63) - 1) << 2];
- ichan = dca_xxch2index(s, 1 << i);
- s->xxch_dmix_coeff[j][ichan] = sign * mag;
- }
- }
- }
- }
- }
-
- if (s->prim_channels > DCA_PRIM_CHANNELS_MAX)
- s->prim_channels = DCA_PRIM_CHANNELS_MAX;
-
-
- for (i = base_channel; i < s->prim_channels; i++) {
- s->subband_activity[i] = get_bits(&s->gb, 5) + 2;
- if (s->subband_activity[i] > DCA_SUBBANDS)
- s->subband_activity[i] = DCA_SUBBANDS;
- }
- for (i = base_channel; i < s->prim_channels; i++) {
- s->vq_start_subband[i] = get_bits(&s->gb, 5) + 1;
- if (s->vq_start_subband[i] > DCA_SUBBANDS)
- s->vq_start_subband[i] = DCA_SUBBANDS;
- }
- get_array(&s->gb, s->joint_intensity + base_channel, s->prim_channels - base_channel, 3);
- get_array(&s->gb, s->transient_huffman + base_channel, s->prim_channels - base_channel, 2);
- get_array(&s->gb, s->scalefactor_huffman + base_channel, s->prim_channels - base_channel, 3);
- get_array(&s->gb, s->bitalloc_huffman + base_channel, s->prim_channels - base_channel, 3);
-
- /* Get codebooks quantization indexes */
- if (!base_channel)
- memset(s->quant_index_huffman, 0, sizeof(s->quant_index_huffman));
- for (j = 1; j < 11; j++)
- for (i = base_channel; i < s->prim_channels; i++)
- s->quant_index_huffman[i][j] = get_bits(&s->gb, bitlen[j]);
-
- /* Get scale factor adjustment */
- for (j = 0; j < 11; j++)
- for (i = base_channel; i < s->prim_channels; i++)
- s->scalefactor_adj[i][j] = 1;
-
- for (j = 1; j < 11; j++)
- for (i = base_channel; i < s->prim_channels; i++)
- if (s->quant_index_huffman[i][j] < thr[j])
- s->scalefactor_adj[i][j] = adj_table[get_bits(&s->gb, 2)];
-
- if (!xxch) {
- if (s->crc_present) {
- /* Audio header CRC check */
- get_bits(&s->gb, 16);
- }
- } else {
- /* Skip to the end of the header, also ignore CRC if present */
- i = get_bits_count(&s->gb);
- if (hdr_pos + 8 * hdr_size > i)
- skip_bits_long(&s->gb, hdr_pos + 8 * hdr_size - i);
- }
-
- s->current_subframe = 0;
- s->current_subsubframe = 0;
-
-#ifdef TRACE
- av_log(s->avctx, AV_LOG_DEBUG, "subframes: %i\n", s->subframes);
- av_log(s->avctx, AV_LOG_DEBUG, "prim channels: %i\n", s->prim_channels);
- for (i = base_channel; i < s->prim_channels; i++) {
- av_log(s->avctx, AV_LOG_DEBUG, "subband activity: %i\n",
- s->subband_activity[i]);
- av_log(s->avctx, AV_LOG_DEBUG, "vq start subband: %i\n",
- s->vq_start_subband[i]);
- av_log(s->avctx, AV_LOG_DEBUG, "joint intensity: %i\n",
- s->joint_intensity[i]);
- av_log(s->avctx, AV_LOG_DEBUG, "transient mode codebook: %i\n",
- s->transient_huffman[i]);
- av_log(s->avctx, AV_LOG_DEBUG, "scale factor codebook: %i\n",
- s->scalefactor_huffman[i]);
- av_log(s->avctx, AV_LOG_DEBUG, "bit allocation quantizer: %i\n",
- s->bitalloc_huffman[i]);
- av_log(s->avctx, AV_LOG_DEBUG, "quant index huff:");
- for (j = 0; j < 11; j++)
- av_log(s->avctx, AV_LOG_DEBUG, " %i", s->quant_index_huffman[i][j]);
- av_log(s->avctx, AV_LOG_DEBUG, "\n");
- av_log(s->avctx, AV_LOG_DEBUG, "scalefac adj:");
- for (j = 0; j < 11; j++)
- av_log(s->avctx, AV_LOG_DEBUG, " %1.3f", s->scalefactor_adj[i][j]);
- av_log(s->avctx, AV_LOG_DEBUG, "\n");
- }
-#endif
-
- return 0;
-}
-
-static int dca_parse_frame_header(DCAContext *s)
-{
- init_get_bits(&s->gb, s->dca_buffer, s->dca_buffer_size * 8);
-
- /* Sync code */
- skip_bits_long(&s->gb, 32);
-
- /* Frame header */
- s->frame_type = get_bits(&s->gb, 1);
- s->samples_deficit = get_bits(&s->gb, 5) + 1;
- s->crc_present = get_bits(&s->gb, 1);
- s->sample_blocks = get_bits(&s->gb, 7) + 1;
- s->frame_size = get_bits(&s->gb, 14) + 1;
- if (s->frame_size < 95)
- return AVERROR_INVALIDDATA;
- s->amode = get_bits(&s->gb, 6);
- s->sample_rate = avpriv_dca_sample_rates[get_bits(&s->gb, 4)];
- if (!s->sample_rate)
- return AVERROR_INVALIDDATA;
- s->bit_rate_index = get_bits(&s->gb, 5);
- s->bit_rate = dca_bit_rates[s->bit_rate_index];
- if (!s->bit_rate)
- return AVERROR_INVALIDDATA;
-
- s->downmix = get_bits(&s->gb, 1); /* note: this is FixedBit == 0 */
- s->dynrange = get_bits(&s->gb, 1);
- s->timestamp = get_bits(&s->gb, 1);
- s->aux_data = get_bits(&s->gb, 1);
- s->hdcd = get_bits(&s->gb, 1);
- s->ext_descr = get_bits(&s->gb, 3);
- s->ext_coding = get_bits(&s->gb, 1);
- s->aspf = get_bits(&s->gb, 1);
- s->lfe = get_bits(&s->gb, 2);
- s->predictor_history = get_bits(&s->gb, 1);
-
- if (s->lfe > 2) {
- s->lfe = 0;
- av_log(s->avctx, AV_LOG_ERROR, "Invalid LFE value: %d\n", s->lfe);
- return AVERROR_INVALIDDATA;
- }
-
- /* TODO: check CRC */
- if (s->crc_present)
- s->header_crc = get_bits(&s->gb, 16);
-
- s->multirate_inter = get_bits(&s->gb, 1);
- s->version = get_bits(&s->gb, 4);
- s->copy_history = get_bits(&s->gb, 2);
- s->source_pcm_res = get_bits(&s->gb, 3);
- s->front_sum = get_bits(&s->gb, 1);
- s->surround_sum = get_bits(&s->gb, 1);
- s->dialog_norm = get_bits(&s->gb, 4);
-
- /* FIXME: channels mixing levels */
- s->output = s->amode;
- if (s->lfe)
- s->output |= DCA_LFE;
-
-#ifdef TRACE
- av_log(s->avctx, AV_LOG_DEBUG, "frame type: %i\n", s->frame_type);
- av_log(s->avctx, AV_LOG_DEBUG, "samples deficit: %i\n", s->samples_deficit);
- av_log(s->avctx, AV_LOG_DEBUG, "crc present: %i\n", s->crc_present);
- av_log(s->avctx, AV_LOG_DEBUG, "sample blocks: %i (%i samples)\n",
- s->sample_blocks, s->sample_blocks * 32);
- av_log(s->avctx, AV_LOG_DEBUG, "frame size: %i bytes\n", s->frame_size);
- av_log(s->avctx, AV_LOG_DEBUG, "amode: %i (%i channels)\n",
- s->amode, dca_channels[s->amode]);
- av_log(s->avctx, AV_LOG_DEBUG, "sample rate: %i Hz\n",
- s->sample_rate);
- av_log(s->avctx, AV_LOG_DEBUG, "bit rate: %i bits/s\n",
- s->bit_rate);
- av_log(s->avctx, AV_LOG_DEBUG, "downmix: %i\n", s->downmix);
- av_log(s->avctx, AV_LOG_DEBUG, "dynrange: %i\n", s->dynrange);
- av_log(s->avctx, AV_LOG_DEBUG, "timestamp: %i\n", s->timestamp);
- av_log(s->avctx, AV_LOG_DEBUG, "aux_data: %i\n", s->aux_data);
- av_log(s->avctx, AV_LOG_DEBUG, "hdcd: %i\n", s->hdcd);
- av_log(s->avctx, AV_LOG_DEBUG, "ext descr: %i\n", s->ext_descr);
- av_log(s->avctx, AV_LOG_DEBUG, "ext coding: %i\n", s->ext_coding);
- av_log(s->avctx, AV_LOG_DEBUG, "aspf: %i\n", s->aspf);
- av_log(s->avctx, AV_LOG_DEBUG, "lfe: %i\n", s->lfe);
- av_log(s->avctx, AV_LOG_DEBUG, "predictor history: %i\n",
- s->predictor_history);
- av_log(s->avctx, AV_LOG_DEBUG, "header crc: %i\n", s->header_crc);
- av_log(s->avctx, AV_LOG_DEBUG, "multirate inter: %i\n",
- s->multirate_inter);
- av_log(s->avctx, AV_LOG_DEBUG, "version number: %i\n", s->version);
- av_log(s->avctx, AV_LOG_DEBUG, "copy history: %i\n", s->copy_history);
- av_log(s->avctx, AV_LOG_DEBUG,
- "source pcm resolution: %i (%i bits/sample)\n",
- s->source_pcm_res, dca_bits_per_sample[s->source_pcm_res]);
- av_log(s->avctx, AV_LOG_DEBUG, "front sum: %i\n", s->front_sum);
- av_log(s->avctx, AV_LOG_DEBUG, "surround sum: %i\n", s->surround_sum);
- av_log(s->avctx, AV_LOG_DEBUG, "dialog norm: %i\n", s->dialog_norm);
- av_log(s->avctx, AV_LOG_DEBUG, "\n");
-#endif
-
- /* Primary audio coding header */
- s->subframes = get_bits(&s->gb, 4) + 1;
-
- return dca_parse_audio_coding_header(s, 0, 0);
-}
-
-
-static inline int get_scale(GetBitContext *gb, int level, int value, int log2range)
-{
- if (level < 5) {
- /* huffman encoded */
- value += get_bitalloc(gb, &dca_scalefactor, level);
- value = av_clip(value, 0, (1 << log2range) - 1);
- } else if (level < 8) {
- if (level + 1 > log2range) {
- skip_bits(gb, level + 1 - log2range);
- value = get_bits(gb, log2range);
- } else {
- value = get_bits(gb, level + 1);
- }
- }
- return value;
-}
-
-static int dca_subframe_header(DCAContext *s, int base_channel, int block_index)
-{
- /* Primary audio coding side information */
- int j, k;
-
- if (get_bits_left(&s->gb) < 0)
- return AVERROR_INVALIDDATA;
-
- if (!base_channel) {
- s->subsubframes[s->current_subframe] = get_bits(&s->gb, 2) + 1;
- s->partial_samples[s->current_subframe] = get_bits(&s->gb, 3);
- }
-
- for (j = base_channel; j < s->prim_channels; j++) {
- for (k = 0; k < s->subband_activity[j]; k++)
- s->prediction_mode[j][k] = get_bits(&s->gb, 1);
- }
-
- /* Get prediction codebook */
- for (j = base_channel; j < s->prim_channels; j++) {
- for (k = 0; k < s->subband_activity[j]; k++) {
- if (s->prediction_mode[j][k] > 0) {
- /* (Prediction coefficient VQ address) */
- s->prediction_vq[j][k] = get_bits(&s->gb, 12);
- }
- }
- }
-
- /* Bit allocation index */
- for (j = base_channel; j < s->prim_channels; j++) {
- for (k = 0; k < s->vq_start_subband[j]; k++) {
- if (s->bitalloc_huffman[j] == 6)
- s->bitalloc[j][k] = get_bits(&s->gb, 5);
- else if (s->bitalloc_huffman[j] == 5)
- s->bitalloc[j][k] = get_bits(&s->gb, 4);
- else if (s->bitalloc_huffman[j] == 7) {
- av_log(s->avctx, AV_LOG_ERROR,
- "Invalid bit allocation index\n");
- return AVERROR_INVALIDDATA;
- } else {
- s->bitalloc[j][k] =
- get_bitalloc(&s->gb, &dca_bitalloc_index, s->bitalloc_huffman[j]);
- }
-
- if (s->bitalloc[j][k] > 26) {
- av_dlog(s->avctx, "bitalloc index [%i][%i] too big (%i)\n",
- j, k, s->bitalloc[j][k]);
- return AVERROR_INVALIDDATA;
- }
- }
- }
-
- /* Transition mode */
- for (j = base_channel; j < s->prim_channels; j++) {
- for (k = 0; k < s->subband_activity[j]; k++) {
- s->transition_mode[j][k] = 0;
- if (s->subsubframes[s->current_subframe] > 1 &&
- k < s->vq_start_subband[j] && s->bitalloc[j][k] > 0) {
- s->transition_mode[j][k] =
- get_bitalloc(&s->gb, &dca_tmode, s->transient_huffman[j]);
- }
- }
- }
-
- if (get_bits_left(&s->gb) < 0)
- return AVERROR_INVALIDDATA;
-
- for (j = base_channel; j < s->prim_channels; j++) {
- const uint32_t *scale_table;
- int scale_sum, log_size;
-
- memset(s->scale_factor[j], 0,
- s->subband_activity[j] * sizeof(s->scale_factor[0][0][0]) * 2);
-
- if (s->scalefactor_huffman[j] == 6) {
- scale_table = scale_factor_quant7;
- log_size = 7;
- } else {
- scale_table = scale_factor_quant6;
- log_size = 6;
- }
-
- /* When huffman coded, only the difference is encoded */
- scale_sum = 0;
-
- for (k = 0; k < s->subband_activity[j]; k++) {
- if (k >= s->vq_start_subband[j] || s->bitalloc[j][k] > 0) {
- scale_sum = get_scale(&s->gb, s->scalefactor_huffman[j], scale_sum, log_size);
- s->scale_factor[j][k][0] = scale_table[scale_sum];
- }
-
- if (k < s->vq_start_subband[j] && s->transition_mode[j][k]) {
- /* Get second scale factor */
- scale_sum = get_scale(&s->gb, s->scalefactor_huffman[j], scale_sum, log_size);
- s->scale_factor[j][k][1] = scale_table[scale_sum];
- }
- }
- }
-
- /* Joint subband scale factor codebook select */
- for (j = base_channel; j < s->prim_channels; j++) {
- /* Transmitted only if joint subband coding enabled */
- if (s->joint_intensity[j] > 0)
- s->joint_huff[j] = get_bits(&s->gb, 3);
- }
-
- if (get_bits_left(&s->gb) < 0)
- return AVERROR_INVALIDDATA;
-
- /* Scale factors for joint subband coding */
- for (j = base_channel; j < s->prim_channels; j++) {
- int source_channel;
-
- /* Transmitted only if joint subband coding enabled */
- if (s->joint_intensity[j] > 0) {
- int scale = 0;
- source_channel = s->joint_intensity[j] - 1;
-
- /* When huffman coded, only the difference is encoded
- * (is this valid as well for joint scales ???) */
-
- for (k = s->subband_activity[j]; k < s->subband_activity[source_channel]; k++) {
- scale = get_scale(&s->gb, s->joint_huff[j], 64 /* bias */, 7);
- s->joint_scale_factor[j][k] = scale; /*joint_scale_table[scale]; */
- }
-
- if (!(s->debug_flag & 0x02)) {
- av_log(s->avctx, AV_LOG_DEBUG,
- "Joint stereo coding not supported\n");
- s->debug_flag |= 0x02;
- }
- }
- }
-
- /* Stereo downmix coefficients */
- if (!base_channel && s->prim_channels > 2) {
- if (s->downmix) {
- for (j = base_channel; j < s->prim_channels; j++) {
- s->downmix_coef[j][0] = get_bits(&s->gb, 7);
- s->downmix_coef[j][1] = get_bits(&s->gb, 7);
- }
- } else {
- int am = s->amode & DCA_CHANNEL_MASK;
- if (am >= FF_ARRAY_ELEMS(dca_default_coeffs)) {
- av_log(s->avctx, AV_LOG_ERROR,
- "Invalid channel mode %d\n", am);
- return AVERROR_INVALIDDATA;
- }
- if (s->prim_channels > FF_ARRAY_ELEMS(dca_default_coeffs[0])) {
- avpriv_request_sample(s->avctx, "Downmixing %d channels",
- s->prim_channels);
- return AVERROR_PATCHWELCOME;
- }
-
- for (j = base_channel; j < s->prim_channels; j++) {
- s->downmix_coef[j][0] = dca_default_coeffs[am][j][0];
- s->downmix_coef[j][1] = dca_default_coeffs[am][j][1];
- }
- }
- }
-
- /* Dynamic range coefficient */
- if (!base_channel && s->dynrange)
- s->dynrange_coef = get_bits(&s->gb, 8);
-
- /* Side information CRC check word */
- if (s->crc_present) {
- get_bits(&s->gb, 16);
- }
-
- /*
- * Primary audio data arrays
- */
-
- /* VQ encoded high frequency subbands */
- for (j = base_channel; j < s->prim_channels; j++)
- for (k = s->vq_start_subband[j]; k < s->subband_activity[j]; k++)
- /* 1 vector -> 32 samples */
- s->high_freq_vq[j][k] = get_bits(&s->gb, 10);
-
- /* Low frequency effect data */
- if (!base_channel && s->lfe) {
- int quant7;
- /* LFE samples */
- int lfe_samples = 2 * s->lfe * (4 + block_index);
- int lfe_end_sample = 2 * s->lfe * (4 + block_index + s->subsubframes[s->current_subframe]);
- float lfe_scale;
-
- for (j = lfe_samples; j < lfe_end_sample; j++) {
- /* Signed 8 bits int */
- s->lfe_data[j] = get_sbits(&s->gb, 8);
- }
-
- /* Scale factor index */
- quant7 = get_bits(&s->gb, 8);
- if (quant7 > 127) {
- avpriv_request_sample(s->avctx, "LFEScaleIndex larger than 127");
- return AVERROR_INVALIDDATA;
- }
- s->lfe_scale_factor = scale_factor_quant7[quant7];
-
- /* Quantization step size * scale factor */
- lfe_scale = 0.035 * s->lfe_scale_factor;
-
- for (j = lfe_samples; j < lfe_end_sample; j++)
- s->lfe_data[j] *= lfe_scale;
- }
-
-#ifdef TRACE
- av_log(s->avctx, AV_LOG_DEBUG, "subsubframes: %i\n",
- s->subsubframes[s->current_subframe]);
- av_log(s->avctx, AV_LOG_DEBUG, "partial samples: %i\n",
- s->partial_samples[s->current_subframe]);
-
- for (j = base_channel; j < s->prim_channels; j++) {
- av_log(s->avctx, AV_LOG_DEBUG, "prediction mode:");
- for (k = 0; k < s->subband_activity[j]; k++)
- av_log(s->avctx, AV_LOG_DEBUG, " %i", s->prediction_mode[j][k]);
- av_log(s->avctx, AV_LOG_DEBUG, "\n");
- }
- for (j = base_channel; j < s->prim_channels; j++) {
- for (k = 0; k < s->subband_activity[j]; k++)
- av_log(s->avctx, AV_LOG_DEBUG,
- "prediction coefs: %f, %f, %f, %f\n",
- (float) adpcm_vb[s->prediction_vq[j][k]][0] / 8192,
- (float) adpcm_vb[s->prediction_vq[j][k]][1] / 8192,
- (float) adpcm_vb[s->prediction_vq[j][k]][2] / 8192,
- (float) adpcm_vb[s->prediction_vq[j][k]][3] / 8192);
- }
- for (j = base_channel; j < s->prim_channels; j++) {
- av_log(s->avctx, AV_LOG_DEBUG, "bitalloc index: ");
- for (k = 0; k < s->vq_start_subband[j]; k++)
- av_log(s->avctx, AV_LOG_DEBUG, "%2.2i ", s->bitalloc[j][k]);
- av_log(s->avctx, AV_LOG_DEBUG, "\n");
- }
- for (j = base_channel; j < s->prim_channels; j++) {
- av_log(s->avctx, AV_LOG_DEBUG, "Transition mode:");
- for (k = 0; k < s->subband_activity[j]; k++)
- av_log(s->avctx, AV_LOG_DEBUG, " %i", s->transition_mode[j][k]);
- av_log(s->avctx, AV_LOG_DEBUG, "\n");
- }
- for (j = base_channel; j < s->prim_channels; j++) {
- av_log(s->avctx, AV_LOG_DEBUG, "Scale factor:");
- for (k = 0; k < s->subband_activity[j]; k++) {
- if (k >= s->vq_start_subband[j] || s->bitalloc[j][k] > 0)
- av_log(s->avctx, AV_LOG_DEBUG, " %i", s->scale_factor[j][k][0]);
- if (k < s->vq_start_subband[j] && s->transition_mode[j][k])
- av_log(s->avctx, AV_LOG_DEBUG, " %i(t)", s->scale_factor[j][k][1]);
- }
- av_log(s->avctx, AV_LOG_DEBUG, "\n");
- }
- for (j = base_channel; j < s->prim_channels; j++) {
- if (s->joint_intensity[j] > 0) {
- int source_channel = s->joint_intensity[j] - 1;
- av_log(s->avctx, AV_LOG_DEBUG, "Joint scale factor index:\n");
- for (k = s->subband_activity[j]; k < s->subband_activity[source_channel]; k++)
- av_log(s->avctx, AV_LOG_DEBUG, " %i", s->joint_scale_factor[j][k]);
- av_log(s->avctx, AV_LOG_DEBUG, "\n");
- }
- }
- if (!base_channel && s->prim_channels > 2 && s->downmix) {
- av_log(s->avctx, AV_LOG_DEBUG, "Downmix coeffs:\n");
- for (j = 0; j < s->prim_channels; j++) {
- av_log(s->avctx, AV_LOG_DEBUG, "Channel 0, %d = %f\n", j,
- dca_downmix_coeffs[s->downmix_coef[j][0]]);
- av_log(s->avctx, AV_LOG_DEBUG, "Channel 1, %d = %f\n", j,
- dca_downmix_coeffs[s->downmix_coef[j][1]]);
- }
- av_log(s->avctx, AV_LOG_DEBUG, "\n");
- }
- for (j = base_channel; j < s->prim_channels; j++)
- for (k = s->vq_start_subband[j]; k < s->subband_activity[j]; k++)
- av_log(s->avctx, AV_LOG_DEBUG, "VQ index: %i\n", s->high_freq_vq[j][k]);
- if (!base_channel && s->lfe) {
- int lfe_samples = 2 * s->lfe * (4 + block_index);
- int lfe_end_sample = 2 * s->lfe * (4 + block_index + s->subsubframes[s->current_subframe]);
-
- av_log(s->avctx, AV_LOG_DEBUG, "LFE samples:\n");
- for (j = lfe_samples; j < lfe_end_sample; j++)
- av_log(s->avctx, AV_LOG_DEBUG, " %f", s->lfe_data[j]);
- av_log(s->avctx, AV_LOG_DEBUG, "\n");
- }
-#endif
-
- return 0;
-}
-
-static void qmf_32_subbands(DCAContext *s, int chans,
- float samples_in[32][8], float *samples_out,
- float scale)
-{
- const float *prCoeff;
-
- int sb_act = s->subband_activity[chans];
-
- scale *= sqrt(1 / 8.0);
-
- /* Select filter */
- if (!s->multirate_inter) /* Non-perfect reconstruction */
- prCoeff = fir_32bands_nonperfect;
- else /* Perfect reconstruction */
- prCoeff = fir_32bands_perfect;
-
- s->dcadsp.qmf_32_subbands(samples_in, sb_act, &s->synth, &s->imdct,
- s->subband_fir_hist[chans],
- &s->hist_index[chans],
- s->subband_fir_noidea[chans], prCoeff,
- samples_out, s->raXin, scale);
-}
-
-static void lfe_interpolation_fir(DCAContext *s, int decimation_select,
- int num_deci_sample, float *samples_in,
- float *samples_out, float scale)
-{
- /* 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 decifactor;
- const float *prCoeff;
- int deciindex;
-
- /* Select decimation filter */
- if (decimation_select == 1) {
- decifactor = 64;
- prCoeff = lfe_fir_128;
- } else {
- decifactor = 32;
- prCoeff = lfe_fir_64;
- }
- /* Interpolation */
- for (deciindex = 0; deciindex < num_deci_sample; deciindex++) {
- s->dcadsp.lfe_fir(samples_out, samples_in, prCoeff, decifactor, scale);
- samples_in++;
- samples_out += 2 * decifactor;
- }
-}
-
-/* downmixing routines */
-#define MIX_REAR1(samples, s1, rs, coef) \
- samples[0][i] += samples[s1][i] * coef[rs][0]; \
- samples[1][i] += samples[s1][i] * coef[rs][1];
-
-#define MIX_REAR2(samples, s1, s2, rs, coef) \
- samples[0][i] += samples[s1][i] * coef[rs][0] + samples[s2][i] * coef[rs + 1][0]; \
- samples[1][i] += samples[s1][i] * coef[rs][1] + samples[s2][i] * coef[rs + 1][1];
-
-#define MIX_FRONT3(samples, coef) \
- t = samples[c][i]; \
- u = samples[l][i]; \
- v = samples[r][i]; \
- samples[0][i] = t * coef[0][0] + u * coef[1][0] + v * coef[2][0]; \
- samples[1][i] = t * coef[0][1] + u * coef[1][1] + v * coef[2][1];
-
-#define DOWNMIX_TO_STEREO(op1, op2) \
- for (i = 0; i < 256; i++) { \
- op1 \
- op2 \
- }
-
-static void dca_downmix(float **samples, int srcfmt,
- int downmix_coef[DCA_PRIM_CHANNELS_MAX][2],
- const int8_t *channel_mapping)
-{
- int c, l, r, sl, sr, s;
- int i;
- float t, u, v;
- float coef[DCA_PRIM_CHANNELS_MAX][2];
-
- for (i = 0; i < DCA_PRIM_CHANNELS_MAX; i++) {
- coef[i][0] = dca_downmix_coeffs[downmix_coef[i][0]];
- coef[i][1] = dca_downmix_coeffs[downmix_coef[i][1]];
- }
-
- switch (srcfmt) {
- case DCA_MONO:
- case DCA_CHANNEL:
- case DCA_STEREO_TOTAL:
- case DCA_STEREO_SUMDIFF:
- case DCA_4F2R:
- av_log(NULL, AV_LOG_ERROR, "Not implemented!\n");
- break;
- case DCA_STEREO:
- break;
- case DCA_3F:
- c = channel_mapping[0];
- l = channel_mapping[1];
- r = channel_mapping[2];
- DOWNMIX_TO_STEREO(MIX_FRONT3(samples, coef), );
- break;
- case DCA_2F1R:
- s = channel_mapping[2];
- DOWNMIX_TO_STEREO(MIX_REAR1(samples, s, 2, coef), );
- break;
- case DCA_3F1R:
- c = channel_mapping[0];
- l = channel_mapping[1];
- r = channel_mapping[2];
- s = channel_mapping[3];
- DOWNMIX_TO_STEREO(MIX_FRONT3(samples, coef),
- MIX_REAR1(samples, s, 3, coef));
- break;
- case DCA_2F2R:
- sl = channel_mapping[2];
- sr = channel_mapping[3];
- DOWNMIX_TO_STEREO(MIX_REAR2(samples, sl, sr, 2, coef), );
- break;
- case DCA_3F2R:
- c = channel_mapping[0];
- l = channel_mapping[1];
- r = channel_mapping[2];
- sl = channel_mapping[3];
- sr = channel_mapping[4];
- DOWNMIX_TO_STEREO(MIX_FRONT3(samples, coef),
- MIX_REAR2(samples, sl, sr, 3, coef));
- break;
- }
-}
-
-
-#ifndef decode_blockcodes
-/* Very compact version of the block code decoder that does not use table
- * look-up but is slightly slower */
-static int decode_blockcode(int code, int levels, int32_t *values)
-{
- int i;
- int offset = (levels - 1) >> 1;
-
- for (i = 0; i < 4; i++) {
- int div = FASTDIV(code, levels);
- values[i] = code - offset - div * levels;
- code = div;
- }
-
- return code;
-}
-
-static int decode_blockcodes(int code1, int code2, int levels, int32_t *values)
-{
- return decode_blockcode(code1, levels, values) |
- decode_blockcode(code2, levels, values + 4);
-}
-#endif
-
-static const uint8_t abits_sizes[7] = { 7, 10, 12, 13, 15, 17, 19 };
-static const uint8_t abits_levels[7] = { 3, 5, 7, 9, 13, 17, 25 };
-
-#ifndef int8x8_fmul_int32
-static inline void int8x8_fmul_int32(float *dst, const int8_t *src, int scale)
-{
- float fscale = scale / 16.0;
- int i;
- for (i = 0; i < 8; i++)
- dst[i] = src[i] * fscale;
-}
-#endif
-
-static int dca_subsubframe(DCAContext *s, int base_channel, int block_index)
-{
- int k, l;
- int subsubframe = s->current_subsubframe;
-
- const float *quant_step_table;
-
- /* FIXME */
- float (*subband_samples)[DCA_SUBBANDS][8] = s->subband_samples[block_index];
- LOCAL_ALIGNED_16(int32_t, block, [8 * DCA_SUBBANDS]);
-
- /*
- * Audio data
- */
-
- /* Select quantization step size table */
- if (s->bit_rate_index == 0x1f)
- quant_step_table = lossless_quant_d;
- else
- quant_step_table = lossy_quant_d;
-
- for (k = base_channel; k < s->prim_channels; k++) {
- float rscale[DCA_SUBBANDS];
-
- if (get_bits_left(&s->gb) < 0)
- return AVERROR_INVALIDDATA;
-
- for (l = 0; l < s->vq_start_subband[k]; l++) {
- int m;
-
- /* Select the mid-tread linear quantizer */
- int abits = s->bitalloc[k][l];
-
- float quant_step_size = quant_step_table[abits];
-
- /*
- * Determine quantization index code book and its type
- */
-
- /* Select quantization index code book */
- int sel = s->quant_index_huffman[k][abits];
-
- /*
- * Extract bits from the bit stream
- */
- if (!abits) {
- rscale[l] = 0;
- memset(block + 8 * l, 0, 8 * sizeof(block[0]));
- } else {
- /* Deal with transients */
- int sfi = s->transition_mode[k][l] && subsubframe >= s->transition_mode[k][l];
- rscale[l] = quant_step_size * s->scale_factor[k][l][sfi] *
- s->scalefactor_adj[k][sel];
-
- if (abits >= 11 || !dca_smpl_bitalloc[abits].vlc[sel].table) {
- if (abits <= 7) {
- /* Block code */
- int block_code1, block_code2, size, levels, err;
-
- size = abits_sizes[abits - 1];
- levels = abits_levels[abits - 1];
-
- block_code1 = get_bits(&s->gb, size);
- block_code2 = get_bits(&s->gb, size);
- err = decode_blockcodes(block_code1, block_code2,
- levels, block + 8 * l);
- if (err) {
- av_log(s->avctx, AV_LOG_ERROR,
- "ERROR: block code look-up failed\n");
- return AVERROR_INVALIDDATA;
- }
- } else {
- /* no coding */
- for (m = 0; m < 8; m++)
- block[8 * l + m] = get_sbits(&s->gb, abits - 3);
- }
- } else {
- /* Huffman coded */
- for (m = 0; m < 8; m++)
- block[8 * l + m] = get_bitalloc(&s->gb,
- &dca_smpl_bitalloc[abits], sel);
- }
-
- }
- }
-
- s->fmt_conv.int32_to_float_fmul_array8(&s->fmt_conv, subband_samples[k][0],
- block, rscale, 8 * s->vq_start_subband[k]);
-
- for (l = 0; l < s->vq_start_subband[k]; l++) {
- int m;
- /*
- * Inverse ADPCM if in prediction mode
- */
- if (s->prediction_mode[k][l]) {
- int n;
- for (m = 0; m < 8; m++) {
- for (n = 1; n <= 4; n++)
- if (m >= n)
- subband_samples[k][l][m] +=
- (adpcm_vb[s->prediction_vq[k][l]][n - 1] *
- subband_samples[k][l][m - n] / 8192);
- else if (s->predictor_history)
- subband_samples[k][l][m] +=
- (adpcm_vb[s->prediction_vq[k][l]][n - 1] *
- s->subband_samples_hist[k][l][m - n + 4] / 8192);
- }
- }
- }
-
- /*
- * Decode VQ encoded high frequencies
- */
- for (l = s->vq_start_subband[k]; l < s->subband_activity[k]; l++) {
- /* 1 vector -> 32 samples but we only need the 8 samples
- * for this subsubframe. */
- int hfvq = s->high_freq_vq[k][l];
-
- if (!s->debug_flag & 0x01) {
- av_log(s->avctx, AV_LOG_DEBUG,
- "Stream with high frequencies VQ coding\n");
- s->debug_flag |= 0x01;
- }
-
- int8x8_fmul_int32(subband_samples[k][l],
- &high_freq_vq[hfvq][subsubframe * 8],
- s->scale_factor[k][l][0]);
- }
- }
-
- /* Check for DSYNC after subsubframe */
- if (s->aspf || subsubframe == s->subsubframes[s->current_subframe] - 1) {
- if (0xFFFF == get_bits(&s->gb, 16)) { /* 0xFFFF */
-#ifdef TRACE
- av_log(s->avctx, AV_LOG_DEBUG, "Got subframe DSYNC\n");
-#endif
- } else {
- av_log(s->avctx, AV_LOG_ERROR, "Didn't get subframe DSYNC\n");
- return AVERROR_INVALIDDATA;
- }
- }
-
- /* Backup predictor history for adpcm */
- for (k = base_channel; k < s->prim_channels; k++)
- for (l = 0; l < s->vq_start_subband[k]; l++)
- memcpy(s->subband_samples_hist[k][l],
- &subband_samples[k][l][4],
- 4 * sizeof(subband_samples[0][0][0]));
-
- return 0;
-}
-
-static int dca_filter_channels(DCAContext *s, int block_index)
-{
- float (*subband_samples)[DCA_SUBBANDS][8] = s->subband_samples[block_index];
- int k;
-
- /* 32 subbands QMF */
- for (k = 0; k < s->prim_channels; k++) {
-/* static float pcm_to_double[8] = { 32768.0, 32768.0, 524288.0, 524288.0,
- 0, 8388608.0, 8388608.0 };*/
- if (s->channel_order_tab[k] >= 0)
- qmf_32_subbands(s, k, subband_samples[k],
- s->samples_chanptr[s->channel_order_tab[k]],
- M_SQRT1_2 / 32768.0 /* pcm_to_double[s->source_pcm_res] */);
- }
-
- /* Down mixing */
- if (s->avctx->request_channels == 2 && s->prim_channels > 2) {
- dca_downmix(s->samples_chanptr, s->amode, s->downmix_coef, s->channel_order_tab);
- }
-
- /* Generate LFE samples for this subsubframe FIXME!!! */
- if (s->output & DCA_LFE) {
- lfe_interpolation_fir(s, s->lfe, 2 * s->lfe,
- s->lfe_data + 2 * s->lfe * (block_index + 4),
- s->samples_chanptr[s->lfe_index],
- 1.0 / (256.0 * 32768.0));
- /* Outputs 20bits pcm samples */
- }
-
- return 0;
-}
-
-
-static int dca_subframe_footer(DCAContext *s, int base_channel)
-{
- int aux_data_count = 0, i;
-
- /*
- * Unpack optional information
- */
-
- /* presumably optional information only appears in the core? */
- if (!base_channel) {
- if (s->timestamp)
- skip_bits_long(&s->gb, 32);
-
- if (s->aux_data)
- aux_data_count = get_bits(&s->gb, 6);
-
- for (i = 0; i < aux_data_count; i++)
- get_bits(&s->gb, 8);
-
- if (s->crc_present && (s->downmix || s->dynrange))
- get_bits(&s->gb, 16);
- }
-
- return 0;
-}
-
-/**
- * Decode a dca frame block
- *
- * @param s pointer to the DCAContext
- */
-
-static int dca_decode_block(DCAContext *s, int base_channel, int block_index)
-{
- int ret;
-
- /* Sanity check */
- if (s->current_subframe >= s->subframes) {
- av_log(s->avctx, AV_LOG_DEBUG, "check failed: %i>%i",
- s->current_subframe, s->subframes);
- return AVERROR_INVALIDDATA;
- }
-
- if (!s->current_subsubframe) {
-#ifdef TRACE
- av_log(s->avctx, AV_LOG_DEBUG, "DSYNC dca_subframe_header\n");
-#endif
- /* Read subframe header */
- if ((ret = dca_subframe_header(s, base_channel, block_index)))
- return ret;
- }
-
- /* Read subsubframe */
-#ifdef TRACE
- av_log(s->avctx, AV_LOG_DEBUG, "DSYNC dca_subsubframe\n");
-#endif
- if ((ret = dca_subsubframe(s, base_channel, block_index)))
- return ret;
-
- /* Update state */
- s->current_subsubframe++;
- if (s->current_subsubframe >= s->subsubframes[s->current_subframe]) {
- s->current_subsubframe = 0;
- s->current_subframe++;
- }
- if (s->current_subframe >= s->subframes) {
-#ifdef TRACE
- av_log(s->avctx, AV_LOG_DEBUG, "DSYNC dca_subframe_footer\n");
-#endif
- /* Read subframe footer */
- if ((ret = dca_subframe_footer(s, base_channel)))
- return ret;
- }
-
- return 0;
-}
-
-/**
- * Return the number of channels in an ExSS speaker mask (HD)
- */
-static int dca_exss_mask2count(int mask)
-{
- /* count bits that mean speaker pairs twice */
- return av_popcount(mask) +
- av_popcount(mask & (DCA_EXSS_CENTER_LEFT_RIGHT |
- DCA_EXSS_FRONT_LEFT_RIGHT |
- DCA_EXSS_FRONT_HIGH_LEFT_RIGHT |
- DCA_EXSS_WIDE_LEFT_RIGHT |
- DCA_EXSS_SIDE_LEFT_RIGHT |
- DCA_EXSS_SIDE_HIGH_LEFT_RIGHT |
- DCA_EXSS_SIDE_REAR_LEFT_RIGHT |
- DCA_EXSS_REAR_LEFT_RIGHT |
- DCA_EXSS_REAR_HIGH_LEFT_RIGHT));
-}
-
-/**
- * Skip mixing coefficients of a single mix out configuration (HD)
- */
-static void dca_exss_skip_mix_coeffs(GetBitContext *gb, int channels, int out_ch)
-{
- int i;
-
- for (i = 0; i < channels; i++) {
- int mix_map_mask = get_bits(gb, out_ch);
- int num_coeffs = av_popcount(mix_map_mask);
- skip_bits_long(gb, num_coeffs * 6);
- }
-}
-
-/**
- * Parse extension substream asset header (HD)
- */
-static int dca_exss_parse_asset_header(DCAContext *s)
-{
- int header_pos = get_bits_count(&s->gb);
- int header_size;
- int channels = 0;
- int embedded_stereo = 0;
- int embedded_6ch = 0;
- int drc_code_present;
- int av_uninit(extensions_mask);
- int i, j;
-
- if (get_bits_left(&s->gb) < 16)
- return -1;
-
- /* We will parse just enough to get to the extensions bitmask with which
- * we can set the profile value. */
-
- header_size = get_bits(&s->gb, 9) + 1;
- skip_bits(&s->gb, 3); // asset index
-
- if (s->static_fields) {
- if (get_bits1(&s->gb))
- skip_bits(&s->gb, 4); // asset type descriptor
- if (get_bits1(&s->gb))
- skip_bits_long(&s->gb, 24); // language descriptor
-
- if (get_bits1(&s->gb)) {
- /* How can one fit 1024 bytes of text here if the maximum value
- * for the asset header size field above was 512 bytes? */
- int text_length = get_bits(&s->gb, 10) + 1;
- if (get_bits_left(&s->gb) < text_length * 8)
- return -1;
- skip_bits_long(&s->gb, text_length * 8); // info text
- }
-
- skip_bits(&s->gb, 5); // bit resolution - 1
- skip_bits(&s->gb, 4); // max sample rate code
- channels = get_bits(&s->gb, 8) + 1;
-
- if (get_bits1(&s->gb)) { // 1-to-1 channels to speakers
- int spkr_remap_sets;
- int spkr_mask_size = 16;
- int num_spkrs[7];
-
- if (channels > 2)
- embedded_stereo = get_bits1(&s->gb);
- if (channels > 6)
- embedded_6ch = get_bits1(&s->gb);
-
- if (get_bits1(&s->gb)) {
- spkr_mask_size = (get_bits(&s->gb, 2) + 1) << 2;
- skip_bits(&s->gb, spkr_mask_size); // spkr activity mask
- }
-
- spkr_remap_sets = get_bits(&s->gb, 3);
-
- for (i = 0; i < spkr_remap_sets; i++) {
- /* std layout mask for each remap set */
- num_spkrs[i] = dca_exss_mask2count(get_bits(&s->gb, spkr_mask_size));
- }
-
- for (i = 0; i < spkr_remap_sets; i++) {
- int num_dec_ch_remaps = get_bits(&s->gb, 5) + 1;
- if (get_bits_left(&s->gb) < 0)
- return -1;
-
- for (j = 0; j < num_spkrs[i]; j++) {
- int remap_dec_ch_mask = get_bits_long(&s->gb, num_dec_ch_remaps);
- int num_dec_ch = av_popcount(remap_dec_ch_mask);
- skip_bits_long(&s->gb, num_dec_ch * 5); // remap codes
- }
- }
-
- } else {
- skip_bits(&s->gb, 3); // representation type
- }
- }
-
- drc_code_present = get_bits1(&s->gb);
- if (drc_code_present)
- get_bits(&s->gb, 8); // drc code
-
- if (get_bits1(&s->gb))
- skip_bits(&s->gb, 5); // dialog normalization code
-
- if (drc_code_present && embedded_stereo)
- get_bits(&s->gb, 8); // drc stereo code
-
- if (s->mix_metadata && get_bits1(&s->gb)) {
- skip_bits(&s->gb, 1); // external mix
- skip_bits(&s->gb, 6); // post mix gain code
-
- if (get_bits(&s->gb, 2) != 3) // mixer drc code
- skip_bits(&s->gb, 3); // drc limit
- else
- skip_bits(&s->gb, 8); // custom drc code
-
- if (get_bits1(&s->gb)) // channel specific scaling
- for (i = 0; i < s->num_mix_configs; i++)
- skip_bits_long(&s->gb, s->mix_config_num_ch[i] * 6); // scale codes
- else
- skip_bits_long(&s->gb, s->num_mix_configs * 6); // scale codes
-
- for (i = 0; i < s->num_mix_configs; i++) {
- if (get_bits_left(&s->gb) < 0)
- return -1;
- dca_exss_skip_mix_coeffs(&s->gb, channels, s->mix_config_num_ch[i]);
- if (embedded_6ch)
- dca_exss_skip_mix_coeffs(&s->gb, 6, s->mix_config_num_ch[i]);
- if (embedded_stereo)
- dca_exss_skip_mix_coeffs(&s->gb, 2, s->mix_config_num_ch[i]);
- }
- }
-
- switch (get_bits(&s->gb, 2)) {
- case 0: extensions_mask = get_bits(&s->gb, 12); break;
- case 1: extensions_mask = DCA_EXT_EXSS_XLL; break;
- case 2: extensions_mask = DCA_EXT_EXSS_LBR; break;
- case 3: extensions_mask = 0; /* aux coding */ break;
- }
-
- /* not parsed further, we were only interested in the extensions mask */
-
- if (get_bits_left(&s->gb) < 0)
- return -1;
-
- if (get_bits_count(&s->gb) - header_pos > header_size * 8) {
- av_log(s->avctx, AV_LOG_WARNING, "Asset header size mismatch.\n");
- return -1;
- }
- skip_bits_long(&s->gb, header_pos + header_size * 8 - get_bits_count(&s->gb));
-
- if (extensions_mask & DCA_EXT_EXSS_XLL)
- s->profile = FF_PROFILE_DTS_HD_MA;
- else if (extensions_mask & (DCA_EXT_EXSS_XBR | DCA_EXT_EXSS_X96 |
- DCA_EXT_EXSS_XXCH))
- s->profile = FF_PROFILE_DTS_HD_HRA;
-
- if (!(extensions_mask & DCA_EXT_CORE))
- av_log(s->avctx, AV_LOG_WARNING, "DTS core detection mismatch.\n");
- if ((extensions_mask & DCA_CORE_EXTS) != s->core_ext_mask)
- av_log(s->avctx, AV_LOG_WARNING,
- "DTS extensions detection mismatch (%d, %d)\n",
- extensions_mask & DCA_CORE_EXTS, s->core_ext_mask);
-
- return 0;
-}
-
-static int dca_xbr_parse_frame(DCAContext *s)
-{
- int scale_table_high[DCA_CHSET_CHANS_MAX][DCA_SUBBANDS][2];
- int active_bands[DCA_CHSETS_MAX][DCA_CHSET_CHANS_MAX];
- int abits_high[DCA_CHSET_CHANS_MAX][DCA_SUBBANDS];
- int anctemp[DCA_CHSET_CHANS_MAX];
- int chset_fsize[DCA_CHSETS_MAX];
- int n_xbr_ch[DCA_CHSETS_MAX];
- int hdr_size, num_chsets, xbr_tmode, hdr_pos;
- int i, j, k, l, chset, chan_base;
-
- av_log(s->avctx, AV_LOG_DEBUG, "DTS-XBR: decoding XBR extension\n");
-
- /* get bit position of sync header */
- hdr_pos = get_bits_count(&s->gb) - 32;
-
- hdr_size = get_bits(&s->gb, 6) + 1;
- num_chsets = get_bits(&s->gb, 2) + 1;
-
- for(i = 0; i < num_chsets; i++)
- chset_fsize[i] = get_bits(&s->gb, 14) + 1;
-
- xbr_tmode = get_bits1(&s->gb);
-
- for(i = 0; i < num_chsets; i++) {
- n_xbr_ch[i] = get_bits(&s->gb, 3) + 1;
- k = get_bits(&s->gb, 2) + 5;
- for(j = 0; j < n_xbr_ch[i]; j++)
- active_bands[i][j] = get_bits(&s->gb, k) + 1;
- }
-
- /* skip to the end of the header */
- i = get_bits_count(&s->gb);
- if(hdr_pos + hdr_size * 8 > i)
- skip_bits_long(&s->gb, hdr_pos + hdr_size * 8 - i);
-
- /* loop over the channel data sets */
- /* only decode as many channels as we've decoded base data for */
- for(chset = 0, chan_base = 0;
- chset < num_chsets && chan_base + n_xbr_ch[chset] <= s->prim_channels;
- chan_base += n_xbr_ch[chset++]) {
- int start_posn = get_bits_count(&s->gb);
- int subsubframe = 0;
- int subframe = 0;
-
- /* loop over subframes */
- for (k = 0; k < (s->sample_blocks / 8); k++) {
- /* parse header if we're on first subsubframe of a block */
- if(subsubframe == 0) {
- /* Parse subframe header */
- for(i = 0; i < n_xbr_ch[chset]; i++) {
- anctemp[i] = get_bits(&s->gb, 2) + 2;
- }
-
- for(i = 0; i < n_xbr_ch[chset]; i++) {
- get_array(&s->gb, abits_high[i], active_bands[chset][i], anctemp[i]);
- }
-
- for(i = 0; i < n_xbr_ch[chset]; i++) {
- anctemp[i] = get_bits(&s->gb, 3);
- if(anctemp[i] < 1) {
- av_log(s->avctx, AV_LOG_ERROR, "DTS-XBR: SYNC ERROR\n");
- return AVERROR_INVALIDDATA;
- }
- }
-
- /* generate scale factors */
- for(i = 0; i < n_xbr_ch[chset]; i++) {
- const uint32_t *scale_table;
- int nbits;
-
- if (s->scalefactor_huffman[chan_base+i] == 6) {
- scale_table = scale_factor_quant7;
- } else {
- scale_table = scale_factor_quant6;
- }
-
- nbits = anctemp[i];
-
- for(j = 0; j < active_bands[chset][i]; j++) {
- if(abits_high[i][j] > 0) {
- scale_table_high[i][j][0] =
- scale_table[get_bits(&s->gb, nbits)];
-
- if(xbr_tmode && s->transition_mode[i][j]) {
- scale_table_high[i][j][1] =
- scale_table[get_bits(&s->gb, nbits)];
- }
- }
- }
- }
- }
-
- /* decode audio array for this block */
- for(i = 0; i < n_xbr_ch[chset]; i++) {
- for(j = 0; j < active_bands[chset][i]; j++) {
- const int xbr_abits = abits_high[i][j];
- const float quant_step_size = lossless_quant_d[xbr_abits];
- const int sfi = xbr_tmode && s->transition_mode[i][j] && subsubframe >= s->transition_mode[i][j];
- const float rscale = quant_step_size * scale_table_high[i][j][sfi];
- float *subband_samples = s->subband_samples[k][chan_base+i][j];
- int block[8];
-
- if(xbr_abits <= 0)
- continue;
-
- if(xbr_abits > 7) {
- get_array(&s->gb, block, 8, xbr_abits - 3);
- } else {
- int block_code1, block_code2, size, levels, err;
-
- size = abits_sizes[xbr_abits - 1];
- levels = abits_levels[xbr_abits - 1];
-
- block_code1 = get_bits(&s->gb, size);
- block_code2 = get_bits(&s->gb, size);
- err = decode_blockcodes(block_code1, block_code2,
- levels, block);
- if (err) {
- av_log(s->avctx, AV_LOG_ERROR,
- "ERROR: DTS-XBR: block code look-up failed\n");
- return AVERROR_INVALIDDATA;
- }
- }
-
- /* scale & sum into subband */
- for(l = 0; l < 8; l++)
- subband_samples[l] += (float)block[l] * rscale;
- }
- }
-
- /* check DSYNC marker */
- if(s->aspf || subsubframe == s->subsubframes[subframe] - 1) {
- if(get_bits(&s->gb, 16) != 0xffff) {
- av_log(s->avctx, AV_LOG_ERROR, "DTS-XBR: Didn't get subframe DSYNC\n");
- return AVERROR_INVALIDDATA;
- }
- }
-
- /* advance sub-sub-frame index */
- if(++subsubframe >= s->subsubframes[subframe]) {
- subsubframe = 0;
- subframe++;
- }
- }
-
- /* skip to next channel set */
- i = get_bits_count(&s->gb);
- if(start_posn + chset_fsize[chset] * 8 != i) {
- j = start_posn + chset_fsize[chset] * 8 - i;
- if(j < 0 || j >= 8)
- av_log(s->avctx, AV_LOG_ERROR, "DTS-XBR: end of channel set,"
- " skipping further than expected (%d bits)\n", j);
- skip_bits_long(&s->gb, j);
- }
- }
-
- return 0;
-}
-
-/* parse initial header for XXCH and dump details */
-static int dca_xxch_decode_frame(DCAContext *s)
-{
- int hdr_size, spkmsk_bits, num_chsets, core_spk, hdr_pos;
- int i, chset, base_channel, chstart, fsize[8];
-
- /* assume header word has already been parsed */
- hdr_pos = get_bits_count(&s->gb) - 32;
- hdr_size = get_bits(&s->gb, 6) + 1;
- /*chhdr_crc =*/ skip_bits1(&s->gb);
- spkmsk_bits = get_bits(&s->gb, 5) + 1;
- num_chsets = get_bits(&s->gb, 2) + 1;
-
- for (i = 0; i < num_chsets; i++)
- fsize[i] = get_bits(&s->gb, 14) + 1;
-
- core_spk = get_bits(&s->gb, spkmsk_bits);
- s->xxch_core_spkmask = core_spk;
- s->xxch_nbits_spk_mask = spkmsk_bits;
- s->xxch_dmix_embedded = 0;
-
- /* skip to the end of the header */
- i = get_bits_count(&s->gb);
- if (hdr_pos + hdr_size * 8 > i)
- skip_bits_long(&s->gb, hdr_pos + hdr_size * 8 - i);
-
- for (chset = 0; chset < num_chsets; chset++) {
- chstart = get_bits_count(&s->gb);
- base_channel = s->prim_channels;
- s->xxch_chset = chset;
-
- /* XXCH and Core headers differ, see 6.4.2 "XXCH Channel Set Header" vs.
- 5.3.2 "Primary Audio Coding Header", DTS Spec 1.3.1 */
- dca_parse_audio_coding_header(s, base_channel, 1);
-
- /* decode channel data */
- for (i = 0; i < (s->sample_blocks / 8); i++) {
- if (dca_decode_block(s, base_channel, i)) {
- av_log(s->avctx, AV_LOG_ERROR,
- "Error decoding DTS-XXCH extension\n");
- continue;
- }
- }
-
- /* skip to end of this section */
- i = get_bits_count(&s->gb);
- if (chstart + fsize[chset] * 8 > i)
- skip_bits_long(&s->gb, chstart + fsize[chset] * 8 - i);
- }
- s->xxch_chset = num_chsets;
-
- return 0;
-}
-
-/**
- * Parse extension substream header (HD)
- */
-static void dca_exss_parse_header(DCAContext *s)
-{
- int asset_size[8];
- int ss_index;
- int blownup;
- int num_audiop = 1;
- int num_assets = 1;
- int active_ss_mask[8];
- int i, j;
- int start_posn;
- int hdrsize;
- uint32_t mkr;
-
- if (get_bits_left(&s->gb) < 52)
- return;
-
- start_posn = get_bits_count(&s->gb) - 32;
-
- skip_bits(&s->gb, 8); // user data
- ss_index = get_bits(&s->gb, 2);
-
- blownup = get_bits1(&s->gb);
- hdrsize = get_bits(&s->gb, 8 + 4 * blownup) + 1; // header_size
- skip_bits(&s->gb, 16 + 4 * blownup); // hd_size
-
- s->static_fields = get_bits1(&s->gb);
- if (s->static_fields) {
- skip_bits(&s->gb, 2); // reference clock code
- skip_bits(&s->gb, 3); // frame duration code
-
- if (get_bits1(&s->gb))
- skip_bits_long(&s->gb, 36); // timestamp
-
- /* a single stream can contain multiple audio assets that can be
- * combined to form multiple audio presentations */
-
- num_audiop = get_bits(&s->gb, 3) + 1;
- if (num_audiop > 1) {
- avpriv_request_sample(s->avctx,
- "Multiple DTS-HD audio presentations");
- /* ignore such streams for now */
- return;
- }
-
- num_assets = get_bits(&s->gb, 3) + 1;
- if (num_assets > 1) {
- avpriv_request_sample(s->avctx, "Multiple DTS-HD audio assets");
- /* ignore such streams for now */
- return;
- }
-
- for (i = 0; i < num_audiop; i++)
- active_ss_mask[i] = get_bits(&s->gb, ss_index + 1);
-
- for (i = 0; i < num_audiop; i++)
- for (j = 0; j <= ss_index; j++)
- if (active_ss_mask[i] & (1 << j))
- skip_bits(&s->gb, 8); // active asset mask
-
- s->mix_metadata = get_bits1(&s->gb);
- if (s->mix_metadata) {
- int mix_out_mask_size;
-
- skip_bits(&s->gb, 2); // adjustment level
- mix_out_mask_size = (get_bits(&s->gb, 2) + 1) << 2;
- s->num_mix_configs = get_bits(&s->gb, 2) + 1;
-
- for (i = 0; i < s->num_mix_configs; i++) {
- int mix_out_mask = get_bits(&s->gb, mix_out_mask_size);
- s->mix_config_num_ch[i] = dca_exss_mask2count(mix_out_mask);
- }
- }
- }
-
- for (i = 0; i < num_assets; i++)
- asset_size[i] = get_bits_long(&s->gb, 16 + 4 * blownup);
-
- for (i = 0; i < num_assets; i++) {
- if (dca_exss_parse_asset_header(s))
- return;
- }
-
- /* not parsed further, we were only interested in the extensions mask
- * from the asset header */
-
- if (num_assets > 0) {
- j = get_bits_count(&s->gb);
- if (start_posn + hdrsize * 8 > j)
- skip_bits_long(&s->gb, start_posn + hdrsize * 8 - j);
-
- for (i = 0; i < num_assets; i++) {
- start_posn = get_bits_count(&s->gb);
- mkr = get_bits_long(&s->gb, 32);
-
- /* parse extensions that we know about */
- if (mkr == 0x655e315e) {
- dca_xbr_parse_frame(s);
- } else if (mkr == 0x47004a03) {
- dca_xxch_decode_frame(s);
- s->core_ext_mask |= DCA_EXT_XXCH; /* xxx use for chan reordering */
- } else {
- av_log(s->avctx, AV_LOG_DEBUG,
- "DTS-ExSS: unknown marker = 0x%08x\n", mkr);
- }
-
- /* skip to end of block */
- j = get_bits_count(&s->gb);
- if (start_posn + asset_size[i] * 8 > j)
- skip_bits_long(&s->gb, start_posn + asset_size[i] * 8 - j);
- }
- }
-}
-
-/**
- * Main frame decoding function
- * FIXME add arguments
- */
-static int dca_decode_frame(AVCodecContext *avctx, void *data,
- int *got_frame_ptr, AVPacket *avpkt)
-{
- AVFrame *frame = data;
- const uint8_t *buf = avpkt->data;
- int buf_size = avpkt->size;
- int channel_mask;
- int channel_layout;
- int lfe_samples;
- int num_core_channels = 0;
- int i, ret;
- float **samples_flt;
- float *src_chan;
- float *dst_chan;
- DCAContext *s = avctx->priv_data;
- int core_ss_end;
- int channels, full_channels;
- float scale;
- int achan;
- int chset;
- int mask;
- int lavc;
- int posn;
- int j, k;
- int endch;
-
- s->xch_present = 0;
-
- s->dca_buffer_size = ff_dca_convert_bitstream(buf, buf_size, s->dca_buffer,
- DCA_MAX_FRAME_SIZE + DCA_MAX_EXSS_HEADER_SIZE);
- if (s->dca_buffer_size == AVERROR_INVALIDDATA) {
- av_log(avctx, AV_LOG_ERROR, "Not a valid DCA frame\n");
- return AVERROR_INVALIDDATA;
- }
-
- init_get_bits(&s->gb, s->dca_buffer, s->dca_buffer_size * 8);
- if ((ret = dca_parse_frame_header(s)) < 0) {
- //seems like the frame is corrupt, try with the next one
- return ret;
- }
- //set AVCodec values with parsed data
- avctx->sample_rate = s->sample_rate;
- avctx->bit_rate = s->bit_rate;
-
- s->profile = FF_PROFILE_DTS;
-
- for (i = 0; i < (s->sample_blocks / 8); i++) {
- if ((ret = dca_decode_block(s, 0, i))) {
- av_log(avctx, AV_LOG_ERROR, "error decoding block\n");
- return ret;
- }
- }
-
- /* record number of core channels incase less than max channels are requested */
- num_core_channels = s->prim_channels;
-
- if (s->ext_coding)
- s->core_ext_mask = dca_ext_audio_descr_mask[s->ext_descr];
- else
- s->core_ext_mask = 0;
-
- core_ss_end = FFMIN(s->frame_size, s->dca_buffer_size) * 8;
-
- /* only scan for extensions if ext_descr was unknown or indicated a
- * supported XCh extension */
- if (s->core_ext_mask < 0 || s->core_ext_mask & (DCA_EXT_XCH | DCA_EXT_XXCH)) {
-
- /* if ext_descr was unknown, clear s->core_ext_mask so that the
- * extensions scan can fill it up */
- s->core_ext_mask = FFMAX(s->core_ext_mask, 0);
-
- /* extensions start at 32-bit boundaries into bitstream */
- skip_bits_long(&s->gb, (-get_bits_count(&s->gb)) & 31);
-
- while (core_ss_end - get_bits_count(&s->gb) >= 32) {
- uint32_t bits = get_bits_long(&s->gb, 32);
-
- switch (bits) {
- case 0x5a5a5a5a: {
- int ext_amode, xch_fsize;
-
- s->xch_base_channel = s->prim_channels;
-
- /* validate sync word using XCHFSIZE field */
- xch_fsize = show_bits(&s->gb, 10);
- if ((s->frame_size != (get_bits_count(&s->gb) >> 3) - 4 + xch_fsize) &&
- (s->frame_size != (get_bits_count(&s->gb) >> 3) - 4 + xch_fsize + 1))
- continue;
-
- /* skip length-to-end-of-frame field for the moment */
- skip_bits(&s->gb, 10);
-
- s->core_ext_mask |= DCA_EXT_XCH;
-
- /* extension amode(number of channels in extension) should be 1 */
- /* AFAIK XCh is not used for more channels */
- if ((ext_amode = get_bits(&s->gb, 4)) != 1) {
- av_log(avctx, AV_LOG_ERROR, "XCh extension amode %d not"
- " supported!\n", ext_amode);
- continue;
- }
-
- if (s->xch_base_channel < 2) {
- avpriv_request_sample(avctx, "XCh with fewer than 2 base channels");
- continue;
- }
-
- /* much like core primary audio coding header */
- dca_parse_audio_coding_header(s, s->xch_base_channel, 0);
-
- for (i = 0; i < (s->sample_blocks / 8); i++)
- if ((ret = dca_decode_block(s, s->xch_base_channel, i))) {
- av_log(avctx, AV_LOG_ERROR, "error decoding XCh extension\n");
- continue;
- }
-
- s->xch_present = 1;
- break;
- }
- case 0x47004a03:
- /* XXCh: extended channels */
- /* usually found either in core or HD part in DTS-HD HRA streams,
- * but not in DTS-ES which contains XCh extensions instead */
- s->core_ext_mask |= DCA_EXT_XXCH;
- dca_xxch_decode_frame(s);
- break;
-
- case 0x1d95f262: {
- int fsize96 = show_bits(&s->gb, 12) + 1;
- if (s->frame_size != (get_bits_count(&s->gb) >> 3) - 4 + fsize96)
- continue;
-
- av_log(avctx, AV_LOG_DEBUG, "X96 extension found at %d bits\n",
- get_bits_count(&s->gb));
- skip_bits(&s->gb, 12);
- av_log(avctx, AV_LOG_DEBUG, "FSIZE96 = %d bytes\n", fsize96);
- av_log(avctx, AV_LOG_DEBUG, "REVNO = %d\n", get_bits(&s->gb, 4));
-
- s->core_ext_mask |= DCA_EXT_X96;
- break;
- }
- }
-
- skip_bits_long(&s->gb, (-get_bits_count(&s->gb)) & 31);
- }
- } else {
- /* no supported extensions, skip the rest of the core substream */
- skip_bits_long(&s->gb, core_ss_end - get_bits_count(&s->gb));
- }
-
- if (s->core_ext_mask & DCA_EXT_X96)
- s->profile = FF_PROFILE_DTS_96_24;
- else if (s->core_ext_mask & (DCA_EXT_XCH | DCA_EXT_XXCH))
- s->profile = FF_PROFILE_DTS_ES;
-
- /* check for ExSS (HD part) */
- if (s->dca_buffer_size - s->frame_size > 32 &&
- get_bits_long(&s->gb, 32) == DCA_HD_MARKER)
- dca_exss_parse_header(s);
-
- avctx->profile = s->profile;
-
- full_channels = channels = s->prim_channels + !!s->lfe;
-
- /* If we have XXCH then the channel layout is managed differently */
- /* note that XLL will also have another way to do things */
- if (!(s->core_ext_mask & DCA_EXT_XXCH)
- || (s->core_ext_mask & DCA_EXT_XXCH && avctx->request_channels > 0
- && avctx->request_channels
- < num_core_channels + !!s->lfe + s->xxch_chset_nch[0]))
- { /* xxx should also do MA extensions */
- if (s->amode < 16) {
- avctx->channel_layout = dca_core_channel_layout[s->amode];
-
- if (s->xch_present && (!avctx->request_channels ||
- avctx->request_channels
- > num_core_channels + !!s->lfe)) {
- avctx->channel_layout |= AV_CH_BACK_CENTER;
- if (s->lfe) {
- avctx->channel_layout |= AV_CH_LOW_FREQUENCY;
- s->channel_order_tab = dca_channel_reorder_lfe_xch[s->amode];
- } else {
- s->channel_order_tab = dca_channel_reorder_nolfe_xch[s->amode];
- }
- if (s->channel_order_tab[s->xch_base_channel] < 0)
- return AVERROR_INVALIDDATA;
- } else {
- channels = num_core_channels + !!s->lfe;
- s->xch_present = 0; /* disable further xch processing */
- if (s->lfe) {
- avctx->channel_layout |= AV_CH_LOW_FREQUENCY;
- s->channel_order_tab = dca_channel_reorder_lfe[s->amode];
- } else
- s->channel_order_tab = dca_channel_reorder_nolfe[s->amode];
- }
-
- if (channels > !!s->lfe &&
- s->channel_order_tab[channels - 1 - !!s->lfe] < 0)
- return AVERROR_INVALIDDATA;
-
- if (av_get_channel_layout_nb_channels(avctx->channel_layout) != channels) {
- av_log(avctx, AV_LOG_ERROR, "Number of channels %d mismatches layout %d\n", channels, av_get_channel_layout_nb_channels(avctx->channel_layout));
- return AVERROR_INVALIDDATA;
- }
-
- if (avctx->request_channels == 2 && s->prim_channels > 2) {
- channels = 2;
- s->output = DCA_STEREO;
- avctx->channel_layout = AV_CH_LAYOUT_STEREO;
- }
- else if (avctx->request_channel_layout & AV_CH_LAYOUT_NATIVE) {
- static const int8_t dca_channel_order_native[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
- s->channel_order_tab = dca_channel_order_native;
- }
- s->lfe_index = dca_lfe_index[s->amode];
- } else {
- av_log(avctx, AV_LOG_ERROR,
- "Non standard configuration %d !\n", s->amode);
- return AVERROR_INVALIDDATA;
- }
-
- s->xxch_dmix_embedded = 0;
- } else {
- /* we only get here if an XXCH channel set can be added to the mix */
- channel_mask = s->xxch_core_spkmask;
-
- if (avctx->request_channels > 0
- && avctx->request_channels < s->prim_channels) {
- channels = num_core_channels + !!s->lfe;
- for (i = 0; i < s->xxch_chset && channels + s->xxch_chset_nch[i]
- <= avctx->request_channels; i++) {
- channels += s->xxch_chset_nch[i];
- channel_mask |= s->xxch_spk_masks[i];
- }
- } else {
- channels = s->prim_channels + !!s->lfe;
- for (i = 0; i < s->xxch_chset; i++) {
- channel_mask |= s->xxch_spk_masks[i];
- }
- }
-
- /* Given the DTS spec'ed channel mask, generate an avcodec version */
- channel_layout = 0;
- for (i = 0; i < s->xxch_nbits_spk_mask; ++i) {
- if (channel_mask & (1 << i)) {
- channel_layout |= map_xxch_to_native[i];
- }
- }
-
- /* make sure that we have managed to get equivelant dts/avcodec channel
- * masks in some sense -- unfortunately some channels could overlap */
- if (av_popcount(channel_mask) != av_popcount(channel_layout)) {
- av_log(avctx, AV_LOG_DEBUG,
- "DTS-XXCH: Inconsistant avcodec/dts channel layouts\n");
- return AVERROR_INVALIDDATA;
- }
-
- avctx->channel_layout = channel_layout;
-
- if (!(avctx->request_channel_layout & AV_CH_LAYOUT_NATIVE)) {
- /* Estimate DTS --> avcodec ordering table */
- for (chset = -1, j = 0; chset < s->xxch_chset; ++chset) {
- mask = chset >= 0 ? s->xxch_spk_masks[chset]
- : s->xxch_core_spkmask;
- for (i = 0; i < s->xxch_nbits_spk_mask; i++) {
- if (mask & ~(DCA_XXCH_LFE1 | DCA_XXCH_LFE2) & (1 << i)) {
- lavc = map_xxch_to_native[i];
- posn = av_popcount(channel_layout & (lavc - 1));
- s->xxch_order_tab[j++] = posn;
- }
- }
- }
-
- s->lfe_index = av_popcount(channel_layout & (AV_CH_LOW_FREQUENCY-1));
- } else { /* native ordering */
- for (i = 0; i < channels; i++)
- s->xxch_order_tab[i] = i;
-
- s->lfe_index = channels - 1;
- }
-
- s->channel_order_tab = s->xxch_order_tab;
- }
-
- if (avctx->channels != channels) {
- if (avctx->channels)
- av_log(avctx, AV_LOG_INFO, "Number of channels changed in DCA decoder (%d -> %d)\n", avctx->channels, channels);
- avctx->channels = channels;
- }
-
- /* get output buffer */
- frame->nb_samples = 256 * (s->sample_blocks / 8);
- if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
- return ret;
- samples_flt = (float **)frame->extended_data;
-
- /* allocate buffer for extra channels if downmixing */
- if (avctx->channels < full_channels) {
- ret = av_samples_get_buffer_size(NULL, full_channels - channels,
- frame->nb_samples,
- avctx->sample_fmt, 0);
- if (ret < 0)
- return ret;
-
- av_fast_malloc(&s->extra_channels_buffer,
- &s->extra_channels_buffer_size, ret);
- if (!s->extra_channels_buffer)
- return AVERROR(ENOMEM);
-
- ret = av_samples_fill_arrays((uint8_t **)s->extra_channels, NULL,
- s->extra_channels_buffer,
- full_channels - channels,
- frame->nb_samples, avctx->sample_fmt, 0);
- if (ret < 0)
- return ret;
- }
-
- /* filter to get final output */
- for (i = 0; i < (s->sample_blocks / 8); i++) {
- int ch;
-
- for (ch = 0; ch < channels; ch++)
- s->samples_chanptr[ch] = samples_flt[ch] + i * 256;
- for (; ch < full_channels; ch++)
- s->samples_chanptr[ch] = s->extra_channels[ch - channels] + i * 256;
-
- dca_filter_channels(s, i);
-
- /* If this was marked as a DTS-ES stream we need to subtract back- */
- /* channel from SL & SR to remove matrixed back-channel signal */
- if ((s->source_pcm_res & 1) && s->xch_present) {
- float *back_chan = s->samples_chanptr[s->channel_order_tab[s->xch_base_channel]];
- float *lt_chan = s->samples_chanptr[s->channel_order_tab[s->xch_base_channel - 2]];
- float *rt_chan = s->samples_chanptr[s->channel_order_tab[s->xch_base_channel - 1]];
- s->fdsp.vector_fmac_scalar(lt_chan, back_chan, -M_SQRT1_2, 256);
- s->fdsp.vector_fmac_scalar(rt_chan, back_chan, -M_SQRT1_2, 256);
- }
-
- /* If stream contains XXCH, we might need to undo an embedded downmix */
- if (s->xxch_dmix_embedded) {
- /* Loop over channel sets in turn */
- ch = num_core_channels;
- for (chset = 0; chset < s->xxch_chset; chset++) {
- endch = ch + s->xxch_chset_nch[chset];
- mask = s->xxch_dmix_embedded;
-
- /* undo downmix */
- for (j = ch; j < endch; j++) {
- if (mask & (1 << j)) { /* this channel has been mixed-out */
- src_chan = s->samples_chanptr[s->channel_order_tab[j]];
- for (k = 0; k < endch; k++) {
- achan = s->channel_order_tab[k];
- scale = s->xxch_dmix_coeff[j][k];
- if (scale != 0.0) {
- dst_chan = s->samples_chanptr[achan];
- s->fdsp.vector_fmac_scalar(dst_chan, src_chan,
- -scale, 256);
- }
- }
- }
- }
-
- /* if a downmix has been embedded then undo the pre-scaling */
- if ((mask & (1 << ch)) && s->xxch_dmix_sf[chset] != 1.0f) {
- scale = s->xxch_dmix_sf[chset];
-
- for (j = 0; j < ch; j++) {
- src_chan = s->samples_chanptr[s->channel_order_tab[j]];
- for (k = 0; k < 256; k++)
- src_chan[k] *= scale;
- }
-
- /* LFE channel is always part of core, scale if it exists */
- if (s->lfe) {
- src_chan = s->samples_chanptr[s->lfe_index];
- for (k = 0; k < 256; k++)
- src_chan[k] *= scale;
- }
- }
-
- ch = endch;
- }
-
- }
- }
-
- /* update lfe history */
- lfe_samples = 2 * s->lfe * (s->sample_blocks / 8);
- for (i = 0; i < 2 * s->lfe * 4; i++)
- s->lfe_data[i] = s->lfe_data[i + lfe_samples];
-
- *got_frame_ptr = 1;
-
- return buf_size;
-}
-
-
-
-/**
- * DCA initialization
- *
- * @param avctx pointer to the AVCodecContext
- */
-
-static av_cold int dca_decode_init(AVCodecContext *avctx)
-{
- DCAContext *s = avctx->priv_data;
-
- s->avctx = avctx;
- dca_init_vlcs();
-
- avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
- ff_mdct_init(&s->imdct, 6, 1, 1.0);
- ff_synth_filter_init(&s->synth);
- ff_dcadsp_init(&s->dcadsp);
- ff_fmt_convert_init(&s->fmt_conv, avctx);
-
- avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
-
- /* allow downmixing to stereo */
- if (avctx->channels > 0 && avctx->request_channels < avctx->channels &&
- avctx->request_channels == 2) {
- avctx->channels = avctx->request_channels;
- }
-
- return 0;
-}
-
-static av_cold int dca_decode_end(AVCodecContext *avctx)
-{
- DCAContext *s = avctx->priv_data;
- ff_mdct_end(&s->imdct);
- av_freep(&s->extra_channels_buffer);
- return 0;
-}
-
-static const AVProfile profiles[] = {
- { FF_PROFILE_DTS, "DTS" },
- { FF_PROFILE_DTS_ES, "DTS-ES" },
- { FF_PROFILE_DTS_96_24, "DTS 96/24" },
- { FF_PROFILE_DTS_HD_HRA, "DTS-HD HRA" },
- { FF_PROFILE_DTS_HD_MA, "DTS-HD MA" },
- { FF_PROFILE_UNKNOWN },
-};
-
-AVCodec ff_dca_decoder = {
- .name = "dca",
- .long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"),
- .type = AVMEDIA_TYPE_AUDIO,
- .id = AV_CODEC_ID_DTS,
- .priv_data_size = sizeof(DCAContext),
- .init = dca_decode_init,
- .decode = dca_decode_frame,
- .close = dca_decode_end,
- .capabilities = CODEC_CAP_CHANNEL_CONF | CODEC_CAP_DR1,
- .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
- AV_SAMPLE_FMT_NONE },
- .profiles = NULL_IF_CONFIG_SMALL(profiles),
-};
diff --git a/libavcodec/dcadsp.c b/libavcodec/dcadsp.c
deleted file mode 100644
index abeba24..0000000
--- a/libavcodec/dcadsp.c
+++ b/dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2004 Gildas Bazin
- * Copyright (c) 2010 Mans Rullgard <mans@mansr.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
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/intreadwrite.h"
-#include "dcadsp.h"
-
-static void dca_lfe_fir_c(float *out, const float *in, const float *coefs,
- int decifactor, float scale)
-{
- float *out2 = out + decifactor;
- const float *cf0 = coefs;
- const float *cf1 = coefs + 256;
- int j, k;
-
- /* One decimated sample generates 2*decifactor interpolated ones */
- for (k = 0; k < decifactor; k++) {
- float v0 = 0.0;
- float v1 = 0.0;
- for (j = 0; j < 256 / decifactor; j++) {
- float s = in[-j];
- v0 += s * *cf0++;
- v1 += s * *--cf1;
- }
- *out++ = v0 * scale;
- *out2++ = v1 * scale;
- }
-}
-
-static void dca_qmf_32_subbands(float samples_in[32][8], int sb_act,
- SynthFilterContext *synth, FFTContext *imdct,
- float synth_buf_ptr[512],
- int *synth_buf_offset, float synth_buf2[32],
- const float window[512], float *samples_out,
- float raXin[32], float scale)
-{
- int i;
- int subindex;
-
- for (i = sb_act; i < 32; i++)
- raXin[i] = 0.0;
-
- /* Reconstructed channel sample index */
- for (subindex = 0; subindex < 8; subindex++) {
- /* Load in one sample from each subband and clear inactive subbands */
- for (i = 0; i < sb_act; i++) {
- unsigned sign = (i - 1) & 2;
- uint32_t v = AV_RN32A(&samples_in[i][subindex]) ^ sign << 30;
- AV_WN32A(&raXin[i], v);
- }
-
- synth->synth_filter_float(imdct, synth_buf_ptr, synth_buf_offset,
- synth_buf2, window, samples_out, raXin, scale);
- samples_out += 32;
- }
-}
-
-av_cold void ff_dcadsp_init(DCADSPContext *s)
-{
- s->lfe_fir = dca_lfe_fir_c;
- s->qmf_32_subbands = dca_qmf_32_subbands;
- if (ARCH_ARM) ff_dcadsp_init_arm(s);
-}
diff --git a/libavcodec/dcadsp.h b/libavcodec/dcadsp.h
deleted file mode 100644
index d86c1f3..0000000
--- a/libavcodec/dcadsp.h
+++ b/dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General 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_DCADSP_H
-#define AVCODEC_DCADSP_H
-
-#include "avfft.h"
-#include "synth_filter.h"
-
-typedef struct DCADSPContext {
- void (*lfe_fir)(float *out, const float *in, const float *coefs,
- int decifactor, float scale);
- void (*qmf_32_subbands)(float samples_in[32][8], int sb_act,
- SynthFilterContext *synth, FFTContext *imdct,
- float synth_buf_ptr[512],
- int *synth_buf_offset, float synth_buf2[32],
- const float window[512], float *samples_out,
- float raXin[32], float scale);
-} DCADSPContext;
-
-void ff_dcadsp_init(DCADSPContext *s);
-void ff_dcadsp_init_arm(DCADSPContext *s);
-
-#endif /* AVCODEC_DCADSP_H */
diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c
deleted file mode 100644
index cb73f42..0000000
--- a/libavcodec/dcaenc.c
+++ b/dev/null
@@ -1,974 +0,0 @@
-/*
- * DCA encoder
- * Copyright (C) 2008-2012 Alexander E. Patrakov
- * 2010 Benjamin Larsson
- * 2011 Xiang Wang
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General 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 "libavutil/avassert.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "avcodec.h"
-#include "dca.h"
-#include "dcadata.h"
-#include "dcaenc.h"
-#include "internal.h"
-#include "put_bits.h"
-
-#define MAX_CHANNELS 6
-#define DCA_MAX_FRAME_SIZE 16384
-#define DCA_HEADER_SIZE 13
-#define DCA_LFE_SAMPLES 8
-
-#define DCA_SUBBANDS 32
-#define SUBFRAMES 1
-#define SUBSUBFRAMES 2
-#define SUBBAND_SAMPLES (SUBFRAMES * SUBSUBFRAMES * 8)
-#define AUBANDS 25
-
-typedef struct DCAContext {
- PutBitContext pb;
- int frame_size;
- int frame_bits;
- int fullband_channels;
- int channels;
- int lfe_channel;
- int samplerate_index;
- int bitrate_index;
- int channel_config;
- const int32_t *band_interpolation;
- const int32_t *band_spectrum;
- int lfe_scale_factor;
- softfloat lfe_quant;
- int32_t lfe_peak_cb;
-
- int32_t history[512][MAX_CHANNELS]; /* This is a circular buffer */
- int32_t subband[SUBBAND_SAMPLES][DCA_SUBBANDS][MAX_CHANNELS];
- int32_t quantized[SUBBAND_SAMPLES][DCA_SUBBANDS][MAX_CHANNELS];
- int32_t peak_cb[DCA_SUBBANDS][MAX_CHANNELS];
- int32_t downsampled_lfe[DCA_LFE_SAMPLES];
- int32_t masking_curve_cb[SUBSUBFRAMES][256];
- int abits[DCA_SUBBANDS][MAX_CHANNELS];
- int scale_factor[DCA_SUBBANDS][MAX_CHANNELS];
- softfloat quant[DCA_SUBBANDS][MAX_CHANNELS];
- int32_t eff_masking_curve_cb[256];
- int32_t band_masking_cb[32];
- int32_t worst_quantization_noise;
- int32_t worst_noise_ever;
- int consumed_bits;
-} DCAContext;
-
-static int32_t cos_table[2048];
-static int32_t band_interpolation[2][512];
-static int32_t band_spectrum[2][8];
-static int32_t auf[9][AUBANDS][256];
-static int32_t cb_to_add[256];
-static int32_t cb_to_level[2048];
-static int32_t lfe_fir_64i[512];
-
-/* Transfer function of outer and middle ear, Hz -> dB */
-static double hom(double f)
-{
- double f1 = f / 1000;
-
- return -3.64 * pow(f1, -0.8)
- + 6.8 * exp(-0.6 * (f1 - 3.4) * (f1 - 3.4))
- - 6.0 * exp(-0.15 * (f1 - 8.7) * (f1 - 8.7))
- - 0.0006 * (f1 * f1) * (f1 * f1);
-}
-
-static double gammafilter(int i, double f)
-{
- double h = (f - fc[i]) / erb[i];
-
- h = 1 + h * h;
- h = 1 / (h * h);
- return 20 * log10(h);
-}
-
-static int encode_init(AVCodecContext *avctx)
-{
- DCAContext *c = avctx->priv_data;
- uint64_t layout = avctx->channel_layout;
- int i, min_frame_bits;
-
- c->fullband_channels = c->channels = avctx->channels;
- c->lfe_channel = (avctx->channels == 3 || avctx->channels == 6);
- c->band_interpolation = band_interpolation[1];
- c->band_spectrum = band_spectrum[1];
- c->worst_quantization_noise = -2047;
- c->worst_noise_ever = -2047;
-
- if (!layout) {
- av_log(avctx, AV_LOG_WARNING, "No channel layout specified. The "
- "encoder will guess the layout, but it "
- "might be incorrect.\n");
- layout = av_get_default_channel_layout(avctx->channels);
- }
- switch (layout) {
- case AV_CH_LAYOUT_MONO: c->channel_config = 0; break;
- case AV_CH_LAYOUT_STEREO: c->channel_config = 2; break;
- case AV_CH_LAYOUT_2_2: c->channel_config = 8; break;
- case AV_CH_LAYOUT_5POINT0: c->channel_config = 9; break;
- case AV_CH_LAYOUT_5POINT1: c->channel_config = 9; break;
- default:
- av_log(avctx, AV_LOG_ERROR, "Unsupported channel layout!\n");
- return AVERROR_PATCHWELCOME;
- }
-
- if (c->lfe_channel)
- c->fullband_channels--;
-
- for (i = 0; i < 9; i++) {
- if (sample_rates[i] == avctx->sample_rate)
- break;
- }
- if (i == 9)
- return AVERROR(EINVAL);
- c->samplerate_index = i;
-
- if (avctx->bit_rate < 32000 || avctx->bit_rate > 3840000) {
- av_log(avctx, AV_LOG_ERROR, "Bit rate %i not supported.", avctx->bit_rate);
- return AVERROR(EINVAL);
- }
- for (i = 0; dca_bit_rates[i] < avctx->bit_rate; i++)
- ;
- c->bitrate_index = i;
- avctx->bit_rate = dca_bit_rates[i];
- c->frame_bits = FFALIGN((avctx->bit_rate * 512 + avctx->sample_rate - 1) / avctx->sample_rate, 32);
- min_frame_bits = 132 + (493 + 28 * 32) * c->fullband_channels + c->lfe_channel * 72;
- if (c->frame_bits < min_frame_bits || c->frame_bits > (DCA_MAX_FRAME_SIZE << 3))
- return AVERROR(EINVAL);
-
- c->frame_size = (c->frame_bits + 7) / 8;
-
- avctx->frame_size = 32 * SUBBAND_SAMPLES;
-
- if (!cos_table[0]) {
- int j, k;
-
- for (i = 0; i < 2048; i++) {
- cos_table[i] = (int32_t)(0x7fffffff * cos(M_PI * i / 1024));
- cb_to_level[i] = (int32_t)(0x7fffffff * pow(10, -0.005 * i));
- }
-
- /* FIXME: probably incorrect */
- for (i = 0; i < 256; i++) {
- lfe_fir_64i[i] = (int32_t)(0x01ffffff * lfe_fir_64[i]);
- lfe_fir_64i[511 - i] = (int32_t)(0x01ffffff * lfe_fir_64[i]);
- }
-
- for (i = 0; i < 512; i++) {
- band_interpolation[0][i] = (int32_t)(0x1000000000ULL * fir_32bands_perfect[i]);
- band_interpolation[1][i] = (int32_t)(0x1000000000ULL * fir_32bands_nonperfect[i]);
- }
-
- for (i = 0; i < 9; i++) {
- for (j = 0; j < AUBANDS; j++) {
- for (k = 0; k < 256; k++) {
- double freq = sample_rates[i] * (k + 0.5) / 512;
-
- auf[i][j][k] = (int32_t)(10 * (hom(freq) + gammafilter(j, freq)));
- }
- }
- }
-
- for (i = 0; i < 256; i++) {
- double add = 1 + pow(10, -0.01 * i);
- cb_to_add[i] = (int32_t)(100 * log10(add));
- }
- for (j = 0; j < 8; j++) {
- double accum = 0;
- for (i = 0; i < 512; i++) {
- double reconst = fir_32bands_perfect[i] * ((i & 64) ? (-1) : 1);
- accum += reconst * cos(2 * M_PI * (i + 0.5 - 256) * (j + 0.5) / 512);
- }
- band_spectrum[0][j] = (int32_t)(200 * log10(accum));
- }
- for (j = 0; j < 8; j++) {
- double accum = 0;
- for (i = 0; i < 512; i++) {
- double reconst = fir_32bands_nonperfect[i] * ((i & 64) ? (-1) : 1);
- accum += reconst * cos(2 * M_PI * (i + 0.5 - 256) * (j + 0.5) / 512);
- }
- band_spectrum[1][j] = (int32_t)(200 * log10(accum));
- }
- }
- return 0;
-}
-
-static inline int32_t cos_t(int x)
-{
- return cos_table[x & 2047];
-}
-
-static inline int32_t sin_t(int x)
-{
- return cos_t(x - 512);
-}
-
-static inline int32_t half32(int32_t a)
-{
- return (a + 1) >> 1;
-}
-
-static inline int32_t mul32(int32_t a, int32_t b)
-{
- int64_t r = (int64_t)a * b + 0x80000000ULL;
- return r >> 32;
-}
-
-static void subband_transform(DCAContext *c, const int32_t *input)
-{
- int ch, subs, i, k, j;
-
- for (ch = 0; ch < c->fullband_channels; ch++) {
- /* History is copied because it is also needed for PSY */
- int32_t hist[512];
- int hist_start = 0;
-
- for (i = 0; i < 512; i++)
- hist[i] = c->history[i][ch];
-
- for (subs = 0; subs < SUBBAND_SAMPLES; subs++) {
- int32_t accum[64];
- int32_t resp;
- int band;
-
- /* Calculate the convolutions at once */
- for (i = 0; i < 64; i++)
- accum[i] = 0;
-
- for (k = 0, i = hist_start, j = 0;
- i < 512; k = (k + 1) & 63, i++, j++)
- accum[k] += mul32(hist[i], c->band_interpolation[j]);
- for (i = 0; i < hist_start; k = (k + 1) & 63, i++, j++)
- accum[k] += mul32(hist[i], c->band_interpolation[j]);
-
- for (k = 16; k < 32; k++)
- accum[k] = accum[k] - accum[31 - k];
- for (k = 32; k < 48; k++)
- accum[k] = accum[k] + accum[95 - k];
-
- for (band = 0; band < 32; band++) {
- resp = 0;
- for (i = 16; i < 48; i++) {
- int s = (2 * band + 1) * (2 * (i + 16) + 1);
- resp += mul32(accum[i], cos_t(s << 3)) >> 3;
- }
-
- c->subband[subs][band][ch] = ((band + 1) & 2) ? -resp : resp;
- }
-
- /* Copy in 32 new samples from input */
- for (i = 0; i < 32; i++)
- hist[i + hist_start] = input[(subs * 32 + i) * c->channels + ch];
- hist_start = (hist_start + 32) & 511;
- }
- }
-}
-
-static void lfe_downsample(DCAContext *c, const int32_t *input)
-{
- /* FIXME: make 128x LFE downsampling possible */
- int i, j, lfes;
- int32_t hist[512];
- int32_t accum;
- int hist_start = 0;
-
- for (i = 0; i < 512; i++)
- hist[i] = c->history[i][c->channels - 1];
-
- for (lfes = 0; lfes < DCA_LFE_SAMPLES; lfes++) {
- /* Calculate the convolution */
- accum = 0;
-
- for (i = hist_start, j = 0; i < 512; i++, j++)
- accum += mul32(hist[i], lfe_fir_64i[j]);
- for (i = 0; i < hist_start; i++, j++)
- accum += mul32(hist[i], lfe_fir_64i[j]);
-
- c->downsampled_lfe[lfes] = accum;
-
- /* Copy in 64 new samples from input */
- for (i = 0; i < 64; i++)
- hist[i + hist_start] = input[(lfes * 64 + i) * c->channels + c->channels - 1];
-
- hist_start = (hist_start + 64) & 511;
- }
-}
-
-typedef struct {
- int32_t re;
- int32_t im;
-} cplx32;
-
-static void fft(const int32_t in[2 * 256], cplx32 out[256])
-{
- cplx32 buf[256], rin[256], rout[256];
- int i, j, k, l;
-
- /* do two transforms in parallel */
- for (i = 0; i < 256; i++) {
- /* Apply the Hann window */
- rin[i].re = mul32(in[2 * i], 0x3fffffff - (cos_t(8 * i + 2) >> 1));
- rin[i].im = mul32(in[2 * i + 1], 0x3fffffff - (cos_t(8 * i + 6) >> 1));
- }
- /* pre-rotation */
- for (i = 0; i < 256; i++) {
- buf[i].re = mul32(cos_t(4 * i + 2), rin[i].re)
- - mul32(sin_t(4 * i + 2), rin[i].im);
- buf[i].im = mul32(cos_t(4 * i + 2), rin[i].im)
- + mul32(sin_t(4 * i + 2), rin[i].re);
- }
-
- for (j = 256, l = 1; j != 1; j >>= 1, l <<= 1) {
- for (k = 0; k < 256; k += j) {
- for (i = k; i < k + j / 2; i++) {
- cplx32 sum, diff;
- int t = 8 * l * i;
-
- sum.re = buf[i].re + buf[i + j / 2].re;
- sum.im = buf[i].im + buf[i + j / 2].im;
-
- diff.re = buf[i].re - buf[i + j / 2].re;
- diff.im = buf[i].im - buf[i + j / 2].im;
-
- buf[i].re = half32(sum.re);
- buf[i].im = half32(sum.im);
-
- buf[i + j / 2].re = mul32(diff.re, cos_t(t))
- - mul32(diff.im, sin_t(t));
- buf[i + j / 2].im = mul32(diff.im, cos_t(t))
- + mul32(diff.re, sin_t(t));
- }
- }
- }
- /* post-rotation */
- for (i = 0; i < 256; i++) {
- int b = ff_reverse[i];
- rout[i].re = mul32(buf[b].re, cos_t(4 * i))
- - mul32(buf[b].im, sin_t(4 * i));
- rout[i].im = mul32(buf[b].im, cos_t(4 * i))
- + mul32(buf[b].re, sin_t(4 * i));
- }
- for (i = 0; i < 256; i++) {
- /* separate the results of the two transforms */
- cplx32 o1, o2;
-
- o1.re = rout[i].re - rout[255 - i].re;
- o1.im = rout[i].im + rout[255 - i].im;
-
- o2.re = rout[i].im - rout[255 - i].im;
- o2.im = -rout[i].re - rout[255 - i].re;
-
- /* combine them into one long transform */
- out[i].re = mul32( o1.re + o2.re, cos_t(2 * i + 1))
- + mul32( o1.im - o2.im, sin_t(2 * i + 1));
- out[i].im = mul32( o1.im + o2.im, cos_t(2 * i + 1))
- + mul32(-o1.re + o2.re, sin_t(2 * i + 1));
- }
-}
-
-static int32_t get_cb(int32_t in)
-{
- int i, res;
-
- res = 0;
- if (in < 0)
- in = -in;
- for (i = 1024; i > 0; i >>= 1) {
- if (cb_to_level[i + res] >= in)
- res += i;
- }
- return -res;
-}
-
-static int32_t add_cb(int32_t a, int32_t b)
-{
- if (a < b)
- FFSWAP(int32_t, a, b);
-
- if (a - b >= 256)
- return a;
- return a + cb_to_add[a - b];
-}
-
-static void adjust_jnd(int samplerate_index,
- const int32_t in[512], int32_t out_cb[256])
-{
- int32_t power[256];
- cplx32 out[256];
- int32_t out_cb_unnorm[256];
- int32_t denom;
- const int32_t ca_cb = -1114;
- const int32_t cs_cb = 928;
- int i, j;
-
- fft(in, out);
-
- for (j = 0; j < 256; j++) {
- power[j] = add_cb(get_cb(out[j].re), get_cb(out[j].im));
- out_cb_unnorm[j] = -2047; /* and can only grow */
- }
-
- for (i = 0; i < AUBANDS; i++) {
- denom = ca_cb; /* and can only grow */
- for (j = 0; j < 256; j++)
- denom = add_cb(denom, power[j] + auf[samplerate_index][i][j]);
- for (j = 0; j < 256; j++)
- out_cb_unnorm[j] = add_cb(out_cb_unnorm[j],
- -denom + auf[samplerate_index][i][j]);
- }
-
- for (j = 0; j < 256; j++)
- out_cb[j] = add_cb(out_cb[j], -out_cb_unnorm[j] - ca_cb - cs_cb);
-}
-
-typedef void (*walk_band_t)(DCAContext *c, int band1, int band2, int f,
- int32_t spectrum1, int32_t spectrum2, int channel,
- int32_t * arg);
-
-static void walk_band_low(DCAContext *c, int band, int channel,
- walk_band_t walk, int32_t *arg)
-{
- int f;
-
- if (band == 0) {
- for (f = 0; f < 4; f++)
- walk(c, 0, 0, f, 0, -2047, channel, arg);
- } else {
- for (f = 0; f < 8; f++)
- walk(c, band, band - 1, 8 * band - 4 + f,
- c->band_spectrum[7 - f], c->band_spectrum[f], channel, arg);
- }
-}
-
-static void walk_band_high(DCAContext *c, int band, int channel,
- walk_band_t walk, int32_t *arg)
-{
- int f;
-
- if (band == 31) {
- for (f = 0; f < 4; f++)
- walk(c, 31, 31, 256 - 4 + f, 0, -2047, channel, arg);
- } else {
- for (f = 0; f < 8; f++)
- walk(c, band, band + 1, 8 * band + 4 + f,
- c->band_spectrum[f], c->band_spectrum[7 - f], channel, arg);
- }
-}
-
-static void update_band_masking(DCAContext *c, int band1, int band2,
- int f, int32_t spectrum1, int32_t spectrum2,
- int channel, int32_t * arg)
-{
- int32_t value = c->eff_masking_curve_cb[f] - spectrum1;
-
- if (value < c->band_masking_cb[band1])
- c->band_masking_cb[band1] = value;
-}
-
-static void calc_masking(DCAContext *c, const int32_t *input)
-{
- int i, k, band, ch, ssf;
- int32_t data[512];
-
- for (i = 0; i < 256; i++)
- for (ssf = 0; ssf < SUBSUBFRAMES; ssf++)
- c->masking_curve_cb[ssf][i] = -2047;
-
- for (ssf = 0; ssf < SUBSUBFRAMES; ssf++)
- for (ch = 0; ch < c->fullband_channels; ch++) {
- for (i = 0, k = 128 + 256 * ssf; k < 512; i++, k++)
- data[i] = c->history[k][ch];
- for (k -= 512; i < 512; i++, k++)
- data[i] = input[k * c->channels + ch];
- adjust_jnd(c->samplerate_index, data, c->masking_curve_cb[ssf]);
- }
- for (i = 0; i < 256; i++) {
- int32_t m = 2048;
-
- for (ssf = 0; ssf < SUBSUBFRAMES; ssf++)
- if (c->masking_curve_cb[ssf][i] < m)
- m = c->masking_curve_cb[ssf][i];
- c->eff_masking_curve_cb[i] = m;
- }
-
- for (band = 0; band < 32; band++) {
- c->band_masking_cb[band] = 2048;
- walk_band_low(c, band, 0, update_band_masking, NULL);
- walk_band_high(c, band, 0, update_band_masking, NULL);
- }
-}
-
-static void find_peaks(DCAContext *c)
-{
- int band, ch;
-
- for (band = 0; band < 32; band++)
- for (ch = 0; ch < c->fullband_channels; ch++) {
- int sample;
- int32_t m = 0;
-
- for (sample = 0; sample < SUBBAND_SAMPLES; sample++) {
- int32_t s = abs(c->subband[sample][band][ch]);
- if (m < s)
- m = s;
- }
- c->peak_cb[band][ch] = get_cb(m);
- }
-
- if (c->lfe_channel) {
- int sample;
- int32_t m = 0;
-
- for (sample = 0; sample < DCA_LFE_SAMPLES; sample++)
- if (m < abs(c->downsampled_lfe[sample]))
- m = abs(c->downsampled_lfe[sample]);
- c->lfe_peak_cb = get_cb(m);
- }
-}
-
-static const int snr_fudge = 128;
-#define USED_1ABITS 1
-#define USED_NABITS 2
-#define USED_26ABITS 4
-
-static int init_quantization_noise(DCAContext *c, int noise)
-{
- int ch, band, ret = 0;
-
- c->consumed_bits = 132 + 493 * c->fullband_channels;
- if (c->lfe_channel)
- c->consumed_bits += 72;
-
- /* attempt to guess the bit distribution based on the prevoius frame */
- for (ch = 0; ch < c->fullband_channels; ch++) {
- for (band = 0; band < 32; band++) {
- int snr_cb = c->peak_cb[band][ch] - c->band_masking_cb[band] - noise;
-
- if (snr_cb >= 1312) {
- c->abits[band][ch] = 26;
- ret |= USED_26ABITS;
- } else if (snr_cb >= 222) {
- c->abits[band][ch] = 8 + mul32(snr_cb - 222, 69000000);
- ret |= USED_NABITS;
- } else if (snr_cb >= 0) {
- c->abits[band][ch] = 2 + mul32(snr_cb, 106000000);
- ret |= USED_NABITS;
- } else {
- c->abits[band][ch] = 1;
- ret |= USED_1ABITS;
- }
- }
- }
-
- for (band = 0; band < 32; band++)
- for (ch = 0; ch < c->fullband_channels; ch++) {
- c->consumed_bits += bit_consumption[c->abits[band][ch]];
- }
-
- return ret;
-}
-
-static void assign_bits(DCAContext *c)
-{
- /* Find the bounds where the binary search should work */
- int low, high, down;
- int used_abits = 0;
-
- init_quantization_noise(c, c->worst_quantization_noise);
- low = high = c->worst_quantization_noise;
- if (c->consumed_bits > c->frame_bits) {
- while (c->consumed_bits > c->frame_bits) {
- av_assert0(used_abits != USED_1ABITS);
- low = high;
- high += snr_fudge;
- used_abits = init_quantization_noise(c, high);
- }
- } else {
- while (c->consumed_bits <= c->frame_bits) {
- high = low;
- if (used_abits == USED_26ABITS)
- goto out; /* The requested bitrate is too high, pad with zeros */
- low -= snr_fudge;
- used_abits = init_quantization_noise(c, low);
- }
- }
-
- /* Now do a binary search between low and high to see what fits */
- for (down = snr_fudge >> 1; down; down >>= 1) {
- init_quantization_noise(c, high - down);
- if (c->consumed_bits <= c->frame_bits)
- high -= down;
- }
- init_quantization_noise(c, high);
-out:
- c->worst_quantization_noise = high;
- if (high > c->worst_noise_ever)
- c->worst_noise_ever = high;
-}
-
-static void shift_history(DCAContext *c, const int32_t *input)
-{
- int k, ch;
-
- for (k = 0; k < 512; k++)
- for (ch = 0; ch < c->channels; ch++)
- c->history[k][ch] = input[k * c->channels + ch];
-}
-
-static int32_t quantize_value(int32_t value, softfloat quant)
-{
- int32_t offset = 1 << (quant.e - 1);
-
- value = mul32(value, quant.m) + offset;
- value = value >> quant.e;
- return value;
-}
-
-static int calc_one_scale(int32_t peak_cb, int abits, softfloat *quant)
-{
- int32_t peak;
- int our_nscale, try_remove;
- softfloat our_quant;
-
- av_assert0(peak_cb <= 0);
- av_assert0(peak_cb >= -2047);
-
- our_nscale = 127;
- peak = cb_to_level[-peak_cb];
-
- for (try_remove = 64; try_remove > 0; try_remove >>= 1) {
- if (scalefactor_inv[our_nscale - try_remove].e + stepsize_inv[abits].e <= 17)
- continue;
- our_quant.m = mul32(scalefactor_inv[our_nscale - try_remove].m, stepsize_inv[abits].m);
- our_quant.e = scalefactor_inv[our_nscale - try_remove].e + stepsize_inv[abits].e - 17;
- if ((quant_levels[abits] - 1) / 2 < quantize_value(peak, our_quant))
- continue;
- our_nscale -= try_remove;
- }
-
- if (our_nscale >= 125)
- our_nscale = 124;
-
- quant->m = mul32(scalefactor_inv[our_nscale].m, stepsize_inv[abits].m);
- quant->e = scalefactor_inv[our_nscale].e + stepsize_inv[abits].e - 17;
- av_assert0((quant_levels[abits] - 1) / 2 >= quantize_value(peak, *quant));
-
- return our_nscale;
-}
-
-static void calc_scales(DCAContext *c)
-{
- int band, ch;
-
- for (band = 0; band < 32; band++)
- for (ch = 0; ch < c->fullband_channels; ch++)
- c->scale_factor[band][ch] = calc_one_scale(c->peak_cb[band][ch],
- c->abits[band][ch],
- &c->quant[band][ch]);
-
- if (c->lfe_channel)
- c->lfe_scale_factor = calc_one_scale(c->lfe_peak_cb, 11, &c->lfe_quant);
-}
-
-static void quantize_all(DCAContext *c)
-{
- int sample, band, ch;
-
- for (sample = 0; sample < SUBBAND_SAMPLES; sample++)
- for (band = 0; band < 32; band++)
- for (ch = 0; ch < c->fullband_channels; ch++)
- c->quantized[sample][band][ch] = quantize_value(c->subband[sample][band][ch], c->quant[band][ch]);
-}
-
-static void put_frame_header(DCAContext *c)
-{
- /* SYNC */
- put_bits(&c->pb, 16, 0x7ffe);
- put_bits(&c->pb, 16, 0x8001);
-
- /* Frame type: normal */
- put_bits(&c->pb, 1, 1);
-
- /* Deficit sample count: none */
- put_bits(&c->pb, 5, 31);
-
- /* CRC is not present */
- put_bits(&c->pb, 1, 0);
-
- /* Number of PCM sample blocks */
- put_bits(&c->pb, 7, SUBBAND_SAMPLES - 1);
-
- /* Primary frame byte size */
- put_bits(&c->pb, 14, c->frame_size - 1);
-
- /* Audio channel arrangement */
- put_bits(&c->pb, 6, c->channel_config);
-
- /* Core audio sampling frequency */
- put_bits(&c->pb, 4, bitstream_sfreq[c->samplerate_index]);
-
- /* Transmission bit rate */
- put_bits(&c->pb, 5, c->bitrate_index);
-
- /* Embedded down mix: disabled */
- put_bits(&c->pb, 1, 0);
-
- /* Embedded dynamic range flag: not present */
- put_bits(&c->pb, 1, 0);
-
- /* Embedded time stamp flag: not present */
- put_bits(&c->pb, 1, 0);
-
- /* Auxiliary data flag: not present */
- put_bits(&c->pb, 1, 0);
-
- /* HDCD source: no */
- put_bits(&c->pb, 1, 0);
-
- /* Extension audio ID: N/A */
- put_bits(&c->pb, 3, 0);
-
- /* Extended audio data: not present */
- put_bits(&c->pb, 1, 0);
-
- /* Audio sync word insertion flag: after each sub-frame */
- put_bits(&c->pb, 1, 0);
-
- /* Low frequency effects flag: not present or 64x subsampling */
- put_bits(&c->pb, 2, c->lfe_channel ? 2 : 0);
-
- /* Predictor history switch flag: on */
- put_bits(&c->pb, 1, 1);
-
- /* No CRC */
- /* Multirate interpolator switch: non-perfect reconstruction */
- put_bits(&c->pb, 1, 0);
-
- /* Encoder software revision: 7 */
- put_bits(&c->pb, 4, 7);
-
- /* Copy history: 0 */
- put_bits(&c->pb, 2, 0);
-
- /* Source PCM resolution: 16 bits, not DTS ES */
- put_bits(&c->pb, 3, 0);
-
- /* Front sum/difference coding: no */
- put_bits(&c->pb, 1, 0);
-
- /* Surrounds sum/difference coding: no */
- put_bits(&c->pb, 1, 0);
-
- /* Dialog normalization: 0 dB */
- put_bits(&c->pb, 4, 0);
-}
-
-static void put_primary_audio_header(DCAContext *c)
-{
- static const int bitlen[11] = { 0, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3 };
- static const int thr[11] = { 0, 1, 3, 3, 3, 3, 7, 7, 7, 7, 7 };
-
- int ch, i;
- /* Number of subframes */
- put_bits(&c->pb, 4, SUBFRAMES - 1);
-
- /* Number of primary audio channels */
- put_bits(&c->pb, 3, c->fullband_channels - 1);
-
- /* Subband activity count */
- for (ch = 0; ch < c->fullband_channels; ch++)
- put_bits(&c->pb, 5, DCA_SUBBANDS - 2);
-
- /* High frequency VQ start subband */
- for (ch = 0; ch < c->fullband_channels; ch++)
- put_bits(&c->pb, 5, DCA_SUBBANDS - 1);
-
- /* Joint intensity coding index: 0, 0 */
- for (ch = 0; ch < c->fullband_channels; ch++)
- put_bits(&c->pb, 3, 0);
-
- /* Transient mode codebook: A4, A4 (arbitrary) */
- for (ch = 0; ch < c->fullband_channels; ch++)
- put_bits(&c->pb, 2, 0);
-
- /* Scale factor code book: 7 bit linear, 7-bit sqrt table (for each channel) */
- for (ch = 0; ch < c->fullband_channels; ch++)
- put_bits(&c->pb, 3, 6);
-
- /* Bit allocation quantizer select: linear 5-bit */
- for (ch = 0; ch < c->fullband_channels; ch++)
- put_bits(&c->pb, 3, 6);
-
- /* Quantization index codebook select: dummy data
- to avoid transmission of scale factor adjustment */
- for (i = 1; i < 11; i++)
- for (ch = 0; ch < c->fullband_channels; ch++)
- put_bits(&c->pb, bitlen[i], thr[i]);
-
- /* Scale factor adjustment index: not transmitted */
- /* Audio header CRC check word: not transmitted */
-}
-
-static void put_subframe_samples(DCAContext *c, int ss, int band, int ch)
-{
- if (c->abits[band][ch] <= 7) {
- int sum, i, j;
- for (i = 0; i < 8; i += 4) {
- sum = 0;
- for (j = 3; j >= 0; j--) {
- sum *= quant_levels[c->abits[band][ch]];
- sum += c->quantized[ss * 8 + i + j][band][ch];
- sum += (quant_levels[c->abits[band][ch]] - 1) / 2;
- }
- put_bits(&c->pb, bit_consumption[c->abits[band][ch]] / 4, sum);
- }
- } else {
- int i;
- for (i = 0; i < 8; i++) {
- int bits = bit_consumption[c->abits[band][ch]] / 16;
- int32_t mask = (1 << bits) - 1;
- put_bits(&c->pb, bits, c->quantized[ss * 8 + i][band][ch] & mask);
- }
- }
-}
-
-static void put_subframe(DCAContext *c, int subframe)
-{
- int i, band, ss, ch;
-
- /* Subsubframes count */
- put_bits(&c->pb, 2, SUBSUBFRAMES -1);
-
- /* Partial subsubframe sample count: dummy */
- put_bits(&c->pb, 3, 0);
-
- /* Prediction mode: no ADPCM, in each channel and subband */
- for (ch = 0; ch < c->fullband_channels; ch++)
- for (band = 0; band < DCA_SUBBANDS; band++)
- put_bits(&c->pb, 1, 0);
-
- /* Prediction VQ addres: not transmitted */
- /* Bit allocation index */
- for (ch = 0; ch < c->fullband_channels; ch++)
- for (band = 0; band < DCA_SUBBANDS; band++)
- put_bits(&c->pb, 5, c->abits[band][ch]);
-
- if (SUBSUBFRAMES > 1) {
- /* Transition mode: none for each channel and subband */
- for (ch = 0; ch < c->fullband_channels; ch++)
- for (band = 0; band < DCA_SUBBANDS; band++)
- put_bits(&c->pb, 1, 0); /* codebook A4 */
- }
-
- /* Scale factors */
- for (ch = 0; ch < c->fullband_channels; ch++)
- for (band = 0; band < DCA_SUBBANDS; band++)
- put_bits(&c->pb, 7, c->scale_factor[band][ch]);
-
- /* Joint subband scale factor codebook select: not transmitted */
- /* Scale factors for joint subband coding: not transmitted */
- /* Stereo down-mix coefficients: not transmitted */
- /* Dynamic range coefficient: not transmitted */
- /* Stde information CRC check word: not transmitted */
- /* VQ encoded high frequency subbands: not transmitted */
-
- /* LFE data: 8 samples and scalefactor */
- if (c->lfe_channel) {
- for (i = 0; i < DCA_LFE_SAMPLES; i++)
- put_bits(&c->pb, 8, quantize_value(c->downsampled_lfe[i], c->lfe_quant) & 0xff);
- put_bits(&c->pb, 8, c->lfe_scale_factor);
- }
-
- /* Audio data (subsubframes) */
- for (ss = 0; ss < SUBSUBFRAMES ; ss++)
- for (ch = 0; ch < c->fullband_channels; ch++)
- for (band = 0; band < DCA_SUBBANDS; band++)
- put_subframe_samples(c, ss, band, ch);
-
- /* DSYNC */
- put_bits(&c->pb, 16, 0xffff);
-}
-
-static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
- const AVFrame *frame, int *got_packet_ptr)
-{
- DCAContext *c = avctx->priv_data;
- const int32_t *samples;
- int ret, i;
-
- if ((ret = ff_alloc_packet2(avctx, avpkt, c->frame_size )) < 0)
- return ret;
-
- samples = (const int32_t *)frame->data[0];
-
- subband_transform(c, samples);
- if (c->lfe_channel)
- lfe_downsample(c, samples);
-
- calc_masking(c, samples);
- find_peaks(c);
- assign_bits(c);
- calc_scales(c);
- quantize_all(c);
- shift_history(c, samples);
-
- init_put_bits(&c->pb, avpkt->data, avpkt->size);
- put_frame_header(c);
- put_primary_audio_header(c);
- for (i = 0; i < SUBFRAMES; i++)
- put_subframe(c, i);
-
- flush_put_bits(&c->pb);
-
- avpkt->pts = frame->pts;
- avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples);
- avpkt->size = c->frame_size + 1;
- *got_packet_ptr = 1;
- return 0;
-}
-
-static const AVCodecDefault defaults[] = {
- { "b", "1411200" },
- { NULL },
-};
-
-AVCodec ff_dca_encoder = {
- .name = "dca",
- .long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"),
- .type = AVMEDIA_TYPE_AUDIO,
- .id = AV_CODEC_ID_DTS,
- .priv_data_size = sizeof(DCAContext),
- .init = encode_init,
- .encode2 = encode_frame,
- .capabilities = CODEC_CAP_EXPERIMENTAL,
- .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32,
- AV_SAMPLE_FMT_NONE },
- .supported_samplerates = sample_rates,
- .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
- AV_CH_LAYOUT_STEREO,
- AV_CH_LAYOUT_2_2,
- AV_CH_LAYOUT_5POINT0,
- AV_CH_LAYOUT_5POINT1,
- 0 },
- .defaults = defaults,
-};
diff --git a/libavcodec/dcaenc.h b/libavcodec/dcaenc.h
deleted file mode 100644
index 20f557b..0000000
--- a/libavcodec/dcaenc.h
+++ b/dev/null
@@ -1,113 +0,0 @@
-/*
- * DCA encoder tables
- * Copyright (C) 2008-2012 Alexander E. Patrakov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General 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_DCAENC_H
-#define AVCODEC_DCAENC_H
-
-#include <stdint.h>
-
-typedef struct {
- int32_t m;
- int32_t e;
-} softfloat;
-
-static const int sample_rates[] = {
- 8000, 16000, 32000, 11025, 22050, 44100, 12000, 24000, 48000, 0,
-};
-
-static const uint8_t bitstream_sfreq[] = { 1, 2, 3, 6, 7, 8, 11, 12, 13 };
-
-/* Auditory filter center frequencies and bandwidths, in Hz.
- * The last two are made up, because there is no scientific data.
- */
-static uint16_t fc[] = {
- 50, 150, 250, 350, 450, 570, 700, 840, 1000, 1170, 1370, 1600, 1850, 2150,
- 2500, 2900, 3400, 4000, 4800, 5800, 7000, 8500, 10500, 13500, 17000
-};
-
-static uint16_t erb[] = {
- 80, 100, 100, 100, 110, 120, 140, 150, 160, 190, 210, 240, 280,
- 320, 380, 450, 550, 700, 900, 1100, 1300, 1800, 2500, 3500, 4500
-};
-
-static const softfloat stepsize_inv[27] = {
- {0, 0}, {1342177360, 21}, {2147483647, 21}, {1342177360, 20},
- {1819901661, 20}, {2147483647, 20}, {1278263843, 19}, {1579032492, 19},
- {1412817763, 18}, {1220162327, 17}, {1118482133, 16}, {1917391412, 16},
- {1766017772, 15}, {1525212826, 14}, {1290553940, 13}, {2097179000, 13},
- {1677683200, 12}, {1497972244, 11}, {1310893147, 10}, {1165354136, 9},
- {1748031204, 9}, {1542092044, 8}, {1636178017, 7}, {1636178017, 6},
- {1636178017, 5}, {1636178017, 4}, {1636178017, 3},
-};
-
-static const softfloat scalefactor_inv[128] = {
- {2147483647, 1}, {2147483647, 1}, {2147483647, 2}, {2147483647, 2},
- {2147483647, 2}, {2147483647, 2}, {1431655765, 2}, {1431655765, 2},
- {1431655765, 2}, {2147483647, 3}, {2147483647, 3}, {1717986918, 3},
- {1431655765, 3}, {1227133513, 3}, {1227133513, 3}, {2147483647, 4},
- {1717986918, 4}, {1561806289, 4}, {1431655765, 4}, {1227133513, 4},
- {2147483647, 5}, {1908874353, 5}, {1717986918, 5}, {1493901668, 5},
- {1321528398, 5}, {1145324612, 5}, {2021161080, 6}, {1808407282, 6},
- {1561806289, 6}, {1374389534, 6}, {1227133513, 6}, {2147483647, 7},
- {1908874353, 7}, {1676084798, 7}, {1477838209, 7}, {1296593900, 7},
- {1145324612, 7}, {2021161080, 8}, {1773405851, 8}, {1561806289, 8},
- {1374389534, 8}, {1216273924, 8}, {2139127680, 9}, {1882725390, 9},
- {1660893697, 9}, {1462116526, 9}, {1287484341, 9}, {1135859119, 9},
- {1999112050, 10}, {1762037865, 10}, {1552982525, 10}, {1367551775, 10},
- {1205604855, 10}, {2124660150, 11}, {1871509153, 11}, {1648443220, 11},
- {1452459217, 11}, {1279990253, 11}, {1127704233, 11}, {1987368509, 12},
- {1750814693, 12}, {1542632939, 12}, {1359099663, 12}, {1197398995, 12},
- {2109880792, 13}, {1858853132, 13}, {1638006149, 13}, {1443165385, 13},
- {1271479187, 13}, {1120235993, 13}, {1973767086, 14}, {1739045674, 14},
- {1532153461, 14}, {1349922194, 14}, {1189384493, 14}, {2095804865, 15},
- {1846464029, 15}, {1626872524, 15}, {1433347133, 15}, {1262853884, 15},
- {1112619678, 15}, {1960569045, 16}, {1727349015, 16}, {1521881227, 16},
- {1340842289, 16}, {1181357555, 16}, {2081669156, 17}, {1834047752, 17},
- {1615889229, 17}, {1423675973, 17}, {1254322457, 17}, {1105123583, 17},
- {1947330755, 18}, {1715693602, 18}, {1511607799, 18}, {1331801790, 18},
- {1173384427, 18}, {2067616532, 19}, {1821667648, 19}, {1604980024, 19},
- {1414066955, 19}, {1245861410, 19}, {1097665748, 19}, {1934193616, 20},
- {1704119624, 20}, {1501412075, 20}, {1322817107, 20}, {1165466323, 20},
- {2053666205, 21}, {1809379407, 21}, {1594151671, 21}, {1404526328, 21},
- {1237455941, 21}, {1090259329, 21}, {1921143210, 22}, {1692621231, 22},
- {1491281857, 22}, {1313892269, 22}, {1157603482, 22}, {2039810470, 23},
- {1797172644, 23}, {1583396912, 23}, {1395050052, 23}, {1229107276, 23},
- {1082903494, 23}, {1082903494, 23}, {1082903494, 23}, {1082903494, 23},
-};
-
-/* manually derived from
- * Table B.5: Selection of quantization levels and codebooks
- * FIXME: will become invalid when Huffman codes are introduced.
- */
-static const int bit_consumption[27] = {
- -8, 28, 40, 48, 52, 60, 68, 76, 80, 96,
- 112, 128, 144, 160, 176, 192, 208, 224, 240, 256,
- 272, 288, 304, 320, 336, 352, 368,
-};
-
-/* Table B.5: Selection of quantization levels and codebooks */
-static const int quant_levels[27] = {
- 1, 3, 5, 7, 9, 13, 17, 25, 32, 64,
- 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536,
- 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608,
-};
-
-#endif /* AVCODEC_DCAENC_H */
diff --git a/libavcodec/dcahuff.h b/libavcodec/dcahuff.h
deleted file mode 100644
index cbc8429..0000000
--- a/libavcodec/dcahuff.h
+++ b/dev/null
@@ -1,1076 +0,0 @@
-/*
- * DCA compatible decoder - huffman tables
- * Copyright (C) 2004 Gildas Bazin
- * Copyright (C) 2007 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 AVCODEC_DCAHUFF_H
-#define AVCODEC_DCAHUFF_H
-
-#include <stdint.h>
-#include <stdlib.h>
-
-#define TMODE_COUNT 4
-static const uint8_t tmode_vlc_bits[TMODE_COUNT] = { 3, 3, 3, 2 };
-static const uint16_t tmode_codes[TMODE_COUNT][4] = {
- { 0x0000, 0x0002, 0x0006, 0x0007 },
- { 0x0002, 0x0006, 0x0007, 0x0000 },
- { 0x0006, 0x0007, 0x0000, 0x0002 },
- { 0x0000, 0x0001, 0x0002, 0x0003 }
-};
-static const uint8_t tmode_bits[TMODE_COUNT][4] = {
- { 1, 2, 3, 3 },
- { 2, 3, 3, 1 },
- { 3, 3, 1, 2 },
- { 2, 2, 2, 2 }
-};
-
-
-#define BITALLOC_12_COUNT 5
-#define BITALLOC_12_VLC_BITS 9
-static const uint8_t bitalloc_12_vlc_bits[BITALLOC_12_COUNT] = {
- 9, 7, 7, 9, 9
-};
-static const uint16_t bitalloc_12_codes[BITALLOC_12_COUNT][12] = {
- {
- 0x0000, 0x0002, 0x0006, 0x000E, 0x001E, 0x003E, 0x00FF, 0x00FE,
- 0x01FB, 0x01FA, 0x01F9, 0x01F8,
- },
- {
- 0x0001, 0x0000, 0x0002, 0x000F, 0x000C, 0x001D, 0x0039, 0x0038,
- 0x0037, 0x0036, 0x0035, 0x0034,
- },
- {
- 0x0000, 0x0007, 0x0005, 0x0004, 0x0002, 0x000D, 0x000C, 0x0006,
- 0x000F, 0x001D, 0x0039, 0x0038,
- },
- {
- 0x0003, 0x0002, 0x0000, 0x0002, 0x0006, 0x000E, 0x001E, 0x003E,
- 0x007E, 0x00FE, 0x01FF, 0x01FE,
- },
- {
- 0x0001, 0x0000, 0x0002, 0x0006, 0x000E, 0x003F, 0x003D, 0x007C,
- 0x0079, 0x0078, 0x00FB, 0x00FA,
- }
-};
-static const uint8_t bitalloc_12_bits[BITALLOC_12_COUNT][12] = {
- { 1, 2, 3, 4, 5, 6, 8, 8, 9, 9, 9, 9 },
- { 1, 2, 3, 5, 5, 6, 7, 7, 7, 7, 7, 7 },
- { 2, 3, 3, 3, 3, 4, 4, 4, 5, 6, 7, 7 },
- { 2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10 },
- { 1, 2, 3, 4, 5, 7, 7, 8, 8, 8, 9, 9 }
-};
-
-
-#define SCALES_COUNT 5
-#define SCALES_VLC_BITS 9
-static const uint16_t scales_codes[SCALES_COUNT][129] = {
- {
- 0x3AB0, 0x3AB2, 0x3AB4, 0x3AB6, 0x3AB8, 0x3ABA, 0x3ABC, 0x3ABE,
- 0x3AC0, 0x3AC2, 0x3AC4, 0x3AC6, 0x3AC8, 0x3ACA, 0x3ACC, 0x3ACE,
- 0x3AD0, 0x3AD2, 0x3AD4, 0x3AD6, 0x3AD8, 0x3ADA, 0x3ADC, 0x3ADE,
- 0x3AE0, 0x3AE2, 0x3AE4, 0x3AE6, 0x3AE8, 0x3AEA, 0x3AEC, 0x3AEE,
- 0x3AF0, 0x3AF2, 0x3AF4, 0x3AF6, 0x3AF8, 0x3AFA, 0x3AFC, 0x3AFE,
- 0x0540, 0x0542, 0x0544, 0x0546, 0x0548, 0x054A, 0x054C, 0x054E,
- 0x0558, 0x055E, 0x02AD, 0x0154, 0x0754, 0x03A8, 0x0056, 0x0028,
- 0x00E8, 0x004A, 0x000B, 0x003B, 0x0013, 0x0003, 0x000F, 0x0005,
- 0x0001, 0x0006, 0x0000, 0x0008, 0x001C, 0x0004, 0x0024, 0x004B,
- 0x00E9, 0x0029, 0x0057, 0x03A9, 0x0755, 0x0155, 0x02AE, 0x055F,
- 0x0559, 0x054F, 0x054D, 0x054B, 0x0549, 0x0547, 0x0545, 0x0543,
- 0x0541, 0x3AFF, 0x3AFD, 0x3AFB, 0x3AF9, 0x3AF7, 0x3AF5, 0x3AF3,
- 0x3AF1, 0x3AEF, 0x3AED, 0x3AEB, 0x3AE9, 0x3AE7, 0x3AE5, 0x3AE3,
- 0x3AE1, 0x3ADF, 0x3ADD, 0x3ADB, 0x3AD9, 0x3AD7, 0x3AD5, 0x3AD3,
- 0x3AD1, 0x3ACF, 0x3ACD, 0x3ACB, 0x3AC9, 0x3AC7, 0x3AC5, 0x3AC3,
- 0x3AC1, 0x3ABF, 0x3ABD, 0x3ABB, 0x3AB9, 0x3AB7, 0x3AB5, 0x3AB3,
- 0x3AB1,
- },
- {
- 0x0F60, 0x0F62, 0x0F64, 0x0F66, 0x0F68, 0x0F6A, 0x0F6C, 0x0F6E,
- 0x0F70, 0x0F72, 0x0F74, 0x0F76, 0x0F78, 0x0F7A, 0x0F7C, 0x0F7E,
- 0x0F80, 0x0F82, 0x0F84, 0x0F86, 0x0F88, 0x0F8A, 0x0F8C, 0x0F8E,
- 0x0F90, 0x0F92, 0x0F94, 0x0F96, 0x0F98, 0x0F9A, 0x0F9C, 0x0F9E,
- 0x0FA0, 0x0FA2, 0x0FA4, 0x0FA6, 0x0FA8, 0x0FAA, 0x0FAC, 0x0FAE,
- 0x0FB0, 0x0FB2, 0x0FB4, 0x0FB6, 0x0FB8, 0x0FBA, 0x0FBC, 0x0FBE,
- 0x07A0, 0x07A2, 0x03D2, 0x01EA, 0x00FC, 0x007F, 0x001C, 0x000C,
- 0x0004, 0x0034, 0x0010, 0x001B, 0x0009, 0x000B, 0x000E, 0x0001,
- 0x0003, 0x0002, 0x000F, 0x000C, 0x000A, 0x0000, 0x0011, 0x0035,
- 0x0005, 0x000D, 0x001D, 0x003C, 0x00FD, 0x01EB, 0x03D3, 0x07A3,
- 0x07A1, 0x0FBF, 0x0FBD, 0x0FBB, 0x0FB9, 0x0FB7, 0x0FB5, 0x0FB3,
- 0x0FB1, 0x0FAF, 0x0FAD, 0x0FAB, 0x0FA9, 0x0FA7, 0x0FA5, 0x0FA3,
- 0x0FA1, 0x0F9F, 0x0F9D, 0x0F9B, 0x0F99, 0x0F97, 0x0F95, 0x0F93,
- 0x0F91, 0x0F8F, 0x0F8D, 0x0F8B, 0x0F89, 0x0F87, 0x0F85, 0x0F83,
- 0x0F81, 0x0F7F, 0x0F7D, 0x0F7B, 0x0F79, 0x0F77, 0x0F75, 0x0F73,
- 0x0F71, 0x0F6F, 0x0F6D, 0x0F6B, 0x0F69, 0x0F67, 0x0F65, 0x0F63,
- 0x0F61,
- },
- {
- 0x51D0, 0x51D2, 0x51D4, 0x51D6, 0x51D8, 0x51DA, 0x51DC, 0x51DE,
- 0x51E0, 0x51E2, 0x51E4, 0x51E6, 0x51E8, 0x51EA, 0x51EC, 0x51EE,
- 0x51F0, 0x51F2, 0x51F4, 0x51F6, 0x51F8, 0x51FA, 0x51FC, 0x51FE,
- 0x70C0, 0x70C2, 0x70C4, 0x70C6, 0x70C8, 0x70CA, 0x70CC, 0x70CE,
- 0x70EC, 0x10EA, 0x3868, 0x3877, 0x0876, 0x1C35, 0x0434, 0x0A34,
- 0x0E1B, 0x021B, 0x051B, 0x070F, 0x010F, 0x0380, 0x0080, 0x0140,
- 0x01C1, 0x0041, 0x00A1, 0x00E2, 0x0022, 0x0052, 0x0072, 0x0012,
- 0x002A, 0x003A, 0x000A, 0x0016, 0x001E, 0x0006, 0x000C, 0x0000,
- 0x0004, 0x0001, 0x000D, 0x0007, 0x001F, 0x0017, 0x000B, 0x003B,
- 0x002B, 0x0013, 0x0073, 0x0053, 0x0023, 0x00E3, 0x00A2, 0x0042,
- 0x01C2, 0x0141, 0x0081, 0x0381, 0x028C, 0x010C, 0x051C, 0x021C,
- 0x0E1C, 0x0A35, 0x0435, 0x1C3A, 0x0877, 0x0874, 0x3869, 0x10EB,
- 0x70ED, 0x70CF, 0x70CD, 0x70CB, 0x70C9, 0x70C7, 0x70C5, 0x70C3,
- 0x70C1, 0x51FF, 0x51FD, 0x51FB, 0x51F9, 0x51F7, 0x51F5, 0x51F3,
- 0x51F1, 0x51EF, 0x51ED, 0x51EB, 0x51E9, 0x51E7, 0x51E5, 0x51E3,
- 0x51E1, 0x51DF, 0x51DD, 0x51DB, 0x51D9, 0x51D7, 0x51D5, 0x51D3,
- 0x51D1,
- },
- {
- 0x6F64, 0x6F66, 0x6F68, 0x6F6A, 0x6F6C, 0x6F6E, 0x6F70, 0x6F72,
- 0x6F74, 0x6F76, 0x6F78, 0x6F7A, 0x6F7C, 0x6F7E, 0x6F80, 0x6F82,
- 0x6F84, 0x6F86, 0x6F88, 0x6F8A, 0x6F8C, 0x6F8E, 0x6F90, 0x6F92,
- 0x6F94, 0x6F96, 0x6F98, 0x6F9A, 0x6F9C, 0x6F9E, 0x6FA0, 0x6FA2,
- 0x6FA4, 0x6FA6, 0x6FA8, 0x6FAA, 0x6FAC, 0x6FAE, 0x6FB0, 0x6FB2,
- 0x6FB4, 0x6FB6, 0x17B4, 0x37DC, 0x0BDB, 0x1BEF, 0x05EE, 0x0DF8,
- 0x02F8, 0x06FD, 0x017D, 0x037F, 0x00BF, 0x0040, 0x00C0, 0x0021,
- 0x0061, 0x0011, 0x0031, 0x0009, 0x0019, 0x0006, 0x000E, 0x0004,
- 0x0000, 0x0005, 0x000F, 0x0007, 0x001A, 0x000A, 0x0036, 0x0016,
- 0x006E, 0x002E, 0x00C1, 0x0041, 0x01BC, 0x00BC, 0x037A, 0x017A,
- 0x02F9, 0x0DF9, 0x05EF, 0x05EC, 0x1BD8, 0x37DD, 0x17B5, 0x6FB7,
- 0x6FB5, 0x6FB3, 0x6FB1, 0x6FAF, 0x6FAD, 0x6FAB, 0x6FA9, 0x6FA7,
- 0x6FA5, 0x6FA3, 0x6FA1, 0x6F9F, 0x6F9D, 0x6F9B, 0x6F99, 0x6F97,
- 0x6F95, 0x6F93, 0x6F91, 0x6F8F, 0x6F8D, 0x6F8B, 0x6F89, 0x6F87,
- 0x6F85, 0x6F83, 0x6F81, 0x6F7F, 0x6F7D, 0x6F7B, 0x6F79, 0x6F77,
- 0x6F75, 0x6F73, 0x6F71, 0x6F6F, 0x6F6D, 0x6F6B, 0x6F69, 0x6F67,
- 0x6F65,
- },
- {
- 0xDF54, 0xDF56, 0xDFC8, 0xDFCA, 0xDFCC, 0xDFCE, 0xDFD0, 0xDFD2,
- 0xDFD4, 0xDFD6, 0xDFD8, 0xDFDA, 0xDFDC, 0xDFDE, 0xDFE0, 0xDFE2,
- 0x0FE8, 0x2FEA, 0x6FA8, 0x6FF6, 0x07F5, 0x07F7, 0x37D2, 0x37F9,
- 0x03F8, 0x0BF8, 0x0BFB, 0x1BEB, 0x01FA, 0x05FA, 0x09FA, 0x0DFA,
- 0x0DFF, 0x00FF, 0x02FF, 0x06FB, 0x007C, 0x017C, 0x027C, 0x027F,
- 0x003C, 0x00BC, 0x013C, 0x01BC, 0x001C, 0x005C, 0x009C, 0x00DC,
- 0x000C, 0x002C, 0x004C, 0x006C, 0x0004, 0x0014, 0x0024, 0x0034,
- 0x0000, 0x0008, 0x0010, 0x0018, 0x001E, 0x0002, 0x0006, 0x000A,
- 0x000E, 0x000B, 0x0007, 0x0003, 0x001F, 0x0019, 0x0011, 0x0009,
- 0x0001, 0x0035, 0x0025, 0x0015, 0x0005, 0x006D, 0x004D, 0x002D,
- 0x000D, 0x00DD, 0x009D, 0x005D, 0x001D, 0x01BD, 0x013D, 0x00BD,
- 0x003D, 0x037C, 0x027D, 0x017D, 0x007D, 0x06FC, 0x04FC, 0x02FC,
- 0x00FC, 0x0DFB, 0x09FB, 0x05FB, 0x01FB, 0x1BF8, 0x1BE8, 0x0BF9,
- 0x03F9, 0x37FA, 0x37D3, 0x17F4, 0x07F6, 0x6FF7, 0x6FA9, 0x2FEB,
- 0x0FE9, 0xDFE3, 0xDFE1, 0xDFDF, 0xDFDD, 0xDFDB, 0xDFD9, 0xDFD7,
- 0xDFD5, 0xDFD3, 0xDFD1, 0xDFCF, 0xDFCD, 0xDFCB, 0xDFC9, 0xDF57,
- 0xDF55,
- }
-};
-
-static const uint8_t scales_bits[SCALES_COUNT][129] = {
- {
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 12, 11, 11, 10, 9, 8,
- 8, 7, 6, 6, 5, 4, 4, 3,
- 2, 3, 3, 4, 5, 5, 6, 7,
- 8, 8, 9, 10, 11, 11, 12, 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,
- },
- {
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 14, 14, 13, 12, 11, 10, 8, 7,
- 6, 6, 5, 5, 4, 4, 4, 3,
- 3, 3, 4, 4, 4, 4, 5, 6,
- 6, 7, 8, 9, 11, 12, 13, 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, 14, 14, 14, 13, 13, 12, 12,
- 12, 11, 11, 11, 10, 10, 9, 9,
- 9, 8, 8, 8, 7, 7, 7, 6,
- 6, 6, 5, 5, 5, 4, 4, 3,
- 3, 3, 4, 4, 5, 5, 5, 6,
- 6, 6, 7, 7, 7, 8, 8, 8,
- 9, 9, 9, 10, 10, 10, 11, 11,
- 12, 12, 12, 13, 13, 13, 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, 14, 14, 13, 13, 12, 12,
- 11, 11, 10, 10, 9, 8, 8, 7,
- 7, 6, 6, 5, 5, 4, 4, 3,
- 2, 3, 4, 4, 5, 5, 6, 6,
- 7, 7, 8, 8, 9, 9, 10, 10,
- 11, 12, 12, 12, 13, 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,
- },
- {
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 15, 15, 15, 15, 14, 14, 14, 14,
- 13, 13, 13, 13, 12, 12, 12, 12,
- 12, 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, 5, 4, 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, 10, 11, 11, 11,
- 11, 12, 12, 12, 12, 13, 13, 13,
- 13, 14, 14, 14, 14, 15, 15, 15,
- 15, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16,
- }
-};
-
-static const uint16_t bitalloc_3_codes[3] =
-{
- 0x0003, 0x0000, 0x0002,
-};
-static const uint8_t bitalloc_3_bits[3] =
-{
- 2, 1, 2,
-};
-
-static const uint16_t bitalloc_5_codes_a[5] =
-{
- 0x000F, 0x0006, 0x0000, 0x0002, 0x000E,
-};
-static const uint16_t bitalloc_5_codes_b[5] =
-{
- 0x0007, 0x0001, 0x0002, 0x0000, 0x0006,
-};
-static const uint16_t bitalloc_5_codes_c[5] =
-{
- 0x0007, 0x0005, 0x0000, 0x0004, 0x0006,
-};
-static const uint8_t bitalloc_5_bits_a[5] =
-{
- 4, 3, 1, 2, 4,
-};
-static const uint8_t bitalloc_5_bits_b[5] =
-{
- 3, 2, 2, 2, 3,
-};
-static const uint8_t bitalloc_5_bits_c[5] =
-{
- 3, 3, 1, 3, 3,
-};
-
-static const uint16_t bitalloc_7_codes_a[7] =
-{
- 0x001E, 0x000E, 0x0005, 0x0000, 0x0006, 0x0004, 0x001F,
-};
-static const uint16_t bitalloc_7_codes_b[7] =
-{
- 0x0014, 0x000B, 0x0000, 0x0003, 0x0001, 0x0004, 0x0015,
-};
-static const uint16_t bitalloc_7_codes_c[7] =
-{
- 0x0000, 0x0002, 0x0001, 0x0003, 0x0002, 0x0003, 0x0001,
-};
-static const uint8_t bitalloc_7_bits_a[7] =
-{
- 5, 4, 3, 1, 3, 3, 5,
-};
-static const uint8_t bitalloc_7_bits_b[7] =
-{
- 5, 4, 2, 2, 2, 3, 5,
-};
-static const uint8_t bitalloc_7_bits_c[7] =
-{
- 4, 4, 2, 2, 2, 4, 4,
-};
-
-static const uint16_t bitalloc_9_codes_a[9] =
-{
- 0x0030, 0x0019, 0x0009, 0x0005, 0x0000, 0x0007, 0x000D, 0x0008,
- 0x0031,
-};
-static const uint16_t bitalloc_9_codes_b[9] =
-{
- 0x0018, 0x001A, 0x0002, 0x0007, 0x0002, 0x0000, 0x0003, 0x001B,
- 0x0019,
-};
-static const uint16_t bitalloc_9_codes_c[9] =
-{
- 0x001C, 0x000F, 0x0002, 0x0007, 0x0002, 0x0000, 0x0006, 0x0006,
- 0x001D,
-};
-static const uint8_t bitalloc_9_bits_a[9] =
-{
- 6, 5, 4, 3, 1, 3, 4, 4, 6,
-};
-static const uint8_t bitalloc_9_bits_b[9] =
-{
- 5, 5, 3, 3, 2, 2, 3, 5, 5,
-};
-static const uint8_t bitalloc_9_bits_c[9] =
-{
- 6, 5, 3, 3, 2, 2, 3, 4, 6,
-};
-
-static const uint16_t bitalloc_13_codes_a[13] =
-{
- 0x0070, 0x002E, 0x0039, 0x001D, 0x000C, 0x000F, 0x0000, 0x0004,
- 0x000D, 0x000A, 0x0016, 0x002F, 0x0071,
-};
-static const uint16_t bitalloc_13_codes_b[13] =
-{
- 0x0038, 0x0010, 0x001D, 0x0007, 0x000F, 0x0005, 0x0000, 0x0006,
- 0x0002, 0x0009, 0x0006, 0x0011, 0x0039,
-};
-static const uint16_t bitalloc_13_codes_c[13] =
-{
- 0x0004, 0x001A, 0x0003, 0x000E, 0x0000, 0x0003, 0x0005, 0x0004,
- 0x0002, 0x000F, 0x000C, 0x001B, 0x0005,
-};
-static const uint8_t bitalloc_13_bits_a[13] =
-{
- 7, 6, 6, 5, 4, 4, 1, 3, 4, 4, 5, 6, 7,
-};
-static const uint8_t bitalloc_13_bits_b[13] =
-{
- 6, 5, 5, 4, 4, 3, 2, 3, 3, 4, 4, 5, 6,
-};
-static const uint8_t bitalloc_13_bits_c[13] =
-{
- 5, 5, 4, 4, 3, 3, 3, 3, 3, 4, 4, 5, 5,
-};
-
-static const uint16_t bitalloc_17_codes_a[17] =
-{
- 0x0154, 0x00AB, 0x002B, 0x000B, 0x0003, 0x000A, 0x0001, 0x0006,
- 0x0001, 0x0007, 0x0004, 0x000B, 0x0000, 0x0004, 0x0014, 0x0054,
- 0x0155,
-};
-static const uint16_t bitalloc_17_codes_b[17] =
-{
- 0x007C, 0x003F, 0x0019, 0x000D, 0x001C, 0x0008, 0x000F, 0x0005,
- 0x0000, 0x0006, 0x0002, 0x0009, 0x001D, 0x000E, 0x001E, 0x0018,
- 0x007D,
-};
-static const uint16_t bitalloc_17_codes_c[17] =
-{
- 0x002C, 0x0017, 0x0005, 0x001C, 0x0003, 0x000A, 0x000F, 0x0003,
- 0x0006, 0x0004, 0x0000, 0x000B, 0x0004, 0x001D, 0x000A, 0x0004,
- 0x002D,
-};
-static const uint16_t bitalloc_17_codes_d[17] =
-{
- 0x0100, 0x0102, 0x0082, 0x0042, 0x0022, 0x0012, 0x000A, 0x0006,
- 0x0000, 0x0007, 0x000B, 0x0013, 0x0023, 0x0043, 0x0083, 0x0103,
- 0x0101,
-};
-static const uint16_t bitalloc_17_codes_e[17] =
-{
- 0x00E8, 0x00F6, 0x0075, 0x0034, 0x003B, 0x001B, 0x001F, 0x0004,
- 0x0000, 0x0005, 0x000C, 0x001C, 0x003C, 0x0035, 0x007A, 0x00F7,
- 0x00E9,
-};
-static const uint16_t bitalloc_17_codes_f[17] =
-{
- 0x0004, 0x0003, 0x001E, 0x0001, 0x0001, 0x000E, 0x0001, 0x0004,
- 0x0006, 0x0005, 0x0002, 0x000F, 0x0006, 0x000E, 0x001F, 0x0000,
- 0x0005,
-};
-static const uint16_t bitalloc_17_codes_g[17] =
-{
- 0x0060, 0x007E, 0x0031, 0x0019, 0x000D, 0x0004, 0x0000, 0x0006,
- 0x0002, 0x0007, 0x0001, 0x0005, 0x000E, 0x001E, 0x003E, 0x007F,
- 0x0061,
-};
-static const uint8_t bitalloc_17_bits_a[17] =
-{
- 12, 11, 9, 7, 5, 4, 3, 3, 2, 3, 3, 4, 4, 6, 8, 10,
- 12,
-};
-static const uint8_t bitalloc_17_bits_b[17] =
-{
- 8, 7, 6, 5, 5, 4, 4, 3, 2, 3, 3, 4, 5, 5, 6, 6,
- 8,
-};
-static const uint8_t bitalloc_17_bits_c[17] =
-{
- 7, 6, 5, 5, 4, 4, 4, 3, 3, 3, 3, 4, 4, 5, 5, 5,
- 7,
-};
-static const uint8_t bitalloc_17_bits_d[17] =
-{
- 9, 9, 8, 7, 6, 5, 4, 3, 1, 3, 4, 5, 6, 7, 8, 9,
- 9,
-};
-static const uint8_t bitalloc_17_bits_e[17] =
-{
- 8, 8, 7, 6, 6, 5, 5, 3, 1, 3, 4, 5, 6, 6, 7, 8,
- 8,
-};
-static const uint8_t bitalloc_17_bits_f[17] =
-{
- 8, 7, 6, 5, 4, 4, 3, 3, 3, 3, 3, 4, 4, 5, 6, 6,
- 8,
-};
-static const uint8_t bitalloc_17_bits_g[17] =
-{
- 8, 8, 7, 6, 5, 4, 3, 3, 2, 3, 3, 4, 5, 6, 7, 8,
- 8,
-};
-
-static const uint16_t bitalloc_25_codes_a[25] =
-{
- 0x2854, 0x142B, 0x050B, 0x0143, 0x00A2, 0x0052, 0x002E, 0x0015,
- 0x0004, 0x000E, 0x0000, 0x0003, 0x0006, 0x0004, 0x0001, 0x000F,
- 0x0005, 0x0016, 0x002F, 0x0053, 0x00A3, 0x00A0, 0x0284, 0x0A14,
- 0x2855,
-};
-static const uint16_t bitalloc_25_codes_b[25] =
-{
- 0x001C, 0x000F, 0x0005, 0x0000, 0x0030, 0x0036, 0x000E, 0x0019,
- 0x0001, 0x0008, 0x000E, 0x0001, 0x0005, 0x0002, 0x000F, 0x0009,
- 0x0006, 0x001A, 0x000F, 0x0037, 0x0031, 0x0001, 0x0006, 0x0004,
- 0x001D,
-};
-static const uint16_t bitalloc_25_codes_c[25] =
-{
- 0x004C, 0x0027, 0x006D, 0x0028, 0x0037, 0x000E, 0x0015, 0x0000,
- 0x0005, 0x0008, 0x000B, 0x000E, 0x0001, 0x000F, 0x000C, 0x0009,
- 0x0006, 0x0001, 0x001A, 0x000F, 0x0008, 0x0029, 0x0012, 0x006C,
- 0x004D,
-};
-static const uint16_t bitalloc_25_codes_d[25] =
-{
- 0x0780, 0x0782, 0x03C2, 0x01E2, 0x00FE, 0x0079, 0x003D, 0x001C,
- 0x000C, 0x0004, 0x0000, 0x0006, 0x0002, 0x0007, 0x0001, 0x0005,
- 0x000D, 0x001D, 0x003E, 0x007E, 0x00FF, 0x01E3, 0x03C3, 0x0783,
- 0x0781,
-};
-static const uint16_t bitalloc_25_codes_e[25] =
-{
- 0x003C, 0x0092, 0x0018, 0x001F, 0x004E, 0x000D, 0x0025, 0x0004,
- 0x0010, 0x0000, 0x000A, 0x0002, 0x0003, 0x0003, 0x000B, 0x0001,
- 0x0011, 0x0005, 0x0026, 0x000E, 0x004F, 0x0048, 0x0019, 0x0093,
- 0x003D,
-};
-static const uint16_t bitalloc_25_codes_f[25] =
-{
- 0x0324, 0x0193, 0x00CE, 0x0065, 0x0024, 0x000C, 0x0013, 0x0004,
- 0x0007, 0x000A, 0x000D, 0x000F, 0x0001, 0x0000, 0x000E, 0x000B,
- 0x0008, 0x0005, 0x0018, 0x000D, 0x0025, 0x0066, 0x00CF, 0x00C8,
- 0x0325,
-};
-static const uint16_t bitalloc_25_codes_g[25] =
-{
- 0x03A8, 0x03AE, 0x01D5, 0x0094, 0x0014, 0x004B, 0x000B, 0x003B,
- 0x0013, 0x0003, 0x000F, 0x0005, 0x0001, 0x0006, 0x0000, 0x0008,
- 0x001C, 0x0004, 0x0024, 0x0074, 0x0015, 0x0095, 0x01D6, 0x03AF,
- 0x03A9,
-};
-static const uint8_t bitalloc_25_bits_a[25] =
-{
- 14, 13, 11, 9, 8, 7, 6, 5, 4, 4, 3, 3, 3, 3, 3, 4,
- 4, 5, 6, 7, 8, 8, 10, 12, 14,
-};
-static const uint8_t bitalloc_25_bits_b[25] =
-{
- 9, 8, 7, 6, 6, 6, 5, 5, 4, 4, 4, 3, 3, 3, 4, 4,
- 4, 5, 5, 6, 6, 6, 7, 7, 9,
-};
-static const uint8_t bitalloc_25_bits_c[25] =
-{
- 8, 7, 7, 6, 6, 5, 5, 4, 4, 4, 4, 4, 3, 4, 4, 4,
- 4, 4, 5, 5, 5, 6, 6, 7, 8,
-};
-static const uint8_t bitalloc_25_bits_d[25] =
-{
- 12, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 3, 2, 3, 3, 4,
- 5, 6, 7, 8, 9, 10, 11, 12, 12,
-};
-static const uint8_t bitalloc_25_bits_e[25] =
-{
- 8, 8, 7, 7, 7, 6, 6, 5, 5, 4, 4, 3, 2, 3, 4, 4,
- 5, 5, 6, 6, 7, 7, 7, 8, 8,
-};
-static const uint8_t bitalloc_25_bits_f[25] =
-{
- 10, 9, 8, 7, 6, 5, 5, 4, 4, 4, 4, 4, 3, 3, 4, 4,
- 4, 4, 5, 5, 6, 7, 8, 8, 10,
-};
-static const uint8_t bitalloc_25_bits_g[25] =
-{
- 10, 10, 9, 8, 7, 7, 6, 6, 5, 4, 4, 3, 2, 3, 3, 4,
- 5, 5, 6, 7, 7, 8, 9, 10, 10,
-};
-
-static const uint16_t bitalloc_33_codes_a[33] =
-{
- 0x1580, 0x1582, 0x0AC2, 0x0562, 0x02B2, 0x015E, 0x00AD, 0x0054,
- 0x001C, 0x003C, 0x000F, 0x001F, 0x0008, 0x000B, 0x000D, 0x0000,
- 0x0002, 0x0001, 0x000E, 0x000C, 0x0009, 0x0006, 0x0014, 0x003D,
- 0x001D, 0x0055, 0x00AE, 0x015F, 0x02B3, 0x0563, 0x0AC3, 0x1583,
- 0x1581,
-};
-static const uint16_t bitalloc_33_codes_b[33] =
-{
- 0x030C, 0x0187, 0x006D, 0x0028, 0x0037, 0x0066, 0x0015, 0x0031,
- 0x0000, 0x000B, 0x0012, 0x001A, 0x0001, 0x0007, 0x000A, 0x000E,
- 0x0001, 0x000F, 0x000B, 0x0008, 0x0004, 0x001B, 0x0013, 0x000C,
- 0x0001, 0x0032, 0x001A, 0x0067, 0x0060, 0x0029, 0x00C2, 0x006C,
- 0x030D,
-};
-static const uint16_t bitalloc_33_codes_c[33] =
-{
- 0x00CC, 0x0067, 0x0005, 0x0070, 0x0003, 0x001A, 0x0039, 0x003F,
- 0x000A, 0x0012, 0x0018, 0x001D, 0x0001, 0x0003, 0x0007, 0x000A,
- 0x000D, 0x000B, 0x0008, 0x0004, 0x0002, 0x001E, 0x0019, 0x0013,
- 0x000B, 0x0000, 0x003E, 0x001B, 0x0018, 0x0071, 0x0032, 0x0004,
- 0x00CD,
-};
-static const uint16_t bitalloc_33_codes_d[33] =
-{
- 0x3AF8, 0x3AFA, 0x1D7E, 0x0EBC, 0x075C, 0x03AC, 0x01D4, 0x0094,
- 0x0014, 0x004B, 0x000B, 0x003B, 0x0013, 0x0003, 0x000F, 0x0005,
- 0x0001, 0x0006, 0x0000, 0x0008, 0x001C, 0x0004, 0x0024, 0x0074,
- 0x0015, 0x0095, 0x01D5, 0x03AD, 0x075D, 0x0EBD, 0x1D7F, 0x3AFB,
- 0x3AF9,
-};
-static const uint16_t bitalloc_33_codes_e[33] =
-{
- 0x01C8, 0x01E6, 0x0064, 0x00E2, 0x00E5, 0x0030, 0x0033, 0x0073,
- 0x007A, 0x001A, 0x003A, 0x0002, 0x001A, 0x001F, 0x0007, 0x0001,
- 0x0002, 0x0002, 0x000C, 0x0000, 0x001B, 0x0003, 0x003B, 0x001B,
- 0x007B, 0x0078, 0x0070, 0x0031, 0x00F2, 0x00E3, 0x0065, 0x01E7,
- 0x01C9,
-};
-static const uint16_t bitalloc_33_codes_f[33] =
-{
- 0x0724, 0x0393, 0x01CE, 0x00E5, 0x002C, 0x0008, 0x0017, 0x003E,
- 0x0005, 0x0014, 0x001D, 0x0000, 0x0003, 0x0006, 0x0008, 0x000B,
- 0x000D, 0x000C, 0x0009, 0x0007, 0x0004, 0x0001, 0x001E, 0x0015,
- 0x000A, 0x003F, 0x0038, 0x0009, 0x002D, 0x00E6, 0x01CF, 0x01C8,
- 0x0725,
-};
-static const uint16_t bitalloc_33_codes_g[33] =
-{
- 0x0284, 0x0042, 0x0140, 0x0143, 0x003E, 0x00BE, 0x0011, 0x0051,
- 0x0009, 0x0029, 0x0005, 0x0015, 0x0000, 0x0008, 0x000E, 0x0002,
- 0x0006, 0x0003, 0x000F, 0x0009, 0x0001, 0x0016, 0x0006, 0x002E,
- 0x000E, 0x005E, 0x001E, 0x00BF, 0x003F, 0x0020, 0x0141, 0x0043,
- 0x0285,
-};
-static const uint8_t bitalloc_33_bits_a[33] =
-{
- 13, 13, 12, 11, 10, 9, 8, 7, 6, 6, 5, 5, 4, 4, 4, 3,
- 3, 3, 4, 4, 4, 4, 5, 6, 6, 7, 8, 9, 10, 11, 12, 13,
- 13,
-};
-static const uint8_t bitalloc_33_bits_b[33] =
-{
- 10, 9, 8, 7, 7, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4,
- 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8,
- 10,
-};
-static const uint8_t bitalloc_33_bits_c[33] =
-{
- 9, 8, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7,
- 9,
-};
-static const uint8_t bitalloc_33_bits_d[33] =
-{
- 14, 14, 13, 12, 11, 10, 9, 8, 7, 7, 6, 6, 5, 4, 4, 3,
- 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 10, 11, 12, 13, 14,
- 14,
-};
-static const uint8_t bitalloc_33_bits_e[33] =
-{
- 9, 9, 8, 8, 8, 7, 7, 7, 7, 6, 6, 5, 5, 5, 4, 3,
- 2, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9,
- 9,
-};
-static const uint8_t bitalloc_33_bits_f[33] =
-{
- 11, 10, 9, 8, 7, 6, 6, 6, 5, 5, 5, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8, 9, 9,
- 11,
-};
-static const uint8_t bitalloc_33_bits_g[33] =
-{
- 10, 9, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 4, 3,
- 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 8, 9, 9,
- 10,
-};
-
-static const uint16_t bitalloc_65_codes_a[65] =
-{
- 0x9E5C, 0x9E5E, 0x4F2C, 0x2794, 0x13C4, 0x1E44, 0x09E3, 0x0F23,
- 0x04F3, 0x0792, 0x027E, 0x03CE, 0x013D, 0x01E5, 0x009C, 0x00CC,
- 0x0040, 0x0058, 0x0067, 0x001E, 0x0021, 0x002D, 0x003D, 0x0007,
- 0x0011, 0x0014, 0x0017, 0x001A, 0x001C, 0x001F, 0x0001, 0x0004,
- 0x0006, 0x0005, 0x0002, 0x0000, 0x001D, 0x001B, 0x0018, 0x0015,
- 0x0012, 0x000E, 0x0006, 0x0032, 0x0026, 0x001F, 0x0078, 0x0059,
- 0x0041, 0x00CD, 0x009D, 0x01E6, 0x013E, 0x03CF, 0x027F, 0x0793,
- 0x0790, 0x04F0, 0x09E4, 0x1E45, 0x13C5, 0x2795, 0x4F2D, 0x9E5F,
- 0x9E5D,
-};
-static const uint16_t bitalloc_65_codes_b[65] =
-{
- 0x0A8C, 0x0547, 0x01B5, 0x0008, 0x00DB, 0x0152, 0x0005, 0x000B,
- 0x008E, 0x00AE, 0x00E4, 0x0003, 0x0037, 0x0039, 0x0055, 0x006C,
- 0x0073, 0x0003, 0x0015, 0x001D, 0x0028, 0x0030, 0x0037, 0x003E,
- 0x0006, 0x000B, 0x000F, 0x0012, 0x0016, 0x0019, 0x001D, 0x0001,
- 0x0004, 0x0002, 0x001E, 0x001A, 0x0017, 0x0013, 0x0010, 0x000C,
- 0x0007, 0x003F, 0x0038, 0x0031, 0x0029, 0x0022, 0x001A, 0x0014,
- 0x0000, 0x006D, 0x0056, 0x0046, 0x0038, 0x0004, 0x00E5, 0x00AF,
- 0x008F, 0x006C, 0x000A, 0x0153, 0x0150, 0x0009, 0x02A2, 0x01B4,
- 0x0A8D,
-};
-static const uint16_t bitalloc_65_codes_c[65] =
-{
- 0x045C, 0x022F, 0x03F5, 0x01BC, 0x01FB, 0x0059, 0x00D0, 0x00DF,
- 0x000A, 0x002D, 0x002F, 0x0052, 0x0069, 0x0078, 0x007F, 0x000A,
- 0x0010, 0x001C, 0x0023, 0x002A, 0x0035, 0x003A, 0x003D, 0x0000,
- 0x0003, 0x0006, 0x0009, 0x000C, 0x000F, 0x0012, 0x0016, 0x0018,
- 0x001C, 0x0019, 0x0017, 0x0013, 0x0010, 0x000D, 0x000A, 0x0007,
- 0x0004, 0x0001, 0x003E, 0x003B, 0x0036, 0x002B, 0x0028, 0x001D,
- 0x0011, 0x000B, 0x0004, 0x0079, 0x006E, 0x0053, 0x0044, 0x002E,
- 0x000B, 0x00FC, 0x00D1, 0x008A, 0x0058, 0x01BD, 0x0116, 0x03F4,
- 0x045D,
-};
-static const uint16_t bitalloc_65_codes_d[65] =
-{
- 0x70B0, 0x70B2, 0x70B4, 0x2852, 0x385B, 0x142E, 0x1C2E, 0x0A15,
- 0x0E14, 0x0214, 0x0704, 0x0104, 0x010B, 0x0383, 0x0083, 0x0143,
- 0x01C3, 0x0043, 0x00A2, 0x00E2, 0x0022, 0x0052, 0x0072, 0x0012,
- 0x002A, 0x003A, 0x000A, 0x0016, 0x001E, 0x0006, 0x000C, 0x0000,
- 0x0004, 0x0001, 0x000D, 0x0007, 0x001F, 0x0017, 0x000B, 0x003B,
- 0x002B, 0x0013, 0x0073, 0x0053, 0x0023, 0x00E3, 0x00A3, 0x00A0,
- 0x0040, 0x01C0, 0x0084, 0x0384, 0x0284, 0x0105, 0x0705, 0x0215,
- 0x0E15, 0x0A16, 0x1C2F, 0x142F, 0x1428, 0x2853, 0x70B5, 0x70B3,
- 0x70B1,
-};
-static const uint16_t bitalloc_65_codes_e[65] =
-{
- 0x032C, 0x0332, 0x0378, 0x037E, 0x008C, 0x014A, 0x0188, 0x0197,
- 0x019E, 0x01BD, 0x0044, 0x0047, 0x00AA, 0x00C5, 0x00CD, 0x00DC,
- 0x001C, 0x002C, 0x0053, 0x0063, 0x0068, 0x0008, 0x000F, 0x0017,
- 0x002B, 0x0035, 0x0005, 0x0009, 0x0016, 0x001C, 0x0006, 0x000F,
- 0x0004, 0x0000, 0x0007, 0x001D, 0x0017, 0x000A, 0x0006, 0x0036,
- 0x0030, 0x0028, 0x0010, 0x0009, 0x0069, 0x0064, 0x0054, 0x002D,
- 0x001D, 0x00DD, 0x00CE, 0x00CA, 0x00AB, 0x00A4, 0x0045, 0x01BE,
- 0x019F, 0x0198, 0x0189, 0x014B, 0x008D, 0x037F, 0x0379, 0x0333,
- 0x032D,
-};
-static const uint16_t bitalloc_65_codes_f[65] =
-{
- 0x0FE0, 0x0FE2, 0x0FE8, 0x0FEA, 0x0FEC, 0x0FEE, 0x0FF0, 0x0FF2,
- 0x0FF4, 0x2FF2, 0x07F2, 0x07FB, 0x03F6, 0x0BFA, 0x0BFD, 0x01FF,
- 0x05FF, 0x02FC, 0x007C, 0x017C, 0x003C, 0x00BC, 0x001C, 0x005C,
- 0x000C, 0x002C, 0x0004, 0x0014, 0x0000, 0x0008, 0x000E, 0x0002,
- 0x0006, 0x0003, 0x000F, 0x0009, 0x0001, 0x0015, 0x0005, 0x002D,
- 0x000D, 0x005D, 0x001D, 0x00BD, 0x003D, 0x017D, 0x007D, 0x02FD,
- 0x00FC, 0x05FC, 0x01FA, 0x0BFB, 0x03F7, 0x17F8, 0x07F3, 0x2FF3,
- 0x0FF5, 0x0FF3, 0x0FF1, 0x0FEF, 0x0FED, 0x0FEB, 0x0FE9, 0x0FE3,
- 0x0FE1,
-};
-static const uint16_t bitalloc_65_codes_g[65] =
-{
- 0x010C, 0x038A, 0x0608, 0x0786, 0x0084, 0x0087, 0x0302, 0x0305,
- 0x0040, 0x00E0, 0x00E3, 0x0183, 0x001E, 0x005E, 0x009E, 0x00DE,
- 0x00F1, 0x0011, 0x0039, 0x0061, 0x0079, 0x0009, 0x001D, 0x0031,
- 0x003D, 0x0005, 0x000F, 0x0019, 0x001F, 0x0003, 0x0006, 0x000A,
- 0x000E, 0x000B, 0x0008, 0x0004, 0x0000, 0x001A, 0x0012, 0x000A,
- 0x0002, 0x0036, 0x0026, 0x0016, 0x0006, 0x006E, 0x004E, 0x002E,
- 0x000E, 0x00DF, 0x009F, 0x005F, 0x001F, 0x01E0, 0x0180, 0x00E1,
- 0x0041, 0x03C2, 0x0303, 0x01C4, 0x0085, 0x0787, 0x0609, 0x038B,
- 0x010D,
-};
-static const uint8_t bitalloc_65_bits_a[65] =
-{
- 16, 16, 15, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 8, 8,
- 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 4, 4,
- 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 7, 7,
- 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 12, 13, 13, 14, 15, 16,
- 16,
-};
-static const uint8_t bitalloc_65_bits_b[65] =
-{
- 12, 11, 10, 9, 9, 9, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7,
- 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 4,
- 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
- 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 10, 10,
- 12,
-};
-static const uint8_t bitalloc_65_bits_c[65] =
-{
- 11, 10, 10, 9, 9, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 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, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 10,
- 11,
-};
-static const uint8_t bitalloc_65_bits_d[65] =
-{
- 15, 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 10, 9, 9,
- 9, 8, 8, 8, 7, 7, 7, 6, 6, 6, 5, 5, 5, 4, 4, 3,
- 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8,
- 8, 9, 9, 10, 10, 10, 11, 11, 12, 12, 13, 13, 13, 14, 15, 15,
- 15,
-};
-static const uint8_t bitalloc_65_bits_e[65] =
-{
- 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8,
- 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4,
- 3, 3, 4, 5, 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, 10, 10, 10,
- 10,
-};
-static const uint8_t bitalloc_65_bits_f[65] =
-{
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 12, 12, 12, 11,
- 11, 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 4, 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, 14, 14, 14, 14, 14, 14, 14,
- 14,
-};
-static const uint8_t bitalloc_65_bits_g[65] =
-{
- 11, 11, 11, 11, 10, 10, 10, 10, 9, 9, 9, 9, 8, 8, 8, 8,
- 8, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4,
- 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7,
- 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11,
- 11,
-};
-
-static const uint16_t bitalloc_129_codes_a[129] =
-{
- 0x0660, 0x0666, 0x06EC, 0x0722, 0x0760, 0x076E, 0x004C, 0x004E,
- 0x00F4, 0x010A, 0x0148, 0x0156, 0x01D4, 0x01F2, 0x0331, 0x0370,
- 0x0377, 0x0396, 0x03B1, 0x0024, 0x0064, 0x007B, 0x008A, 0x00A5,
- 0x00D4, 0x00EB, 0x00FA, 0x019A, 0x01B9, 0x01C9, 0x01D9, 0x0010,
- 0x0030, 0x0033, 0x0043, 0x0053, 0x006B, 0x007A, 0x00CA, 0x00D2,
- 0x00DE, 0x00E6, 0x00F6, 0x000E, 0x001F, 0x0023, 0x002B, 0x003B,
- 0x003F, 0x0067, 0x0070, 0x0077, 0x0005, 0x000D, 0x0012, 0x001B,
- 0x002C, 0x0035, 0x003A, 0x0004, 0x000B, 0x0017, 0x001F, 0x0009,
- 0x0008, 0x000A, 0x0000, 0x0018, 0x000C, 0x0005, 0x003C, 0x0036,
- 0x002D, 0x001C, 0x0013, 0x000E, 0x0006, 0x007A, 0x0071, 0x0068,
- 0x0064, 0x003C, 0x0034, 0x0028, 0x0020, 0x000F, 0x00F7, 0x00E7,
- 0x00DF, 0x00D3, 0x00CB, 0x007B, 0x0074, 0x0054, 0x0044, 0x003C,
- 0x0031, 0x0011, 0x01DA, 0x01CA, 0x01BA, 0x019B, 0x00FB, 0x00F8,
- 0x00D5, 0x00AA, 0x008B, 0x0084, 0x0065, 0x0025, 0x03B6, 0x0397,
- 0x0390, 0x0371, 0x0332, 0x01F3, 0x01D5, 0x0157, 0x0149, 0x010B,
- 0x00F5, 0x004F, 0x004D, 0x076F, 0x0761, 0x0723, 0x06ED, 0x0667,
- 0x0661,
-};
-static const uint16_t bitalloc_129_codes_b[129] =
-{
- 0x29DC, 0x14EF, 0x0455, 0x0E9C, 0x022B, 0x0489, 0x0740, 0x074F,
- 0x0172, 0x0245, 0x0247, 0x030A, 0x03A1, 0x001C, 0x008B, 0x00D6,
- 0x010C, 0x0148, 0x014F, 0x0186, 0x01D1, 0x0008, 0x000F, 0x0046,
- 0x005D, 0x0078, 0x0087, 0x0096, 0x00A5, 0x00BC, 0x00D8, 0x00DE,
- 0x00F6, 0x0005, 0x0014, 0x0024, 0x002F, 0x003A, 0x003D, 0x0049,
- 0x0050, 0x0058, 0x005F, 0x0066, 0x006D, 0x0075, 0x007C, 0x0004,
- 0x000B, 0x0013, 0x0018, 0x001B, 0x001F, 0x0022, 0x0026, 0x002A,
- 0x002D, 0x0031, 0x0034, 0x0038, 0x003B, 0x003F, 0x0003, 0x0006,
- 0x000A, 0x0007, 0x0004, 0x0000, 0x003C, 0x0039, 0x0035, 0x0032,
- 0x002E, 0x002B, 0x0027, 0x0023, 0x0020, 0x001C, 0x0019, 0x0016,
- 0x0010, 0x0005, 0x007D, 0x007A, 0x006E, 0x0067, 0x0060, 0x0059,
- 0x0051, 0x004A, 0x0042, 0x003B, 0x0034, 0x0025, 0x0015, 0x0006,
- 0x00F7, 0x00DF, 0x00D9, 0x00BD, 0x00A6, 0x0097, 0x0090, 0x0079,
- 0x006A, 0x0047, 0x0044, 0x0009, 0x01D2, 0x0187, 0x0184, 0x0149,
- 0x010D, 0x00D7, 0x00B8, 0x001D, 0x03A6, 0x030B, 0x029C, 0x0246,
- 0x0173, 0x0114, 0x0741, 0x053A, 0x0488, 0x0E9D, 0x0A76, 0x0454,
- 0x29DD,
-};
-static const uint16_t bitalloc_129_codes_c[129] =
-{
- 0x0E5C, 0x072F, 0x001D, 0x0724, 0x000F, 0x010D, 0x0324, 0x0393,
- 0x03E9, 0x0080, 0x0087, 0x00FA, 0x0164, 0x0193, 0x01DE, 0x01F5,
- 0x0010, 0x002A, 0x0041, 0x0064, 0x0073, 0x008E, 0x00A4, 0x00B3,
- 0x00D6, 0x00E5, 0x00F4, 0x00FB, 0x0002, 0x0009, 0x0013, 0x001E,
- 0x0026, 0x002C, 0x0033, 0x003F, 0x0041, 0x004C, 0x0053, 0x005E,
- 0x0065, 0x0070, 0x0073, 0x0078, 0x007B, 0x007E, 0x0002, 0x0005,
- 0x0007, 0x000B, 0x000D, 0x0011, 0x0014, 0x0017, 0x001A, 0x001D,
- 0x0021, 0x0024, 0x0027, 0x002A, 0x002D, 0x0030, 0x0033, 0x0036,
- 0x003A, 0x0037, 0x0034, 0x0031, 0x002E, 0x002B, 0x0028, 0x0025,
- 0x0022, 0x001E, 0x001B, 0x0018, 0x0015, 0x0012, 0x000E, 0x000C,
- 0x0008, 0x0006, 0x0003, 0x007F, 0x007C, 0x0079, 0x0076, 0x0071,
- 0x006A, 0x005F, 0x0058, 0x004D, 0x0046, 0x0040, 0x0038, 0x002D,
- 0x0027, 0x001F, 0x0014, 0x0012, 0x0003, 0x0000, 0x00F5, 0x00EE,
- 0x00D7, 0x00C8, 0x00A5, 0x008F, 0x007C, 0x0065, 0x0042, 0x002B,
- 0x0011, 0x0002, 0x01DF, 0x01C8, 0x0165, 0x00FB, 0x00E4, 0x0081,
- 0x0006, 0x03E8, 0x0325, 0x01CA, 0x010C, 0x0725, 0x0396, 0x001C,
- 0x0E5D,
-};
-static const uint16_t bitalloc_129_codes_d[129] =
-{
- 0xA598, 0xA59A, 0xA59C, 0xA59E, 0xC598, 0xE586, 0x3ACC, 0x52CA,
- 0x62CD, 0x0D48, 0x1D67, 0x2978, 0x3167, 0x3966, 0x06A5, 0x0EBC,
- 0x14BD, 0x1CB1, 0x0350, 0x0353, 0x075F, 0x0A5F, 0x0C5E, 0x0E5E,
- 0x01AE, 0x03AD, 0x052D, 0x062D, 0x072D, 0x00D5, 0x01D4, 0x0294,
- 0x0314, 0x0394, 0x0014, 0x0094, 0x0114, 0x0174, 0x01B4, 0x01F4,
- 0x000B, 0x004B, 0x008B, 0x00BB, 0x00DB, 0x00FB, 0x001B, 0x003B,
- 0x0053, 0x0063, 0x0073, 0x0003, 0x0013, 0x0023, 0x002F, 0x0037,
- 0x003F, 0x0007, 0x000F, 0x0015, 0x0019, 0x001D, 0x0001, 0x0005,
- 0x0009, 0x0006, 0x0002, 0x001E, 0x001A, 0x0016, 0x0010, 0x0008,
- 0x0000, 0x0038, 0x0030, 0x0028, 0x001C, 0x000C, 0x007C, 0x006C,
- 0x005C, 0x0044, 0x0024, 0x0004, 0x00E4, 0x00C4, 0x00A4, 0x0074,
- 0x0034, 0x01F5, 0x01B5, 0x0175, 0x0115, 0x0095, 0x0015, 0x0395,
- 0x0315, 0x0295, 0x01D5, 0x00D6, 0x072E, 0x062E, 0x052E, 0x03AE,
- 0x01AF, 0x0E5F, 0x0C5F, 0x0C58, 0x0A58, 0x0758, 0x0351, 0x1CB2,
- 0x18B2, 0x0EBD, 0x0EB2, 0x3967, 0x3960, 0x2979, 0x2964, 0x0D49,
- 0x72C2, 0x52CB, 0x3ACD, 0xE587, 0xC599, 0xA59F, 0xA59D, 0xA59B,
- 0xA599,
-};
-static const uint16_t bitalloc_129_codes_e[129] =
-{
- 0xA13C, 0xC720, 0xA13F, 0xA13E, 0xA13D, 0xE722, 0x5090, 0x6393,
- 0x7392, 0x2849, 0x31CE, 0x39CE, 0x1425, 0x18E5, 0x1CE5, 0x0844,
- 0x0A1C, 0x0C7C, 0x036C, 0x0423, 0x050F, 0x063F, 0x01B7, 0x0216,
- 0x0285, 0x031D, 0x039D, 0x0109, 0x0140, 0x0180, 0x01C8, 0x01CF,
- 0x007A, 0x008A, 0x00A2, 0x00C1, 0x00E5, 0x0014, 0x0037, 0x0043,
- 0x004E, 0x0056, 0x0061, 0x006C, 0x007C, 0x000B, 0x001C, 0x001F,
- 0x0023, 0x0025, 0x0029, 0x002C, 0x002E, 0x0032, 0x0034, 0x0037,
- 0x003A, 0x003C, 0x003F, 0x0001, 0x0003, 0x0006, 0x0008, 0x000A,
- 0x000C, 0x000B, 0x0009, 0x0007, 0x0004, 0x0002, 0x0000, 0x003D,
- 0x003B, 0x0038, 0x0035, 0x0033, 0x002F, 0x002D, 0x002A, 0x0026,
- 0x0024, 0x0020, 0x001D, 0x001A, 0x007D, 0x006D, 0x0062, 0x0057,
- 0x004F, 0x0044, 0x003C, 0x0015, 0x00E6, 0x00C6, 0x00A3, 0x008B,
- 0x007B, 0x006C, 0x01C9, 0x0181, 0x0141, 0x010A, 0x00DA, 0x031E,
- 0x0286, 0x0217, 0x0210, 0x0738, 0x0638, 0x0508, 0x036D, 0x0C7D,
- 0x0A1D, 0x0845, 0x1CE6, 0x18E6, 0x1426, 0x39CF, 0x31CF, 0x284E,
- 0x7393, 0x7390, 0x5091, 0xE723, 0xC724, 0xC725, 0xC722, 0xC723,
- 0xC721,
-};
-static const uint16_t bitalloc_129_codes_f[129] =
-{
- 0x762C, 0x3B17, 0x1555, 0x0608, 0x0AAB, 0x0FF2, 0x0305, 0x0307,
- 0x0763, 0x0046, 0x010C, 0x01BC, 0x02AB, 0x03B6, 0x03FD, 0x0080,
- 0x0087, 0x00DF, 0x0156, 0x01D9, 0x01F8, 0x01FF, 0x002A, 0x0041,
- 0x0061, 0x0094, 0x00D4, 0x00EA, 0x00F2, 0x00FD, 0x0009, 0x000B,
- 0x001A, 0x0026, 0x0031, 0x0040, 0x004B, 0x006B, 0x0073, 0x0077,
- 0x007A, 0x007C, 0x0000, 0x0002, 0x0006, 0x0008, 0x000B, 0x000E,
- 0x0011, 0x0014, 0x0016, 0x0019, 0x001C, 0x001E, 0x0021, 0x0023,
- 0x0026, 0x0028, 0x002B, 0x002D, 0x002F, 0x0031, 0x0033, 0x0036,
- 0x0038, 0x0037, 0x0034, 0x0032, 0x0030, 0x002E, 0x002C, 0x0029,
- 0x0027, 0x0024, 0x0022, 0x001F, 0x001D, 0x001A, 0x0017, 0x0015,
- 0x0012, 0x000F, 0x000C, 0x0009, 0x0007, 0x0003, 0x0001, 0x007D,
- 0x007B, 0x0078, 0x0074, 0x0072, 0x0054, 0x0041, 0x0036, 0x0027,
- 0x001B, 0x0014, 0x000A, 0x00FE, 0x00F3, 0x00EB, 0x00D5, 0x0095,
- 0x006E, 0x0042, 0x002B, 0x0010, 0x01F9, 0x01DA, 0x0157, 0x0154,
- 0x00C0, 0x0081, 0x0022, 0x03B7, 0x03B0, 0x01BD, 0x010D, 0x0047,
- 0x07F8, 0x0554, 0x0306, 0x0FF3, 0x0EC4, 0x0609, 0x1D8A, 0x1554,
- 0x762D,
-};
-static const uint16_t bitalloc_129_codes_g[129] =
-{
- 0x1E20, 0x1E5E, 0x031C, 0x051A, 0x0718, 0x0916, 0x0B14, 0x0D12,
- 0x0F11, 0x0090, 0x018F, 0x028E, 0x038D, 0x048C, 0x058B, 0x068A,
- 0x0789, 0x0049, 0x00C8, 0x0148, 0x01C7, 0x0247, 0x02C6, 0x0346,
- 0x03C5, 0x0025, 0x0065, 0x00A5, 0x00E4, 0x0124, 0x0164, 0x01A4,
- 0x01E3, 0x0013, 0x0033, 0x0053, 0x0073, 0x0093, 0x00B3, 0x00D3,
- 0x00F3, 0x000A, 0x001A, 0x002A, 0x003A, 0x004A, 0x005A, 0x006A,
- 0x007A, 0x0006, 0x000E, 0x0016, 0x001E, 0x0026, 0x002E, 0x0036,
- 0x003E, 0x0004, 0x0008, 0x000C, 0x0010, 0x0014, 0x0018, 0x001C,
- 0x0000, 0x001D, 0x0019, 0x0015, 0x0011, 0x000D, 0x0009, 0x0005,
- 0x003F, 0x0037, 0x002F, 0x0027, 0x001F, 0x0017, 0x000F, 0x0007,
- 0x007B, 0x006B, 0x005B, 0x004B, 0x003B, 0x002B, 0x001B, 0x000B,
- 0x0008, 0x00F0, 0x00D0, 0x00B0, 0x0090, 0x0070, 0x0050, 0x0030,
- 0x01E4, 0x01A5, 0x0165, 0x0125, 0x00E5, 0x00E2, 0x00A2, 0x0062,
- 0x03CA, 0x0347, 0x02C7, 0x02C4, 0x0244, 0x0149, 0x00C9, 0x00C6,
- 0x0796, 0x068B, 0x0688, 0x048D, 0x048A, 0x028F, 0x028C, 0x0091,
- 0x0F2E, 0x0D13, 0x0B15, 0x0917, 0x0719, 0x051B, 0x031D, 0x1E5F,
- 0x1E21,
-};
-static const uint8_t bitalloc_129_bits_a[129] =
-{
- 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 4,
- 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7,
- 7, 7, 7, 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, 11, 11, 11, 11, 11,
- 11,
-};
-static const uint8_t bitalloc_129_bits_b[129] =
-{
- 14, 13, 12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 10, 9, 9, 9,
- 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5,
- 5, 5, 5, 5, 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,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9,
- 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12,
- 14,
-};
-static const uint8_t bitalloc_129_bits_c[129] =
-{
- 13, 12, 11, 11, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 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, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11,
- 13,
-};
-static const uint8_t bitalloc_129_bits_d[129] =
-{
- 16, 16, 16, 16, 16, 16, 15, 15, 15, 14, 14, 14, 14, 14, 13, 13,
- 13, 13, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 10, 10, 10,
- 10, 10, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 7, 7,
- 7, 7, 7, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 4, 4,
- 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7,
- 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10,
- 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13,
- 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 16, 16, 16, 16, 16,
- 16,
-};
-static const uint8_t bitalloc_129_bits_e[129] =
-{
- 16, 16, 16, 16, 16, 16, 15, 15, 15, 14, 14, 14, 13, 13, 13, 12,
- 12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9,
- 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 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, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8,
- 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12,
- 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 16, 16,
- 16,
-};
-static const uint8_t bitalloc_129_bits_f[129] =
-{
- 15, 14, 13, 12, 12, 12, 11, 11, 11, 10, 10, 10, 10, 10, 10, 9,
- 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 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, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9,
- 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13,
- 15,
-};
-static const uint8_t bitalloc_129_bits_g[129] =
-{
- 13, 13, 12, 12, 12, 12, 12, 12, 12, 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, 8, 7, 7, 7, 7, 7, 7, 7,
- 7, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5,
- 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8,
- 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
- 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13,
- 13,
-};
-
-static const uint8_t bitalloc_sizes[10] = { 3, 5, 7, 9, 13, 17, 25, 33, 65, 129 };
-
-static const int8_t bitalloc_offsets[10] =
- { -1, -2, -3, -4, -6, -8, -12, -16, -32, -64 };
-
-static const uint8_t bitalloc_maxbits[10][7] = {
- { 2 },
- { 4, 3, 3 },
- { 5, 5, 4 },
- { 6, 5, 6 },
- { 7, 6, 5 },
- { 9, 8, 7, 9, 8, 8, 8 },
- { 9, 9, 8, 9, 8, 9, 9 },
- { 9, 9, 9, 9, 9, 9, 9 },
- { 9, 9, 9, 9, 9, 9, 9 },
- { 9, 9, 9, 9, 9, 9, 9 }
-};
-
-static const uint16_t* const bitalloc_codes[10][8] = {
- { bitalloc_3_codes, NULL },
- { bitalloc_5_codes_a, bitalloc_5_codes_b, bitalloc_5_codes_c, NULL },
- { bitalloc_7_codes_a, bitalloc_7_codes_b, bitalloc_7_codes_c, NULL },
- { bitalloc_9_codes_a, bitalloc_9_codes_b, bitalloc_9_codes_c, NULL },
- { bitalloc_13_codes_a, bitalloc_13_codes_b, bitalloc_13_codes_c, NULL },
- { bitalloc_17_codes_a, bitalloc_17_codes_b, bitalloc_17_codes_c, bitalloc_17_codes_d,
- bitalloc_17_codes_e, bitalloc_17_codes_f, bitalloc_17_codes_g, NULL },
- { bitalloc_25_codes_a, bitalloc_25_codes_b, bitalloc_25_codes_c, bitalloc_25_codes_d,
- bitalloc_25_codes_e, bitalloc_25_codes_f, bitalloc_25_codes_g, NULL },
- { bitalloc_33_codes_a, bitalloc_33_codes_b, bitalloc_33_codes_c, bitalloc_33_codes_d,
- bitalloc_33_codes_e, bitalloc_33_codes_f, bitalloc_33_codes_g, NULL },
- { bitalloc_65_codes_a, bitalloc_65_codes_b, bitalloc_65_codes_c, bitalloc_65_codes_d,
- bitalloc_65_codes_e, bitalloc_65_codes_f, bitalloc_65_codes_g, NULL },
- { bitalloc_129_codes_a, bitalloc_129_codes_b, bitalloc_129_codes_c, bitalloc_129_codes_d,
- bitalloc_129_codes_e, bitalloc_129_codes_f, bitalloc_129_codes_g, NULL }
-};
-
-static const uint8_t* const bitalloc_bits[10][8] = {
- { bitalloc_3_bits, NULL },
- { bitalloc_5_bits_a, bitalloc_5_bits_b, bitalloc_5_bits_c, NULL },
- { bitalloc_7_bits_a, bitalloc_7_bits_b, bitalloc_7_bits_c, NULL },
- { bitalloc_9_bits_a, bitalloc_9_bits_b, bitalloc_9_bits_c, NULL },
- { bitalloc_13_bits_a, bitalloc_13_bits_b, bitalloc_13_bits_c, NULL },
- { bitalloc_17_bits_a, bitalloc_17_bits_b, bitalloc_17_bits_c, bitalloc_17_bits_d,
- bitalloc_17_bits_e, bitalloc_17_bits_f, bitalloc_17_bits_g, NULL },
- { bitalloc_25_bits_a, bitalloc_25_bits_b, bitalloc_25_bits_c, bitalloc_25_bits_d,
- bitalloc_25_bits_e, bitalloc_25_bits_f, bitalloc_25_bits_g, NULL },
- { bitalloc_33_bits_a, bitalloc_33_bits_b, bitalloc_33_bits_c, bitalloc_33_bits_d,
- bitalloc_33_bits_e, bitalloc_33_bits_f, bitalloc_33_bits_g, NULL },
- { bitalloc_65_bits_a, bitalloc_65_bits_b, bitalloc_65_bits_c, bitalloc_65_bits_d,
- bitalloc_65_bits_e, bitalloc_65_bits_f, bitalloc_65_bits_g, NULL },
- { bitalloc_129_bits_a, bitalloc_129_bits_b, bitalloc_129_bits_c, bitalloc_129_bits_d,
- bitalloc_129_bits_e, bitalloc_129_bits_f, bitalloc_129_bits_g, NULL }
-};
-
-#endif /* AVCODEC_DCAHUFF_H */
diff --git a/libavcodec/eac3_data.c b/libavcodec/eac3_data.c
deleted file mode 100644
index b159e16..0000000
--- a/libavcodec/eac3_data.c
+++ b/dev/null
@@ -1,1134 +0,0 @@
-/*
- * E-AC-3 tables
- * Copyright (c) 2007 Bartlomiej Wolowiec <bartek.wolowiec@gmail.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
- */
-
-/**
- * @file
- * Tables taken directly from the E-AC-3 spec.
- */
-
-#include "eac3_data.h"
-#include "ac3.h"
-
-const uint8_t ff_eac3_bits_vs_hebap[20] = {
- 0, 2, 3, 4, 5, 7, 8, 9, 3, 4,
- 5, 6, 7, 8, 9, 10, 11, 12, 14, 16,
-};
-
-/**
- * Table E3.6, Gk=1
- * No gain (Gk=1) inverse quantization, remapping scale factors
- * ff_eac3_gaq_remap[hebap+8]
- */
-const int16_t ff_eac3_gaq_remap_1[12] = {
- 4681, 2185, 1057, 520, 258, 129, 64, 32, 16, 8, 2, 0
-};
-
-/**
- * Table E3.6, Gk=2 & Gk=4, A
- * Large mantissa inverse quantization, remapping scale factors
- * ff_eac3_gaq_remap_2_4_a[hebap-8][Gk=2,4]
- */
-const int16_t ff_eac3_gaq_remap_2_4_a[9][2] = {
- { -10923, -4681 },
- { -14043, -6554 },
- { -15292, -7399 },
- { -15855, -7802 },
- { -16124, -7998 },
- { -16255, -8096 },
- { -16320, -8144 },
- { -16352, -8168 },
- { -16368, -8180 }
-};
-
-/**
- * Table E3.6, Gk=2 & Gk=4, B
- * Large mantissa inverse quantization, negative mantissa remapping offsets
- * ff_eac3_gaq_remap_3_4_b[hebap-8][Gk=2,4]
- */
-const int16_t ff_eac3_gaq_remap_2_4_b[9][2] = {
- { -5461, -1170 },
- { -11703, -4915 },
- { -14199, -6606 },
- { -15327, -7412 },
- { -15864, -7805 },
- { -16126, -7999 },
- { -16255, -8096 },
- { -16320, -8144 },
- { -16352, -8168 }
-};
-
-static const int16_t vq_hebap1[4][6] = {
-{ 7167, 4739, 1106, 4269, 10412, 4820},
-{ -5702, -3187, -14483, -1392, -2027, 849},
-{ 633, 6199, 7009, -12779, -2306, -2636},
-{ -1468, -7031, 7592, 10617, -5946, -3062},
-};
-static const int16_t vq_hebap2[8][6] = {
-{ -12073, 608, -7019, 590, 4000, 869},
-{ 6692, 15689, -6178, -9239, -74, 133},
-{ 1855, -989, 20596, -2920, -4475, 225},
-{ -1194, -3901, -821, -6566, -875, -20298},
-{ -2762, -3181, -4094, -5623, -16945, 9765},
-{ 1547, 6839, 1980, 20233, -1071, -4986},
-{ 6221, -17915, -5516, 6266, 358, 1162},
-{ 3753, -1066, 4283, -3227, 15928, 10186},
-};
-static const int16_t vq_hebap3[16][6] = {
-{ -10028, 20779, 10982, -4560, 798, -68},
-{ 11050, 20490, -6617, -5342, -1797, -1631},
-{ 3977, -542, 7118, -1166, 18844, 14678},
-{ -4320, -96, -7295, -492, -22050, -4277},
-{ 2692, 5856, 5530, 21862, -7212, -5325},
-{ -135, -23391, 962, 8115, -644, 382},
-{ -1563, 3400, -3299, 4693, -6892, 22398},
-{ 3535, 3030, 7296, 6214, 20476, -12099},
-{ 57, -6823, 1848, -22349, -5919, 6823},
-{ -821, -3655, -387, -6253, -1735, -22373},
-{ -6046, 1586, -18890, -14392, 9214, 705},
-{ -5716, 264, -17964, 14618, 7921, -337},
-{ -110, 108, 8, 74, -89, -50},
-{ 6612, -1517, 21687, -1658, -7949, -246},
-{ 21667, -6335, -8290, -101, -1349, -22},
-{ -22003, -6476, 7974, 648, 2054, -331},
-};
-static const int16_t vq_hebap4[32][6] = {
-{ 6636, -4593, 14173, -17297, -16523, 864},
-{ 3658, 22540, 104, -1763, -84, 6},
-{ 21580, -17815, -7282, -1575, -2078, -320},
-{ -2233, 10017, -2728, 14938, -13640, -17659},
-{ -1564, -17738, -19161, 13735, 2757, 2951},
-{ 4520, 5510, 7393, 10799, 19231, -13770},
-{ 399, 2976, -1099, 5013, -1159, 22095},
-{ 3624, -2359, 4680, -2238, 22702, 3765},
-{ -4201, -8285, -6810, -12390, -18414, 15382},
-{ -5198, -6869, -10047, -8364, -16022, -20562},
-{ -142, -22671, -368, 4391, -464, -13},
-{ 814, -1118, -1089, -22019, 74, 1553},
-{ -1618, 19222, -17642, -13490, 842, -2309},
-{ 4689, 16490, 20813, -15387, -4164, -3968},
-{ -3308, 11214, -13542, 13599, -19473, 13770},
-{ 1817, 854, 21225, -966, -1643, -268},
-{ -2587, -107, -20154, 376, 1174, -304},
-{ -2919, 453, -5390, 750, -22034, -978},
-{ -19012, 16839, 10000, -3580, 2211, 1459},
-{ 1363, -2658, -33, -4067, 1165, -21985},
-{ -8592, -2760, -17520, -15985, 14897, 1323},
-{ 652, -9331, 3253, -14622, 12181, 19692},
-{ -6361, 5773, -15395, 17291, 16590, -2922},
-{ -661, -601, 1609, 22610, 992, -1045},
-{ 4961, 9107, 11225, 7829, 16320, 18627},
-{ -21872, -1433, 138, 1470, -1891, -196},
-{ -19499, -18203, 11056, -516, 2543, -2249},
-{ -1196, -17574, 20150, 11462, -401, 2619},
-{ 4638, -8154, 11891, -15759, 17615, -14955},
-{ -83, 278, 323, 55, -154, 232},
-{ 7788, 1462, 18395, 15296, -15763, -1131},
-};
-static const int16_t vq_hebap5[128][6] = {
-{ -3394, -19730, 2963, 9590, 4660, 19673},
-{ -15665, -6405, 17671, 3860, -8232, -19429},
-{ 4467, 412, -17873, -8037, 691, -17307},
-{ 3580, 2363, 6886, 3763, 6379, -20522},
-{ -17230, -14133, -1396, -23939, 8373, -12537},
-{ -8073, -21469, -15638, 3214, 8105, -5965},
-{ 4343, 5169, 2683, -16822, -5146, -16558},
-{ 6348, -10668, 12995, -25500, -22090, 4091},
-{ -2880, -8366, -5968, -17158, -2638, 23132},
-{ -5095, -14281, -22371, 21741, 3689, 2961},
-{ -2443, -17739, 25155, 2707, 1594, 7},
-{ -18379, 9010, 4270, 731, -426, -640},
-{ -23695, 24732, 5642, 612, -308, -964},
-{ -767, 1268, 225, 1635, 173, 916},
-{ 5455, 6493, 4902, 10560, 23041, -17140},
-{ 17219, -21054, -18716, 4936, -3420, 3357},
-{ -1390, 15488, -21946, -14611, 1339, 542},
-{ -6866, -2254, -12070, -3075, -19981, -20622},
-{ -1803, 11775, 1343, 8917, 693, 24497},
-{ -21610, 9462, 4681, 9254, -7815, 15904},
-{ -5559, -3018, -9169, -1347, -22547, 12868},
-{ -366, 5076, -1727, 20427, -283, -2923},
-{ -1886, -6313, -939, -2081, -1399, 3513},
-{ -3161, -537, -5075, 11268, 19396, 989},
-{ 2345, 4153, 5769, -4273, 233, -399},
-{ -21894, -1138, -16474, 5902, 5488, -3211},
-{ 10007, -12530, 18829, 20932, -1158, 1790},
-{ -1165, 5014, -1199, 6415, -8418, -21038},
-{ 1892, -3534, 3815, -5846, 16427, 20288},
-{ -2664, -11627, -4147, -18311, -22710, 14848},
-{ 17256, 10419, 7764, 12040, 18956, 2525},
-{ -21419, -18685, -10897, 4368, -7051, 4539},
-{ -1574, 2050, 5760, 24756, 15983, 17678},
-{ -538, -22867, 11067, 10301, 385, 528},
-{ -8465, -3025, -16357, -23237, 16491, 3654},
-{ 5840, 575, 11890, 1947, 25157, 6653},
-{ 6625, -3516, -1964, 3850, -390, -116},
-{ 18005, 20900, 14323, -7621, -10922, 11802},
-{ -4857, -2932, -13334, -7815, 21622, 2267},
-{ -579, -9431, -748, -21321, 12367, 8265},
-{ -8317, 1375, -17847, 2921, 9062, 22046},
-{ 18398, 8635, -1503, -2418, -18295, -14734},
-{ -2987, 15129, -3331, 22300, 13878, -13639},
-{ 5874, -19026, 15587, 11350, -20738, 1971},
-{ 1581, -6955, -21440, 2455, 65, 414},
-{ 515, -4468, -665, -4672, 125, -19222},
-{ 21495, -20301, -1872, -1926, -211, -1022},
-{ 5189, -12250, -1775, -23550, -4546, 5813},
-{ 321, -6331, 14646, 6975, -1773, 867},
-{ -13814, 3180, 7927, 444, 19552, 3146},
-{ -6660, 12252, -1972, 17408, -24280, -12956},
-{ -745, 14356, -1107, 23742, -9631, -18344},
-{ 18284, -7909, -7531, 19118, 7721, -12659},
-{ 1926, 15101, -12848, 2153, 21631, 1864},
-{ -2130, 23416, 17056, -15597, -1544, 87},
-{ 8314, -11824, 14581, -20591, 7891, -2099},
-{ 19600, 22814, -17304, -2040, 285, -3863},
-{ -8214, -18322, 10724, -13744, -13469, -1666},
-{ 14351, 4880, -20034, 964, -4221, -180},
-{ -24598, -16635, 19724, 5925, 4777, 4414},
-{ -2495, 23493, -16141, 2918, -1038, -2010},
-{ 18974, -2540, 13343, 1405, -6194, -1136},
-{ 2489, 13670, 22638, -7311, -129, -2792},
-{ -13962, 16775, 23012, 728, 3397, 162},
-{ 3038, 993, 8774, -21969, -6609, 910},
-{ -12444, -22386, -2626, -5295, 19520, 9872},
-{ -1911, -18274, -18506, -14962, 4760, 7119},
-{ 8298, -2978, 25886, 7660, -7897, 1020},
-{ 6132, 15127, 18757, -24370, -6529, -6627},
-{ 7924, 12125, -9459, -23962, 5502, 937},
-{ -17056, -5373, 2522, 327, 1129, -390},
-{ 15774, 19955, -10380, 11172, -3107, 14853},
-{ -11904, -8091, -17928, -22287, -17237, -6803},
-{ -12862, -2172, -6509, 5927, 12458, -22355},
-{ -497, 322, 1038, -6643, -5404, 20311},
-{ 1083, -22984, -8494, 12130, -762, 2623},
-{ 5067, 19712, -1901, -30, -325, 85},
-{ 987, -5830, 4212, -9030, 9121, -25038},
-{ -7868, 7284, -12292, 12914, -21592, 20941},
-{ -1630, -7694, -2187, -8525, -5604, -25196},
-{ -6668, 388, -22535, 1526, 9082, 193},
-{ -7867, -22308, 5163, 362, 944, -259},
-{ 3824, -11850, 7591, -23176, 25342, 23771},
-{ -10504, 4123, -21111, 21173, 22439, -838},
-{ -4723, 21795, 6184, -122, 1642, -717},
-{ 24504, 19887, -2043, 986, 7, -55},
-{ -27313, -135, 2437, 259, 89, 307},
-{ 24446, -3873, -5391, -820, -2387, 361},
-{ 5529, 5784, 18682, 242, -21896, -4003},
-{ 22304, 4483, 722, -12242, 7570, 15448},
-{ 8673, 3009, 20437, 21108, -21100, -3080},
-{ -1132, 2705, -1825, 5420, -785, 18532},
-{ 16932, -13517, -16509, -14858, -20327, -14221},
-{ 2219, 1380, 21474, -1128, 327, 83},
-{ -2177, 21517, -3856, -14180, -204, -2191},
-{ 953, -9426, 15874, -10710, -3231, 21030},
-{ -421, -1377, 640, -8239, -20976, 2174},
-{ 4309, 18514, -9100, -18319, -15518, 3704},
-{ -5943, 449, -8387, 1075, -22210, -4992},
-{ 2953, 12788, 18285, 1430, 14937, 21731},
-{ -2913, 401, -4739, -20105, 1699, -1147},
-{ 3449, 5241, 8853, 22134, -7547, 1451},
-{ -2154, 8584, 18120, -15614, 19319, -5991},
-{ 3501, 2841, 5897, 6397, 8630, 23018},
-{ 2467, 2956, 379, 5703, -22047, -2189},
-{ -16963, -594, 18822, -5295, 1640, 774},
-{ 2896, -1424, 3586, -2292, 19910, -1822},
-{ -18575, 21219, -14001, -12573, 16466, 635},
-{ -1998, -19314, -16527, 12208, -16576, -7854},
-{ -9674, 1012, -21645, 2883, -12712, 2321},
-{ -1005, 471, -3629, 8045, -11087, 25533},
-{ 4141, -21472, -2673, 756, -663, -523},
-{ 6490, 8531, 19289, 18949, 6092, -9347},
-{ 16965, 24599, 14024, 10072, -536, -10438},
-{ -8147, 2145, -23028, -17073, 5451, -4401},
-{ -14873, 20520, -18303, -9717, -11885, -17831},
-{ -2290, -14120, 2070, 22467, 1671, 725},
-{ -8538, 14629, 3521, -20577, 6673, 8200},
-{ 20248, 4410, -1366, -585, 1229, -2449},
-{ 7467, -7148, 13667, -8246, 22392, -17320},
-{ -1932, 3875, -9064, -3812, 958, 265},
-{ -4399, 2959, -15911, 19598, 4954, -1105},
-{ 18009, -9923, -18137, -3862, 11178, 5821},
-{ -14596, -1227, 9660, 21619, 11228, -11721},
-{ -721, -1700, 109, -2142, 61, -6772},
-{ -24619, -22520, 5608, -1957, -1761, -1012},
-{ -23728, -4451, -2688, -14679, -4266, 9919},
-{ 8495, -894, 20438, -13820, -17267, 139},
-};
-static const int16_t vq_hebap6[256][6] = {
-{ 10154, 7365, 16861, 18681, -22893, -3636},
-{ -2619, -3788, -5529, -5192, -9009, -20298},
-{ -5583, -22800, 21297, 7012, 745, 720},
-{ 428, -1459, 109, -3082, 361, -8403},
-{ 8161, 22401, 241, 1755, -874, -2824},
-{ 1140, 12643, 2306, 22263, -25146, -17557},
-{ -2609, 3379, 10337, -19730, -15468, -23944},
-{ -4040, -12796, -25772, 13096, 3905, 1315},
-{ 4624, -23799, 13608, 25317, -1175, 2173},
-{ -97, 13747, -5122, 23255, 4214, -22145},
-{ 6878, -322, 18264, -854, -11916, -733},
-{ 17280, -12669, -9693, 23563, -16240, -1309},
-{ 5802, -4968, 19526, -21194, -24622, -183},
-{ 5851, -16137, 15229, -9496, -1538, 377},
-{ 14096, 25057, 13419, 8290, 23320, 16818},
-{ -7261, 118, -15867, 19097, 9781, -277},
-{ -4288, 21589, -13288, -16259, 16633, -4862},
-{ 4909, -19217, 23411, 14705, -722, 125},
-{ 19462, -4732, -1928, -11527, 20770, 5425},
-{ -27562, -2881, -4331, 384, -2103, 1367},
-{ -266, -9175, 5441, 26333, -1924, 4221},
-{ -2970, -20170, -21816, 5450, -7426, 5344},
-{ -221, -6696, 603, -9140, 1308, -27506},
-{ 9621, -8380, -1967, 9403, -1651, 22817},
-{ 7566, -5250, -4165, 1385, -990, 560},
-{ -1262, 24738, -19057, 10741, 7585, -7098},
-{ 451, 20130, -9949, -6015, -2188, -1458},
-{ 22249, 9380, 9096, 10959, -2365, -3724},
-{ 18668, -650, -1234, 11092, 7678, 5969},
-{ 19207, -1485, -1076, -731, -684, 43},
-{ -4973, 13430, 20139, 60, 476, -935},
-{ -20029, 8710, 2499, 1016, -1158, 335},
-{ -26413, 18598, -2201, -669, 3409, 793},
-{ -4726, 8875, -24607, -9646, 3643, -283},
-{ 13303, -21404, -3691, -1184, -1970, 1612},
-{ 173, 60, 919, 1229, 6942, -665},
-{ 16377, 16991, 5341, -14015, -2304, -20390},
-{ 25334, -10609, 11947, -7653, -6363, 14058},
-{ 23929, -13259, -7226, -937, 234, -187},
-{ 6311, -1877, 12506, -1879, 18751, -23341},
-{ 621, 6445, 3354, -24274, 8406, 5315},
-{ -3297, -5034, -4704, -5080, -25730, 5347},
-{ -1275, -13295, -965, -23318, 1214, 26259},
-{ -6252, 10035, -20105, 15301, -16073, 5136},
-{ 9562, -3911, -19510, 4745, 22270, -4171},
-{ 7978, -19600, 14024, -5745, -20855, 8939},
-{ 7, -4039, 991, -6065, 52, -19423},
-{ 3485, 2969, 7732, 7786, 25312, 6206},
-{ -959, -12812, -1840, -22743, 7324, 10830},
-{ -4686, 1678, -10172, -5205, 4294, -1271},
-{ 3889, 1302, 7450, 638, 20374, -3133},
-{ -12496, -9123, 18463, -12343, -7238, 18552},
-{ -6185, 8649, -6903, -895, 17109, 16604},
-{ -9896, 28579, 2845, 1640, 2925, -298},
-{ 14968, -25988, 14878, -24012, 1815, -6474},
-{ 26107, 5166, 21225, 15873, 21617, 14825},
-{ -21684, 16438, 20504, -14346, -7114, -4162},
-{ 28647, 90, -1572, 789, -902, -75},
-{ -1479, 2471, -4061, 3612, -2240, 10914},
-{ 8616, 17491, 17255, -17456, 17022, -16357},
-{ -20722, -18597, 25274, 17720, -3573, 1695},
-{ -997, 6129, -6303, 11250, -11359, -19739},
-{ -74, -4001, -1584, 13384, 162, -144},
-{ -529, 21068, 7923, -11396, 422, -26},
-{ 7102, -13531, -20055, 2629, -178, -429},
-{ 9201, 1368, -22238, 2623, -20499, 24889},
-{ -432, 6675, -266, 8723, 80, 28024},
-{ 19493, -3108, -9261, 1910, -21777, 5345},
-{ 14079, -11489, 12604, 6079, 19877, 1315},
-{ 10947, 9837, -18612, 15742, 4792, 605},
-{ -1777, 3758, -4087, 21696, 6024, -576},
-{ 3567, -3578, 16379, 2680, -1752, 716},
-{ -5049, -1399, -4550, -652, -17721, -3366},
-{ -3635, -4372, -6522, -22152, 7382, 1458},
-{ 12242, 19190, 5646, -7815, -20289, 21344},
-{ -7508, 19952, 23542, -9753, 5669, -1990},
-{ -2275, 15438, 10907, -17879, 6497, 13582},
-{ -15894, -15646, -4716, 6019, 24250, -6179},
-{ -2049, -6856, -1208, 918, 17735, -69},
-{ -3721, 9099, -16065, -23621, 5981, -2344},
-{ 7862, -8918, 24033, 25508, -11033, -741},
-{ -12588, 19468, 14649, 15451, -21226, 1171},
-{ 2102, 1147, 2789, 4096, 2179, 8750},
-{ -18214, -17758, -10366, -5203, -1066, -3541},
-{ -2819, -19958, -11921, 6032, 8315, 10374},
-{ -9078, -2100, 19431, -17, 732, -689},
-{ -14512, -19224, -7095, 18727, 1870, 22906},
-{ 3912, 659, 25597, -4006, 9619, 877},
-{ 2616, 22695, -5770, 17920, 3812, 20220},
-{ 2561, 26847, -5245, -10908, 2256, -517},
-{ -4974, 198, -21983, -3608, 22174, -18924},
-{ 21308, -1211, 19144, 16691, -1588, 11390},
-{ -1790, 3959, -3488, 7003, -7107, 20877},
-{ -6108, -17955, -18722, 24763, 16508, 3211},
-{ 20462, -24987, -20361, 4484, -5111, -478},
-{ -6378, -1998, -10229, -561, -22039, -22339},
-{ 3047, -18850, 7586, 14743, -19862, 6351},
-{ -5047, 1405, -9672, 1055, -21881, 11170},
-{ 3481, -9699, 6526, -16655, 22813, 21907},
-{ -18570, 17501, 14664, 1291, 5026, 19676},
-{ 16134, -19810, -16956, -17939, -16933, 5800},
-{ -8224, 4908, 8935, 2272, -1140, -23217},
-{ 1572, 2753, -1598, 2143, -3346, -21926},
-{ -9832, -1060, -27818, 1214, 7289, 150},
-{ 98, 1538, 535, 17429, -23198, -901},
-{ 21340, -20146, 3297, -1744, -8207, -21462},
-{ -4166, -4633, -17902, 5478, 1285, 136},
-{ 18713, 21003, 24818, 11421, 1282, -4618},
-{ -3535, 7636, -265, 2141, -829, -2035},
-{ -3184, 19713, 2775, -2, 1090, 104},
-{ -6771, -20185, 2938, -2125, -36, 1268},
-{ 9560, 9430, 9586, 22100, 13827, 6296},
-{ -535, -20018, 4276, -1868, -448, -17183},
-{ -24352, 14244, -13647, -21040, 2271, 11555},
-{ -2646, 15437, -4589, 18638, -4299, -622},
-{ -20064, 4169, 18115, -1404, 13722, -1825},
-{ -16359, 9080, 744, 22021, 125, 10794},
-{ 9644, -14607, -18479, -14714, 11174, -20754},
-{ -326, -23762, 6144, 7909, 602, 1540},
-{ -6650, 6634, -12683, 21396, 20785, -6839},
-{ 4252, -21043, 5628, 18687, 23860, 8328},
-{ 17986, 5704, -5245, -18093, -555, 3219},
-{ 6091, 14232, -5117, -17456, -19452, -11649},
-{ -21586, 11302, 15434, 25590, 6777, -26683},
-{ 21355, -8244, 5877, -3540, 6079, -2567},
-{ 2603, -2455, 5421, -12286, -19100, 5574},
-{ -1721, -26393, -23664, 22904, -349, 3787},
-{ 2189, -1203, 5340, 3249, -22617, 104},
-{ -1664, -11020, -2857, -20723, -24049, 19900},
-{ 22873, -7345, -18481, -14616, -8400, -12965},
-{ 3777, 3958, 8239, 20494, -6991, -1201},
-{ -160, -1613, -793, -8681, 573, 776},
-{ 4297, -3786, 20373, 6082, -5321, -18400},
-{ 18745, 2463, 12546, -7749, -7734, -2183},
-{ 11074, -4720, 22119, 1825, -24351, 4080},
-{ 1503, -19178, -1569, 13, -313, 375},
-{ 318, -575, 2544, 178, 102, 40},
-{ -15996, -26897, 5008, 3320, 686, 1159},
-{ 25755, 26886, 574, -5930, -3916, 1407},
-{ -9148, -7665, -2875, -8384, -18663, 26400},
-{ -7445, -18040, -18396, 8802, -2252, -21886},
-{ 7851, 11773, 27485, -12847, -1410, 19590},
-{ 2240, 5947, 11247, 15980, -6499, 24280},
-{ 21673, -18515, 9771, 6550, -2730, 334},
-{ -4149, 1576, -11010, 89, -24429, -5710},
-{ 7720, 1478, 21412, -25025, -8385, 9},
-{ -2448, 10218, -12756, -16079, 1161, -21284},
-{ -8757, -14429, -22918, -14812, 2629, 13844},
-{ -7252, 2843, -9639, 2882, -14625, 24497},
-{ -674, -6530, 414, -23333, -21343, 454},
-{ 2104, -6312, 10887, 18087, -1199, 175},
-{ -493, -562, -2739, 118, -1074, 93},
-{ -10011, -4075, -28071, 22180, 15077, -636},
-{ -4637, -16408, -9003, -20418, -11608, -20932},
-{ 4815, 15892, 24238, -13634, -3074, -1059},
-{ -6724, 4610, -18772, -15283, -16685, 23988},
-{ 15349, -674, -3682, 21679, 4475, -12088},
-{ 4756, 2593, 5354, 6001, 15063, 26490},
-{ -23815, -17251, 6944, 378, 694, 670},
-{ 23392, -8839, -14713, 7544, -876, 11088},
-{ 3640, 3336, 22593, -3495, -2328, -113},
-{ 284, 6914, 3097, 10171, 6638, -18621},
-{ 2472, 5976, 11054, -11936, -603, -663},
-{ 16175, 16441, 13164, -4043, 4667, 7431},
-{ 19338, 15534, -6533, 1681, -4857, 17048},
-{ 17027, 532, -19064, -1441, -5130, 1085},
-{ -12617, -17609, 2062, -25332, 19009, -16121},
-{ 10056, -21000, -13634, -2949, 15367, 19934},
-{ -648, -1605, 10046, -1592, 13296, 19808},
-{ -1054, 10744, 538, 24938, 9630, -9052},
-{ -10099, 3042, -25076, -24052, 13971, 100},
-{ 6547, 6907, 7031, 10348, 23775, -17886},
-{ -22793, -1984, -1393, -3330, 9267, 14317},
-{ -14346, -3967, 3042, 16254, -17303, 9646},
-{ -21393, 23628, 16773, 716, 2663, 114},
-{ -19016, -3038, 1574, -245, 1463, -793},
-{ 22410, 23441, -14637, -530, 17310, 13617},
-{ -11582, 7935, -13954, 23465, -24628, 26550},
-{ -1045, 3679, -2218, 10572, 20999, -3702},
-{ -15513, 197, 16718, -24603, 4945, 5},
-{ 10781, 4335, 26790, -9059, -16152, -2840},
-{ 16075, -24100, -3933, -6833, 12645, -7029},
-{ 2096, -25572, -8370, 6814, 11, 1178},
-{ -11848, -583, -8889, -20543, -10471, -380},
-{ -2487, 24777, -21639, -19341, 1660, -732},
-{ 2313, 13679, 4085, 24549, 24691, -21179},
-{ -2366, -504, -4130, -10570, 23668, 1961},
-{ 20379, 17809, -9506, 3733, -18954, -6292},
-{ -3856, 16802, -929, -20310, -17739, 6797},
-{ 12431, 6078, -11272, -14450, 6913, 23476},
-{ 7636, -1655, 23017, 10719, -8292, 838},
-{ -8559, -1235, -18096, 3897, 16093, 1490},
-{ -3586, 8276, 15165, -3791, -21149, 1741},
-{ -4497, 21739, 2366, -278, -4792, 15549},
-{ -23122, -13708, 7668, 16232, 24120, 15025},
-{ -20043, 12821, -20160, 16691, -11655, -16081},
-{ -12601, 20239, 3496, -2549, -6745, -11850},
-{ 4441, 7812, 20783, 17080, 11523, -9643},
-{ 24766, 8494, -23298, -3262, 11101, -7120},
-{ -10107, -7623, -22152, -18303, 26645, 9550},
-{ -25549, 477, 7874, -1538, 1123, -168},
-{ 470, 9834, -347, 23945, -10381, -9467},
-{ -4096, -9702, -6856, -21544, 20845, 7174},
-{ 5370, 9748, -23765, -1190, 512, -1538},
-{ -1006, -10046, -12649, 19234, -1790, -890},
-{ 15108, 23620, -15646, -2522, -1203, -1325},
-{ -7406, -2605, 1095, -247, -473, 177},
-{ 8089, 4, 12424, -22284, 10405, -7728},
-{ 22196, 10775, -5043, 690, 534, -212},
-{ -3153, -1418, -16835, 18426, 15821, 22956},
-{ 5681, -2229, 3196, -3414, -21817, -14807},
-{ 19, 787, 1032, 170, -8295, -645},
-{ -882, -2319, -27105, 432, -4392, 1499},
-{ -1354, -11819, -76, -20380, -10293, 11328},
-{ 211, -4753, -4675, -6933, -13538, 14479},
-{ 6043, 5260, -459, -462, 143, -65},
-{ -2572, 7256, -3317, 9212, -23184, -9990},
-{ -24882, -9532, 18874, 6101, 2429, -14482},
-{ 8314, 2277, 14192, 3512, 25881, 22000},
-{ 208, 20218, -281, -24778, -63, -1183},
-{ 1095, -6034, 2706, -21935, -2655, 563},
-{ 23, -5930, 243, -8989, 5345, 20558},
-{ -15466, 12699, 4160, 11087, 20621, -10416},
-{ 20995, -85, -8468, 194, 1003, -9515},
-{ -19637, -3335, -14081, 3574, -23381, -667},
-{ -2076, 3489, -3192, -19367, 539, -1530},
-{ 7352, -15213, 22596, 19369, 1043, 16627},
-{ -1872, -413, 1235, -5276, -3550, 21903},
-{ 7931, -2008, 16968, -6799, 29393, -2475},
-{ -13589, 8389, -23636, -22091, -14178, -14297},
-{ -11575, -20090, 16056, -1848, 15721, 4500},
-{ 3849, -16581, 20161, -21155, 7778, 11864},
-{ -6547, -1273, -18837, -11218, 11636, 1044},
-{ 2528, -6691, -17917, -11362, -4894, -1008},
-{ 1241, 4260, 2319, 6111, 3485, 20209},
-{ 3014, -3048, 5316, -4539, 20831, 8702},
-{ -1790, -14683, 278, 13956, -10065, -10547},
-{ -22732, -7957, -1154, 13821, -1484, -1247},
-{ -7317, -615, 13094, 18927, 9897, 1452},
-{ 2552, -2338, 3424, -4630, 11124, -19584},
-{ -11125, -20553, -10855, -10783, -20767, 6833},
-{ 984, -15095, 5775, 25125, 5377, -19799},
-{ 517, 13272, -7458, -1711, 20612, -6013},
-{ -21417, 13251, -20795, 13449, 17281, 13104},
-{ -15811, -16248, 23093, -4037, -8195, 871},
-{ 582, 12571, -21129, -14766, -9187, 5685},
-{ 4318, -1776, 11425, -17763, -9921, 577},
-{ 6013, 16830, 17655, -25766, -4400, -3550},
-{ -13744, -16541, 3636, -3330, -21091, -15886},
-{ 6565, -11147, 8649, -13114, 23345, -13565},
-{ -2542, -9046, -7558, 29240, 3701, -383},
-{ -10612, 24995, 1893, -8210, 20920, -16210},
-{ 5276, 16726, 10659, 19940, -4799, -19324},
-{ -532, -9300, 27856, 4965, -241, 536},
-{ -765, -20706, -3412, 18870, 2765, 1420},
-{ -3059, 2708, -19022, -331, 3537, 116},
-};
-static const int16_t vq_hebap7[512][6] = {
-{ -21173, 21893, 10390, 13646, 10718, -9177},
-{ -22519, -8193, 18328, -6629, 25518, -10848},
-{ 6800, -13758, -13278, 22418, 14667, -20938},
-{ 2347, 10516, 1125, -3455, 5569, 27136},
-{ -6617, 11851, -24524, 22937, 20362, -6019},
-{ -21768, 10681, -19615, -15021, -8478, -2081},
-{ -2745, 8684, -4895, 27739, 7554, -11961},
-{ -1020, 2460, -954, 4754, -627, -16368},
-{ -19702, 23097, 75, -13684, -2644, 2108},
-{ 4049, -2872, 5851, -4459, 22150, 12560},
-{ -21304, -17129, -730, 7419, -11658, -10523},
-{ 11332, 1792, 26666, 23518, -19561, -491},
-{ -17827, -16777, -13606, -14389, -22029, -2464},
-{ 1091, -5967, -7975, -16977, -20432, -21931},
-{ 18388, -1103, 1933, 13342, -17463, 18114},
-{ 22646, 17345, -9966, 17919, 18274, 698},
-{ 1484, 20297, -5754, -26515, 4941, -22263},
-{ -2603, 4587, -5842, 18464, 8767, -2568},
-{ -2797, -1602, 21713, 3099, -25683, 3224},
-{ -19027, 4693, -5007, 6060, 1972, -15095},
-{ -2189, 9516, -530, 20669, -4662, -8301},
-{ -22325, -8887, 2529, -11352, 5476, 998},
-{ 22100, -5052, 1651, -2657, 4615, 2319},
-{ 20855, -3078, -3330, 4105, 13470, 3069},
-{ 85, 17289, 10264, -14752, 214, 90},
-{ -26365, -18849, -19352, 19244, -10218, 9909},
-{ -9739, 20497, -6579, -6983, 2891, -738},
-{ 20575, -15860, -22913, 6870, 76, 327},
-{ 8744, -12877, -22945, -2372, -19424, -9771},
-{ -12886, 16183, 21084, 3821, 749, -13792},
-{ -15995, 18399, 2391, -17661, 19484, -6018},
-{ 1423, 11734, 4051, 19290, 6857, -19681},
-{ -5200, 9766, 18246, 2463, 18764, -4852},
-{ -597, 19498, 1323, -9096, -308, -1104},
-{ -3099, -25731, -15665, 25332, 4634, 2635},
-{ 19623, -2384, -7913, 11796, -9333, -14084},
-{ 2642, 26453, -21091, -10354, -1693, -1711},
-{ 22031, 21625, 11580, -22915, -4141, 129},
-{ -6122, 3542, 915, -261, -17, -383},
-{ 1696, 6704, -1425, 20838, 857, -4416},
-{ 1423, -15280, -8550, -9667, 5210, 5687},
-{ -4520, -613, -11683, 5618, 4230, 619},
-{ 937, -4963, -14102, -17104, -6906, -5952},
-{ -15068, -481, -7237, -14894, 18876, 21673},
-{ -25658, 2910, 1143, -327, -458, -995},
-{ -9656, -819, -24900, 2804, 20225, 1083},
-{ -1111, -3682, -1788, -19492, 966, 821},
-{ 7293, -21759, 10790, -7059, -23293, -1723},
-{ -282, -11093, 170, -20950, -28926, 12615},
-{ 17938, 3713, -1563, 885, 5, 564},
-{ 6116, 22696, 2242, -6951, 9975, -6132},
-{ 4338, 26808, -3705, 1976, -1079, -2570},
-{ -661, -7901, -2668, -15194, 17722, 4375},
-{ -4174, -11053, 717, -22506, 1562, 12252},
-{ -6405, 18334, 6103, 6983, 5956, 18195},
-{ 9851, 5370, 23604, -6861, -6569, -62},
-{ 21964, 13359, -683, 3785, 2168, 209},
-{ -3569, -1127, -19724, -1544, 1308, -803},
-{ -3083, 16049, -13791, -3077, 4294, 23713},
-{ -9999, 9943, -15872, 12934, -23631, 21699},
-{ 9722, 22837, 12192, 15091, 5533, 4837},
-{ 2243, 2099, 1243, 4089, 4748, 12956},
-{ 4007, -2468, 3353, -3092, 8843, 17024},
-{ 4330, 6127, 5549, 9249, 11226, 28592},
-{ -9586, -8825, 236, 1009, 455, -964},
-{ 6829, 19290, -1018, 200, 1821, 578},
-{ 5196, 957, 10372, 3330, -12800, -127},
-{ -3022, -8193, -14557, 22061, 5920, 1053},
-{ 10982, 25942, -24546, -23278, -11905, -6789},
-{ 22667, -11010, 5736, 2567, 23705, -10253},
-{ -3343, -4233, -5458, 20667, -10843, -3605},
-{ -4131, -3612, 4575, -829, -350, -847},
-{ -3303, 3451, -7398, -11604, 3023, 455},
-{ 3200, -9547, 3202, -22893, 11184, -26466},
-{ -14093, -4117, 15382, 14295, -10915, -20377},
-{ 3807, -11016, 22052, 14370, -15328, -7733},
-{ -6291, -17719, -1560, 12048, -19805, -443},
-{ -6147, -4234, -160, 8363, 22638, 11911},
-{ 19197, 1175, 7422, -9875, -4136, 4704},
-{ -72, -7652, -112, -11955, -3230, 27175},
-{ 3274, 5963, 7501, -17019, 866, -25452},
-{ 737, 1861, 1833, 2022, 2384, 4755},
-{ -5217, 7512, 3323, 2715, 3065, -1606},
-{ 4247, 565, 5629, 2497, 18019, -4920},
-{ -2833, -17920, -8062, 15738, -1018, 2136},
-{ 3050, -19483, 16930, 29835, -10222, 15153},
-{ -11346, 118, -25796, -13761, 15320, -468},
-{ -4824, 4960, -4263, 1575, -10593, 19561},
-{ -8203, -1409, -763, -1139, -607, 1408},
-{ -2203, -11415, 2021, -6388, -2600, 711},
-{ -413, -2511, -216, -3519, -28267, 1719},
-{ -14446, 17050, 13917, 13499, -25762, -16121},
-{ 19228, 7341, -12301, 682, -3791, -199},
-{ -4193, 20746, -15651, 11349, 5860, -824},
-{ -21490, -3546, -3, -1705, -3959, 9213},
-{ 15445, -1876, 2012, -19627, 16228, -4845},
-{ -2867, -3733, -7354, -175, -20119, 11174},
-{ -3571, -24587, 19700, 6654, 979, -654},
-{ 21820, -7430, -6639, -10767, -8362, 15543},
-{ 14827, 17977, -7204, -3409, 1906, -17288},
-{ 3525, -3947, -1415, -2798, 17648, 2082},
-{ -6580, -15255, -17913, 1337, 15338, 21158},
-{ 6210, 9698, 15155, -24666, -22507, -3999},
-{ -1740, -593, 1095, -7779, 25058, 5601},
-{ 21415, -432, -1658, -6898, -1438, -14454},
-{ -6943, 700, -12139, -745, -24187, 22466},
-{ 6287, 3283, 11006, 3844, 19184, 14781},
-{ -22502, 15274, 5443, -2808, -970, -3343},
-{ 3257, -3708, 4744, -8301, 22814, -10208},
-{ 24346, -20970, 19846, 987, -11958, -6277},
-{ 3906, -19701, 13060, -1609, 18641, 7466},
-{ -26409, -22549, 16305, 2014, 10975, 18032},
-{ -7039, 4655, -14818, 18739, 15789, 1296},
-{ 9310, -1681, 14667, -3326, 26535, -11853},
-{ 5728, 5917, 13400, 10020, -2236, -24704},
-{ 1741, -6727, 12695, -22009, 4080, 5450},
-{ -2621, 9393, 21143, -25938, -3162, -2529},
-{ 20672, 18894, -13939, 6990, -8260, 15811},
-{ -23818, 11183, -13639, 11868, 16045, 2630},
-{ 18361, -10220, 829, 856, -1010, 157},
-{ 14400, -4678, 5153, -13290, -27434, -11028},
-{ 21613, 11256, 17453, 7604, 13130, -484},
-{ 7, 1236, 573, 4214, 5576, -3081},
-{ 916, -9092, 1285, -8958, 1185, -28699},
-{ 21587, 23695, 19116, -2885, -14282, -8438},
-{ 23414, -6161, 12978, 3061, -9351, 2236},
-{ -3070, -7344, -20140, 5788, 582, -551},
-{ -3993, 315, -7773, 8224, -28082, -12465},
-{ 13766, -15357, 19205, -20624, 13043, -19247},
-{ 3777, -177, 8029, -1001, 17812, 5162},
-{ -7308, -4327, -18096, -620, -1350, 14932},
-{ 14756, -1221, -12819, -14922, -547, 27125},
-{ 2234, 1708, 2764, 5416, 7986, -25163},
-{ 2873, 3636, 3992, 5344, 10142, 21259},
-{ 1158, 5379, 508, -10514, 290, -1615},
-{ 1114, 24789, 16575, -25168, -298, -2832},
-{ -1107, -6144, -1918, -7791, -2971, -23276},
-{ 4016, 10793, 17317, -4342, -20982, -3383},
-{ -4494, -207, -9951, -3575, 7947, 1154},
-{ -7576, 8117, -14047, 16982, -26457, -27540},
-{ -15164, 16096, -16844, -8886, -23720, 15906},
-{ 24922, 5680, -1874, 420, 132, 117},
-{ -506, -19310, -198, 412, -311, 752},
-{ -1906, 3981, -7688, 16566, -19291, -14722},
-{ -399, -729, -3807, -4196, -12395, 7639},
-{ 3368, 2330, 9092, 23686, -10290, -1705},
-{ -3148, 2596, -7986, 14602, -4807, 16627},
-{ 8057, 1481, 49, 17205, 24869, 7474},
-{ -19304, -513, 11905, 2346, 5588, 3365},
-{ -5063, -21812, 11370, 10896, 4881, 261},
-{ 4794, 20577, 5109, -6025, -8049, -1521},
-{ 8125, -14756, 20639, -14918, 23941, -3650},
-{ 12451, 1381, 3613, 8687, -24002, 4848},
-{ 6726, 10643, 10086, 25217, -25159, -1065},
-{ 6561, 13977, 2911, 21737, 16465, -26050},
-{ -1776, 2575, -19606, -16800, 3032, 6679},
-{ 15012, -17910, -8438, -21554, -27111, 11808},
-{ 3448, -924, -15913, -1135, 5126, -20613},
-{ 7720, 2226, 17463, 5434, 28942, 17552},
-{ 1246, 15614, -11743, 24618, -17539, 3272},
-{ 3215, 17950, 2783, -722, -22672, 5979},
-{ -5678, -3184, -26087, 26034, 6583, 3302},
-{ 20310, -3555, -2715, -444, -1487, 1526},
-{ -20640, -21970, -12207, -25793, 8863, -1036},
-{ 17888, 570, -16102, 8329, -2553, 15275},
-{ -2677, 9950, -1879, 16477, -12762, -29007},
-{ -120, -2221, 219, 97, 365, 35},
-{ 1270, -718, 1480, -2689, 1930, -7527},
-{ 1896, 8750, 1906, 18235, -12692, -6174},
-{ -3733, 13713, -9882, -15960, -1376, -7146},
-{ -10600, 8496, 15967, -8792, 7532, 20439},
-{ 3041, -13457, 1032, -26952, 5787, 24984},
-{ -4590, -8220, -9322, -6112, -17243, 25745},
-{ -17808, 6970, 3752, 626, -114, 2178},
-{ 4449, -4862, 7054, -5404, 4738, -2827},
-{ 4922, -651, 18939, -9866, 848, 1886},
-{ -336, -5410, 7234, 20444, -9583, -600},
-{ 781, -19474, -12648, 6634, 1414, 450},
-{ -3399, -16770, 11107, 13200, -5498, 21663},
-{ -3265, 4859, -5961, 7530, -10837, 28086},
-{ 10350, -12901, 25699, 25640, -639, 351},
-{ 1163, 18763, -5466, -15087, -145, -1377},
-{ -14477, 27229, -31383, -32653, 21439, -2894},
-{ 15420, 18823, 22128, 19398, 22583, 13587},
-{ -10674, 10710, 5089, -4756, 909, -20760},
-{ -12948, -20660, 7410, 2722, 3427, 11585},
-{ -1105, 18374, 19731, -9650, 22442, 19634},
-{ -296, -6798, -14677, 21603, 19796, 21399},
-{ -19350, -7501, 25446, 13144, 8588, -25298},
-{ 3092, -10618, 20896, 9249, -3326, 1796},
-{ -811, 1449, 3106, 4748, 12073, -14262},
-{ -20720, 14275, -4332, -25838, -5781, -21149},
-{ -5132, 10554, -14020, -22150, 2840, -554},
-{ 25533, 17648, 14886, -21074, 2459, 25142},
-{ -9370, -1788, -12862, -5870, -25811, -11023},
-{ 6698, 819, 10313, 166, 27581, 523},
-{ 101, -19388, 3413, 9638, 64, 806},
-{ -2742, -17931, -2576, 22818, 8553, 1126},
-{ 2972, 15203, 1792, 25434, -5728, -17265},
-{ -1419, 1604, 4398, 11452, 1731, 23787},
-{ -5136, 4625, -10653, 27981, 9897, -2510},
-{ -10528, -28033, 2999, -1530, -832, -830},
-{ -11133, -12511, 22206, -7243, -23578, -21698},
-{ 16935, -21892, 1861, -9606, 9432, 19026},
-{ 10277, 9516, 26815, 2010, -4943, -9080},
-{ 5547, -2210, 14270, -15300, -19316, 1822},
-{ -4850, -783, -8959, -3076, -20056, -3197},
-{ 8232, -2794, -17752, 13308, 3229, -991},
-{ -12237, -6581, 10315, -9552, 2260, -20648},
-{ -7000, 5529, -7553, -7490, -10342, -10266},
-{ 3641, 19479, -5972, -19097, -18570, 12805},
-{ 1283, -4164, 4198, -28473, -2498, 1866},
-{ 16047, 26826, -13053, -6316, 985, -1597},
-{ -403, 13680, 6457, 25070, 27124, -20710},
-{ -18070, -1790, -24986, 5953, -954, 26600},
-{ -24224, -15383, 24788, 1953, -1136, 187},
-{ -2289, 12505, -20738, -904, 18324, 21258},
-{ 2658, -6140, 16179, 22276, -556, 2154},
-{ -6087, 13950, -25682, -27713, 4049, -4795},
-{ -21452, 26473, 19435, -9124, 895, 303},
-{ -22200, -26177, -6026, 24729, -22926, -9030},
-{ -14276, -15982, 23732, -22851, 9268, -3841},
-{ 29482, 21923, -6213, 1679, -2059, -1120},
-{ -435, 9802, -3891, 12359, -4288, -18971},
-{ 19768, -86, 2467, 1990, -1021, -5354},
-{ 20986, -8783, -5329, -23562, -4730, 2673},
-{ -5095, 5605, -4629, 19150, 26037, -12259},
-{ 972, 6858, 4551, 27949, -4025, -2272},
-{ 6075, -3260, -4989, -373, -1571, -3730},
-{ -7256, -12992, -8820, -5109, 23054, 5054},
-{ 920, 2615, 7912, -7353, -4905, 20186},
-{ -250, 5454, 3140, 6928, -18723, -2051},
-{ -10299, -4372, 19608, 4879, -661, -1885},
-{ 14816, -8603, -19815, 6135, -21210, 14108},
-{ -11945, -2223, 5018, 11892, 22741, 406},
-{ -13184, -2613, -13256, -22433, -12482, -8380},
-{ 17066, 25267, -2273, 5056, -342, 145},
-{ 8401, -17683, 19112, 10615, -19453, 17083},
-{ 20821, -5700, 12298, -25598, 10391, 7692},
-{ 4550, 15779, 17338, -19379, -4768, 1206},
-{ -7723, 10836, -27164, -11439, 6835, -1776},
-{ 2542, 3199, 4442, 17513, -3711, -914},
-{ 20960, -16774, -5814, 11087, -70, 22961},
-{ 3305, 2919, 6256, -4800, -20966, -3230},
-{ 5924, -16547, 2183, 2733, 3446, -23306},
-{ -6061, -194, -13852, -10971, 19488, 1029},
-{ 4467, -5964, -19004, 1519, -359, 855},
-{ -1581, -7607, 22070, -11580, -10032, 17102},
-{ -12412, 2553, 4324, 22500, 5751, 12170},
-{ -25127, 17996, -6384, 1180, 1182, 9622},
-{ 23462, -8471, -4392, -2669, 7638, -16835},
-{ -5511, -2887, -10757, -20883, 7246, 1053},
-{ 2703, -20602, -7554, 7516, -7740, 5868},
-{ 20670, 21901, 457, 14969, -17657, -11921},
-{ 3603, -1595, -2177, -157, -43, 605},
-{ 2513, 8954, 10527, 22559, -16100, -16041},
-{ 6002, 4951, 6795, -4862, -22400, 18849},
-{ 7590, -1693, -24688, -3404, 14169, 1214},
-{ -4398, -6663, -6870, -10083, -24596, 9253},
-{ 10468, 17751, -7748, 147, -6314, 4419},
-{ 16187, -16557, -4119, 4302, 7625, 5409},
-{ 3303, 2735, 7458, -19902, -2254, -3702},
-{ -2077, 21609, 14870, 12545, -6081, -1764},
-{ 4678, 11740, 2859, 6953, 1919, -3871},
-{ 3522, -21853, -2469, -10453, 18893, -10742},
-{ 3759, -10191, -4866, -2659, -17831, -1242},
-{ 14991, 9351, 11870, -1573, -4848, 22549},
-{ 9509, -27152, 10734, 20851, -26185, -17878},
-{ -7170, -1392, -19495, 12746, 8198, -1988},
-{ 1883, 28158, -846, -7235, 249, 233},
-{ -7200, 669, -371, -2948, 23234, -5635},
-{ 3141, 288, 3223, -1258, -98, -27607},
-{ 17373, -23235, 5110, -11199, -2574, -11487},
-{ -4928, 1518, -5456, 670, -18278, 1951},
-{ 10334, -19865, -4649, 361, -160, -923},
-{ 18732, 14264, -3155, -7485, -3328, 5959},
-{ -3614, 21077, 7276, 3536, 8121, -1528},
-{ -8422, 500, -19182, 18929, 26392, -1039},
-{ 15639, 25668, 8375, 1903, 1945, -11979},
-{ -2716, 3389, 26850, -4587, 1803, 22},
-{ 1177, -655, 1233, -2128, 7844, 1767},
-{ -761, 8209, -19290, -4593, 1923, -343},
-{ -689, -3530, -3267, -3804, -2753, 18566},
-{ -2110, 1962, -1353, 16643, 2765, -23102},
-{ -433, 4905, 302, 13016, 15933, -5905},
-{ 3203, 4126, 11181, -5496, -2529, -1160},
-{ -1091, -6469, -1415, 5682, -268, 583},
-{ -9405, -19572, 6216, 1658, 993, -75},
-{ -1695, -4504, -2289, -4088, -6556, -16577},
-{ 4760, -892, -10902, 6516, 24199, -6011},
-{ -253, 1000, 63, -81, -115, -382},
-{ -1333, 24224, -698, -4667, -2801, -19144},
-{ -876, -28866, -21873, 12677, -6344, 3235},
-{ 16847, 21145, -26172, -3183, -396, 230},
-{ 18296, -7790, -12857, -679, -1473, 5},
-{ -10488, 11429, 25805, -1122, 1401, -438},
-{ 3782, -7429, 26720, 17567, 19257, 12542},
-{ 6332, -746, 12789, 9316, -22542, -5354},
-{ 3418, -22728, 26978, 18303, 1076, 956},
-{ -27315, -2988, 920, 235, 2233, 81},
-{ 6199, 5296, 16093, 14768, -8429, -1112},
-{ -6432, 19244, 9921, -3253, 1278, -954},
-{ 24213, 2049, -22931, 2585, -2410, -4216},
-{ 9286, 14282, -19735, -3985, -2344, 1028},
-{ -20128, 17993, -9458, 23012, -16983, 8625},
-{ -6896, -20730, 3762, 17415, 22341, 19024},
-{ 842, 24181, 25062, -5839, -78, 937},
-{ -621, 19722, -24204, -1962, -14854, -56},
-{ 22766, -5119, 17365, 23868, -19480, -6558},
-{ -2158, 17490, -21435, 3340, -12819, -20295},
-{ -9621, 17325, 715, 2265, -4123, -492},
-{ 9156, 12947, 27303, -21175, -6072, -9457},
-{ -13164, -23269, -14006, -4184, 6978, 2},
-{ 938, -13381, 3520, -24297, 22902, 19589},
-{ -4911, -19774, 19764, -9310, -12650, 3819},
-{ -5462, -4249, -6987, -6260, -13943, -25150},
-{ 9341, 10369, -13862, -6704, 22556, -519},
-{ 6651, 18768, -4855, 12570, 14730, -10209},
-{ -823, 18119, 398, -1582, -116, -363},
-{ -6935, -12694, -28392, 8552, 6961, -239},
-{ -2602, -4704, -1021, 2015, 5129, 23670},
-{ -12559, -8190, -25028, 18544, 14179, 1663},
-{ 3813, 21036, -9620, -5051, -1800, -1087},
-{ -22057, 16675, 14960, 9459, 2786, 16991},
-{ -26040, -19318, -6414, 1104, 5798, -18039},
-{ -1737, 24825, 10417, -11087, 896, -5273},
-{ -1855, 11661, -2803, 24809, -21435, -19792},
-{ -23473, -16729, -5782, 5643, 2636, 4940},
-{ -1724, 4388, -26673, -13695, 10570, -25895},
-{ 15358, -19496, 26242, -18493, 1736, 8054},
-{ 5684, 20890, 4091, -19100, -14588, -10468},
-{ 17260, -16291, 14859, -17711, -19174, 12435},
-{ -27185, -12573, 6743, -562, 976, -257},
-{ 12395, -8618, -22248, -19843, 11013, 7762},
-{ 3799, 11853, -27622, -8473, 1089, -1495},
-{ 4141, -2182, -26720, -735, -774, 1469},
-{ 3125, 13762, 4606, 29257, 18771, -9958},
-{ -17465, -9445, -17562, -2530, -6435, -3726},
-{ -1742, 4351, -6841, -19773, 9627, -10654},
-{ 7251, 3525, 10835, 5601, 25198, -23348},
-{ -10300, -17830, 631, 11640, 2044, -20878},
-{ -873, -8502, -1063, -15674, -10693, 14934},
-{ -15957, 28137, 5268, 477, -1053, 1158},
-{ -1495, -8814, -5764, -24965, 25988, 7907},
-{ -1038, -114, -2308, -1319, -6480, 1472},
-{ 4895, -17897, -25850, 5301, -188, 1581},
-{ 3200, 17225, 4346, 22101, -18543, 22028},
-{ -10250, 545, -10932, 2276, -28070, 8118},
-{ 15343, 2329, 9316, 20537, 14908, 21021},
-{ 6329, 6130, -24508, 837, -8637, -5844},
-{ 7386, -501, 10503, 20131, 11435, -4755},
-{ -2745, 24174, -9274, 15273, -8389, -5835},
-{ 2992, -2864, 6048, -7473, 11687, -19996},
-{ -883, -11954, -9976, -21829, -4436, -27178},
-{ 3458, 19626, 1280, 2597, 19849, 5255},
-{ -5315, 19133, -14518, -8946, 13749, -1352},
-{ 18642, 17655, 11001, 6817, -18418, 6336},
-{ -1697, 2244, -4640, 3948, -12890, -5273},
-{ 20428, 10542, 4170, -1012, 19439, 21691},
-{ -2943, -19735, -4208, 1320, 909, -8897},
-{ 9351, -8066, -2618, -12933, 26582, 3507},
-{ 9705, -22628, 8311, 8167, -13293, 5608},
-{ 3222, 3749, -1508, 165, -52, -196},
-{ 102, -22744, -8832, 903, -11421, -14662},
-{ -120, 5998, 19765, 13401, 3628, 5197},
-{ 8528, 5827, -1066, 774, -39, -166},
-{ 9411, -9476, 9581, -13004, 24456, 24900},
-{ 17878, 2235, -21639, 20478, 4716, -7190},
-{ -2482, 9511, 1611, -21943, 14230, -1289},
-{ 9288, -2291, 23215, -3452, -10842, 11},
-{ 9496, 3041, 5130, -3890, -21219, -22589},
-{ 14262, -9838, 20195, 14019, 91, -17200},
-{ -18591, 980, 17, 821, 120, -574},
-{ 12285, -19269, 13742, 16373, -161, 6025},
-{ -3364, 1530, -4005, 2454, -10872, -23839},
-{ 105, 5085, -260, 5790, -588, 19170},
-{ 4121, 4169, 13439, 14644, 20899, 7434},
-{ -175, 13101, -3704, 23233, 3907, 10106},
-{ -6101, 23467, 5204, -1341, 1599, 13174},
-{ -3217, -3494, 15117, -8387, -11762, -4750},
-{ 1146, 4675, -19378, 14917, -5091, 249},
-{ -21506, 10136, -16473, -13305, 18382, -8601},
-{ 628, 2447, 3344, 3130, -5115, 119},
-{ 17900, -22422, -17633, 21967, -16293, -7676},
-{ 16863, 24214, 5612, -3858, -809, 3822},
-{ -2291, 10091, -2360, -25109, -1226, 312},
-{ 2957, 11256, 26745, -13266, -3455, -1128},
-{ -19762, -2708, 4604, 6355, 1638, 25501},
-{ -19593, -7753, 3159, -85, -489, -1855},
-{ 814, 12510, 19077, -4681, -2610, -1474},
-{ -23408, -19027, 8137, 19878, 7912, -282},
-{ 839, -19652, 11927, 27278, -3211, 2266},
-{ 4020, -1110, 8226, -1274, 20922, 25060},
-{ 26576, 325, -8693, -232, -2218, -699},
-{ -11293, -4200, 1805, -6673, -22940, -1339},
-{ -2005, -15886, -1047, -27687, -13235, 14370},
-{ -22073, 1949, 13175, -15656, -1846, 8055},
-{ 3039, 12025, 7132, -24632, 413, -2347},
-{ -24048, -206, 12459, -6654, -417, -10091},
-{ 18179, -23688, -20515, -16396, 7230, 763},
-{ 5659, -5085, 13878, -23729, -11077, -19587},
-{ 11340, 501, 25040, 7616, -19658, 1605},
-{ -26650, 8878, 10544, 417, 1299, 261},
-{ 14460, 11369, -3263, 9990, 8194, 18111},
-{ 1355, -20838, -9196, -16060, -8559, -730},
-{ -1918, -20937, -18293, -2461, -2651, 4316},
-{ -2810, 24521, -10996, -25721, 308, -1234},
-{ -9075, -17280, -1833, -29342, -24213, -16631},
-{ -2843, 10165, -5339, -2888, 21858, -21340},
-{ -15832, 14849, -23780, 5184, 10113, -20639},
-{ -19535, -11361, 8413, 1486, -23658, -5759},
-{ -7512, 1027, -20794, 13732, 19892, -21934},
-{ -12132, -7022, -19175, -8840, 22125, -16490},
-{ 1937, 5210, -6318, -23788, 13141, 11082},
-{ -205, 6036, -380, 8658, -233, 28020},
-{ -5523, 7477, 7635, 23595, 9763, -2590},
-{ 21658, -28313, -3086, -300, -1032, 1744},
-{ -22352, 16646, 208, 6665, -17400, -3028},
-{ 18482, 9336, -2737, -19372, 407, -4389},
-{ -4913, -17370, 18819, -17654, 13416, 15232},
-{ 7749, 6368, 23135, -18174, 7584, -4248},
-{ -1489, -6523, 586, -10157, 14964, 25568},
-{ 3844, -6156, 4897, -13045, -22526, 5647},
-{ -8491, -2105, -24774, 905, -9326, 1456},
-{ -3040, -1476, 1166, -4428, 11236, 9204},
-{ 3397, -1451, 13598, -15841, 24540, 5819},
-{ 8483, -2993, 21547, -16916, 7741, 24018},
-{ -14932, -23758, -5332, -6664, -4497, 13267},
-{ 19379, 12916, -2142, -737, 21100, -22101},
-{ 3393, -4629, 5735, -18913, -6969, 2687},
-{ 1148, -16147, -21433, -28095, -630, -14449},
-{ 7300, 672, 18530, -17452, -10149, 351},
-{ 11356, -10974, 17212, 4624, 145, 17791},
-{ -711, -3479, -2238, 15887, 2027, 0},
-{ -28048, 1794, -593, -2758, -21852, 11535},
-{ -19683, 4937, 22004, 21523, -3148, 1790},
-{ 813, 8231, 2633, 11981, -3043, 22201},
-{ 8952, -24760, -690, 14873, -2366, -5372},
-{ 8406, -5439, -274, -642, -145, 778},
-{ -6605, 7258, 20780, -23507, -18625, 22782},
-{ -22896, -25488, 10020, -1614, 1508, -1393},
-{ 7607, 407, -24678, -16385, -1804, -4699},
-{ -10592, -19139, 10462, -3747, 8721, -6919},
-{ 13010, 5292, -6230, -4884, -20904, -1797},
-{ 16891, -13770, -465, 19343, -10741, -12959},
-{ 25193, -14799, -5681, -521, -321, -1211},
-{ 6917, -3093, 20183, -26903, -12026, 1295},
-{ 305, 1992, 19457, -985, 25, -521},
-{ 6707, -3698, 8365, -8687, 21921, -27166},
-{ 4668, 5997, 7117, 11696, 24401, -10794},
-{ 744, -9416, 19893, 1963, 7922, -9824},
-{ 3430, 21282, -1736, 10844, 8821, 27015},
-{ -8813, 1521, -24038, 1651, 7838, -1208},
-{ 3911, -11221, 3273, -12541, 7168, 18402},
-{ 21642, 9117, -11536, -5256, 7077, 2382},
-{ 100, 3817, -6713, 1244, 1518, -321},
-{ 7946, -18670, 10667, -4866, 727, 776},
-{ -15883, -8150, -2087, 22739, 1567, -3482},
-{ 4380, -2735, 8469, -7025, -11424, 1317},
-{ 26970, 4393, 7665, 17561, -714, 650},
-{ -16191, -835, 8365, 1795, -14314, 16297},
-{ 4504, -10048, 7662, -26690, -17428, 2580},
-{ 48, -3984, 564, -5871, 2658, -18658},
-{ 12579, -26016, -15642, 2672, -1347, -887},
-{ -4950, 4208, -6811, 2569, -20621, -8658},
-{ -1836, -14818, -5571, -23322, -14800, 25867},
-{ 5434, -28139, -2357, -2883, -570, 2431},
-{ 13096, -2771, 24994, -12496, -24723, -1025},
-{ -5676, -4339, 1908, 18628, -21323, 17366},
-{ 27660, -27897, -15409, 1436, -7112, -2241},
-{ 8019, 3847, 24568, -469, 9674, 10683},
-{ -903, -10149, 1801, -21260, 4795, -8751},
-{ 1122, -9582, 2625, 22791, 956, 882},
-{ 7876, 19075, -9900, -24266, 7496, 9277},
-{ 980, -26764, -5386, 5396, 1086, 1648},
-{ 28838, -1270, -447, 5, -429, -20},
-{ -15283, 6132, 22812, 1252, -9963, 511},
-{ 851, 7925, -457, -12210, 4261, 7579},
-{ -4530, 8452, -1246, 14501, -24951, -5760},
-{ -17814, -10727, 9887, -23929, -13432, 1878},
-{ -15049, 10165, 16491, -14603, -11712, -21156},
-{ -3317, 840, -5683, 22413, 1994, 586},
-{ 23158, -5788, -15043, -10372, -9271, -13523},
-{ -773, -9509, -3993, -24264, 8463, 5804},
-{ -8545, -703, -12440, -3985, -25122, -28147},
-{ -16659, 16001, 2746, 1611, 5097, -1043},
-{ 41, -7181, 19903, 31555, -32237, 13927},
-{ -5658, 845, -12774, 5705, 16695, -86},
-{ 5282, 14875, 27026, 21124, 15776, -10477},
-{ 14712, 19648, -11487, -13361, -20196, -15229},
-{ 8597, -9138, -626, 10891, -6015, 6346},
-{ -1488, -1272, -1479, -1303, -3704, -5485},
-{ -3370, 17871, -6604, 24930, 25886, -3127},
-{ 8416, 27783, -1385, 5350, -4260, 19993},
-{ 5688, 362, 17246, 3809, -3246, 1088},
-{ -105, -29607, 2747, 15223, -167, 3722},
-{ 3502, -3195, 8602, 7772, -1566, -915},
-{ -491, 3257, -2423, 5522, 20606, -100},
-{ -13948, -11368, -15375, -21866, -8520, 12221},
-{ -616, 2424, -2023, 4398, -3805, 8108},
-{ -7204, 21043, 21211, -9395, -19391, 896},
-{ -5737, -15160, -21298, 17066, -1006, -366},
-{ 6261, 3240, -11937, -16213, -15820, 6581},
-{ -3155, 24796, 2733, -1257, -875, -1597},
-{ -20469, 11094, 24071, -8987, 14136, 2220},
-{ -14106, 11959, -22495, 4135, -1055, -5420},
-{ 801, -2655, 60, -5324, -790, 5937},
-{ -7372, -1764, -22433, -26060, 21707, 4178},
-{ -5715, -6648, -14908, 1325, -24044, 1493},
-{ -6024, -12488, 23930, 2950, 1601, 1173},
-{ 19067, 17630, 17929, -10654, 10928, -4958},
-{ 3231, -3284, 27336, 4174, -1683, 497},
-};
-
-const int16_t (* const ff_eac3_mantissa_vq[8])[6] = {
- NULL,
- vq_hebap1,
- vq_hebap2,
- vq_hebap3,
- vq_hebap4,
- vq_hebap5,
- vq_hebap6,
- vq_hebap7,
-};
-
-/**
- * Table E2.14 Frame Exponent Strategy Combinations
- */
-const uint8_t ff_eac3_frm_expstr[32][6] = {
-{ EXP_D15, EXP_REUSE, EXP_REUSE, EXP_REUSE, EXP_REUSE, EXP_REUSE},
-{ EXP_D15, EXP_REUSE, EXP_REUSE, EXP_REUSE, EXP_REUSE, EXP_D45},
-{ EXP_D15, EXP_REUSE, EXP_REUSE, EXP_REUSE, EXP_D25, EXP_REUSE},
-{ EXP_D15, EXP_REUSE, EXP_REUSE, EXP_REUSE, EXP_D45, EXP_D45},
-{ EXP_D25, EXP_REUSE, EXP_REUSE, EXP_D25, EXP_REUSE, EXP_REUSE},
-{ EXP_D25, EXP_REUSE, EXP_REUSE, EXP_D25, EXP_REUSE, EXP_D45},
-{ EXP_D25, EXP_REUSE, EXP_REUSE, EXP_D45, EXP_D25, EXP_REUSE},
-{ EXP_D25, EXP_REUSE, EXP_REUSE, EXP_D45, EXP_D45, EXP_D45},
-{ EXP_D25, EXP_REUSE, EXP_D15, EXP_REUSE, EXP_REUSE, EXP_REUSE},
-{ EXP_D25, EXP_REUSE, EXP_D25, EXP_REUSE, EXP_REUSE, EXP_D45},
-{ EXP_D25, EXP_REUSE, EXP_D25, EXP_REUSE, EXP_D25, EXP_REUSE},
-{ EXP_D25, EXP_REUSE, EXP_D25, EXP_REUSE, EXP_D45, EXP_D45},
-{ EXP_D25, EXP_REUSE, EXP_D45, EXP_D25, EXP_REUSE, EXP_REUSE},
-{ EXP_D25, EXP_REUSE, EXP_D45, EXP_D25, EXP_REUSE, EXP_D45},
-{ EXP_D25, EXP_REUSE, EXP_D45, EXP_D45, EXP_D25, EXP_REUSE},
-{ EXP_D25, EXP_REUSE, EXP_D45, EXP_D45, EXP_D45, EXP_D45},
-{ EXP_D45, EXP_D15, EXP_REUSE, EXP_REUSE, EXP_REUSE, EXP_REUSE},
-{ EXP_D45, EXP_D15, EXP_REUSE, EXP_REUSE, EXP_REUSE, EXP_D45},
-{ EXP_D45, EXP_D25, EXP_REUSE, EXP_REUSE, EXP_D25, EXP_REUSE},
-{ EXP_D45, EXP_D25, EXP_REUSE, EXP_REUSE, EXP_D45, EXP_D45},
-{ EXP_D45, EXP_D25, EXP_REUSE, EXP_D25, EXP_REUSE, EXP_REUSE},
-{ EXP_D45, EXP_D25, EXP_REUSE, EXP_D25, EXP_REUSE, EXP_D45},
-{ EXP_D45, EXP_D25, EXP_REUSE, EXP_D45, EXP_D25, EXP_REUSE},
-{ EXP_D45, EXP_D25, EXP_REUSE, EXP_D45, EXP_D45, EXP_D45},
-{ EXP_D45, EXP_D45, EXP_D15, EXP_REUSE, EXP_REUSE, EXP_REUSE},
-{ EXP_D45, EXP_D45, EXP_D25, EXP_REUSE, EXP_REUSE, EXP_D45},
-{ EXP_D45, EXP_D45, EXP_D25, EXP_REUSE, EXP_D25, EXP_REUSE},
-{ EXP_D45, EXP_D45, EXP_D25, EXP_REUSE, EXP_D45, EXP_D45},
-{ EXP_D45, EXP_D45, EXP_D45, EXP_D25, EXP_REUSE, EXP_REUSE},
-{ EXP_D45, EXP_D45, EXP_D45, EXP_D25, EXP_REUSE, EXP_D45},
-{ EXP_D45, EXP_D45, EXP_D45, EXP_D45, EXP_D25, EXP_REUSE},
-{ EXP_D45, EXP_D45, EXP_D45, EXP_D45, EXP_D45, EXP_D45},
-};
-
-/**
- * Table E.25: Spectral Extension Attenuation Table
- * ff_eac3_spx_atten_tab[code][bin]=pow(2.0,(bin+1)*(code+1)/-15.0);
- */
-const float ff_eac3_spx_atten_tab[32][3] = {
- { 0.954841603910416503f, 0.911722488558216804f, 0.870550563296124125f },
- { 0.911722488558216804f, 0.831237896142787758f, 0.757858283255198995f },
- { 0.870550563296124125f, 0.757858283255198995f, 0.659753955386447100f },
- { 0.831237896142787758f, 0.690956439983888004f, 0.574349177498517438f },
- { 0.793700525984099792f, 0.629960524947436595f, 0.500000000000000000f },
- { 0.757858283255198995f, 0.574349177498517438f, 0.435275281648062062f },
- { 0.723634618720189082f, 0.523647061410313364f, 0.378929141627599553f },
- { 0.690956439983888004f, 0.477420801955208307f, 0.329876977693223550f },
- { 0.659753955386447100f, 0.435275281648062062f, 0.287174588749258719f },
- { 0.629960524947436595f, 0.396850262992049896f, 0.250000000000000000f },
- { 0.601512518041058319f, 0.361817309360094541f, 0.217637640824031003f },
- { 0.574349177498517438f, 0.329876977693223550f, 0.189464570813799776f },
- { 0.548412489847312945f, 0.300756259020529160f, 0.164938488846611775f },
- { 0.523647061410313364f, 0.274206244923656473f, 0.143587294374629387f },
- { 0.500000000000000000f, 0.250000000000000000f, 0.125000000000000000f },
- { 0.477420801955208307f, 0.227930622139554201f, 0.108818820412015502f },
- { 0.455861244279108402f, 0.207809474035696939f, 0.094732285406899888f },
- { 0.435275281648062062f, 0.189464570813799776f, 0.082469244423305887f },
- { 0.415618948071393879f, 0.172739109995972029f, 0.071793647187314694f },
- { 0.396850262992049896f, 0.157490131236859149f, 0.062500000000000000f },
- { 0.378929141627599553f, 0.143587294374629387f, 0.054409410206007751f },
- { 0.361817309360094541f, 0.130911765352578369f, 0.047366142703449930f },
- { 0.345478219991944002f, 0.119355200488802049f, 0.041234622211652958f },
- { 0.329876977693223550f, 0.108818820412015502f, 0.035896823593657347f },
- { 0.314980262473718298f, 0.099212565748012460f, 0.031250000000000000f },
- { 0.300756259020529160f, 0.090454327340023621f, 0.027204705103003875f },
- { 0.287174588749258719f, 0.082469244423305887f, 0.023683071351724965f },
- { 0.274206244923656473f, 0.075189064755132290f, 0.020617311105826479f },
- { 0.261823530705156682f, 0.068551561230914118f, 0.017948411796828673f },
- { 0.250000000000000000f, 0.062500000000000000f, 0.015625000000000000f },
- { 0.238710400977604098f, 0.056982655534888536f, 0.013602352551501938f },
- { 0.227930622139554201f, 0.051952368508924235f, 0.011841535675862483f }
-};
diff --git a/libavcodec/eac3_data.h b/libavcodec/eac3_data.h
deleted file mode 100644
index 10a67f1..0000000
--- a/libavcodec/eac3_data.h
+++ b/dev/null
@@ -1,36 +0,0 @@
-/*
- * E-AC-3 tables
- * Copyright (c) 2007 Bartlomiej Wolowiec <bartek.wolowiec@gmail.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
- */
-
-#ifndef AVCODEC_EAC3_DATA_H
-#define AVCODEC_EAC3_DATA_H
-
-#include <stdint.h>
-
-extern const uint8_t ff_eac3_bits_vs_hebap[20];
-extern const int16_t ff_eac3_gaq_remap_1[12];
-extern const int16_t ff_eac3_gaq_remap_2_4_a[9][2];
-extern const int16_t ff_eac3_gaq_remap_2_4_b[9][2];
-
-extern const int16_t (* const ff_eac3_mantissa_vq[8])[6];
-extern const uint8_t ff_eac3_frm_expstr[32][6];
-extern const float ff_eac3_spx_atten_tab[32][3];
-
-#endif /* AVCODEC_EAC3_DATA_H */
diff --git a/libavcodec/eac3dec.c b/libavcodec/eac3dec.c
deleted file mode 100644
index b55ee2a..0000000
--- a/libavcodec/eac3dec.c
+++ b/dev/null
@@ -1,607 +0,0 @@
-/*
- * E-AC-3 decoder
- * Copyright (c) 2007 Bartlomiej Wolowiec <bartek.wolowiec@gmail.com>
- * Copyright (c) 2008 Justin Ruggles
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * There are several features of E-AC-3 that this decoder does not yet support.
- *
- * Enhanced Coupling
- * No known samples exist. If any ever surface, this feature should not be
- * too difficult to implement.
- *
- * Reduced Sample Rates
- * No known samples exist. The spec also does not give clear information
- * on how this is to be implemented.
- *
- * Dependent Streams
- * Only the independent stream is currently decoded. Any dependent
- * streams are skipped. We have only come across two examples of this, and
- * they are both just test streams, one for HD-DVD and the other for
- * Blu-ray.
- *
- * Transient Pre-noise Processing
- * This is side information which a decoder should use to reduce artifacts
- * caused by transients. There are samples which are known to have this
- * information, but this decoder currently ignores it.
- */
-
-
-#include "avcodec.h"
-#include "internal.h"
-#include "aac_ac3_parser.h"
-#include "ac3.h"
-#include "ac3_parser.h"
-#include "ac3dec.h"
-#include "ac3dec_data.h"
-#include "eac3_data.h"
-
-/** gain adaptive quantization mode */
-typedef enum {
- EAC3_GAQ_NO =0,
- EAC3_GAQ_12,
- EAC3_GAQ_14,
- EAC3_GAQ_124
-} EAC3GaqMode;
-
-#define EAC3_SR_CODE_REDUCED 3
-
-void ff_eac3_apply_spectral_extension(AC3DecodeContext *s)
-{
- int bin, bnd, ch, i;
- uint8_t wrapflag[SPX_MAX_BANDS]={1,0,}, num_copy_sections, copy_sizes[SPX_MAX_BANDS];
- float rms_energy[SPX_MAX_BANDS];
-
- /* Set copy index mapping table. Set wrap flags to apply a notch filter at
- wrap points later on. */
- bin = s->spx_dst_start_freq;
- num_copy_sections = 0;
- for (bnd = 0; bnd < s->num_spx_bands; bnd++) {
- int copysize;
- int bandsize = s->spx_band_sizes[bnd];
- if (bin + bandsize > s->spx_src_start_freq) {
- copy_sizes[num_copy_sections++] = bin - s->spx_dst_start_freq;
- bin = s->spx_dst_start_freq;
- wrapflag[bnd] = 1;
- }
- for (i = 0; i < bandsize; i += copysize) {
- if (bin == s->spx_src_start_freq) {
- copy_sizes[num_copy_sections++] = bin - s->spx_dst_start_freq;
- bin = s->spx_dst_start_freq;
- }
- copysize = FFMIN(bandsize - i, s->spx_src_start_freq - bin);
- bin += copysize;
- }
- }
- copy_sizes[num_copy_sections++] = bin - s->spx_dst_start_freq;
-
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- if (!s->channel_uses_spx[ch])
- continue;
-
- /* Copy coeffs from normal bands to extension bands */
- bin = s->spx_src_start_freq;
- for (i = 0; i < num_copy_sections; i++) {
- memcpy(&s->transform_coeffs[ch][bin],
- &s->transform_coeffs[ch][s->spx_dst_start_freq],
- copy_sizes[i]*sizeof(float));
- bin += copy_sizes[i];
- }
-
- /* Calculate RMS energy for each SPX band. */
- bin = s->spx_src_start_freq;
- for (bnd = 0; bnd < s->num_spx_bands; bnd++) {
- int bandsize = s->spx_band_sizes[bnd];
- float accum = 0.0f;
- for (i = 0; i < bandsize; i++) {
- float coeff = s->transform_coeffs[ch][bin++];
- accum += coeff * coeff;
- }
- rms_energy[bnd] = sqrtf(accum / bandsize);
- }
-
- /* Apply a notch filter at transitions between normal and extension
- bands and at all wrap points. */
- if (s->spx_atten_code[ch] >= 0) {
- const float *atten_tab = ff_eac3_spx_atten_tab[s->spx_atten_code[ch]];
- bin = s->spx_src_start_freq - 2;
- for (bnd = 0; bnd < s->num_spx_bands; bnd++) {
- if (wrapflag[bnd]) {
- float *coeffs = &s->transform_coeffs[ch][bin];
- coeffs[0] *= atten_tab[0];
- coeffs[1] *= atten_tab[1];
- coeffs[2] *= atten_tab[2];
- coeffs[3] *= atten_tab[1];
- coeffs[4] *= atten_tab[0];
- }
- bin += s->spx_band_sizes[bnd];
- }
- }
-
- /* Apply noise-blended coefficient scaling based on previously
- calculated RMS energy, blending factors, and SPX coordinates for
- each band. */
- bin = s->spx_src_start_freq;
- for (bnd = 0; bnd < s->num_spx_bands; bnd++) {
- float nscale = s->spx_noise_blend[ch][bnd] * rms_energy[bnd] * (1.0f / INT32_MIN);
- float sscale = s->spx_signal_blend[ch][bnd];
- for (i = 0; i < s->spx_band_sizes[bnd]; i++) {
- float noise = nscale * (int32_t)av_lfg_get(&s->dith_state);
- s->transform_coeffs[ch][bin] *= sscale;
- s->transform_coeffs[ch][bin++] += noise;
- }
- }
- }
-}
-
-
-/** lrint(M_SQRT2*cos(2*M_PI/12)*(1<<23)) */
-#define COEFF_0 10273905LL
-
-/** lrint(M_SQRT2*cos(0*M_PI/12)*(1<<23)) = lrint(M_SQRT2*(1<<23)) */
-#define COEFF_1 11863283LL
-
-/** lrint(M_SQRT2*cos(5*M_PI/12)*(1<<23)) */
-#define COEFF_2 3070444LL
-
-/**
- * Calculate 6-point IDCT of the pre-mantissas.
- * All calculations are 24-bit fixed-point.
- */
-static void idct6(int pre_mant[6])
-{
- int tmp;
- int even0, even1, even2, odd0, odd1, odd2;
-
- odd1 = pre_mant[1] - pre_mant[3] - pre_mant[5];
-
- even2 = ( pre_mant[2] * COEFF_0) >> 23;
- tmp = ( pre_mant[4] * COEFF_1) >> 23;
- odd0 = ((pre_mant[1] + pre_mant[5]) * COEFF_2) >> 23;
-
- even0 = pre_mant[0] + (tmp >> 1);
- even1 = pre_mant[0] - tmp;
-
- tmp = even0;
- even0 = tmp + even2;
- even2 = tmp - even2;
-
- tmp = odd0;
- odd0 = tmp + pre_mant[1] + pre_mant[3];
- odd2 = tmp + pre_mant[5] - pre_mant[3];
-
- pre_mant[0] = even0 + odd0;
- pre_mant[1] = even1 + odd1;
- pre_mant[2] = even2 + odd2;
- pre_mant[3] = even2 - odd2;
- pre_mant[4] = even1 - odd1;
- pre_mant[5] = even0 - odd0;
-}
-
-void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch)
-{
- int bin, blk, gs;
- int end_bap, gaq_mode;
- GetBitContext *gbc = &s->gbc;
- int gaq_gain[AC3_MAX_COEFS];
-
- gaq_mode = get_bits(gbc, 2);
- end_bap = (gaq_mode < 2) ? 12 : 17;
-
- /* if GAQ gain is used, decode gain codes for bins with hebap between
- 8 and end_bap */
- gs = 0;
- if (gaq_mode == EAC3_GAQ_12 || gaq_mode == EAC3_GAQ_14) {
- /* read 1-bit GAQ gain codes */
- for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {
- if (s->bap[ch][bin] > 7 && s->bap[ch][bin] < end_bap)
- gaq_gain[gs++] = get_bits1(gbc) << (gaq_mode-1);
- }
- } else if (gaq_mode == EAC3_GAQ_124) {
- /* read 1.67-bit GAQ gain codes (3 codes in 5 bits) */
- int gc = 2;
- for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {
- if (s->bap[ch][bin] > 7 && s->bap[ch][bin] < 17) {
- if (gc++ == 2) {
- int group_code = get_bits(gbc, 5);
- if (group_code > 26) {
- av_log(s->avctx, AV_LOG_WARNING, "GAQ gain group code out-of-range\n");
- group_code = 26;
- }
- gaq_gain[gs++] = ff_ac3_ungroup_3_in_5_bits_tab[group_code][0];
- gaq_gain[gs++] = ff_ac3_ungroup_3_in_5_bits_tab[group_code][1];
- gaq_gain[gs++] = ff_ac3_ungroup_3_in_5_bits_tab[group_code][2];
- gc = 0;
- }
- }
- }
- }
-
- gs=0;
- for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {
- int hebap = s->bap[ch][bin];
- int bits = ff_eac3_bits_vs_hebap[hebap];
- if (!hebap) {
- /* zero-mantissa dithering */
- for (blk = 0; blk < 6; blk++) {
- s->pre_mantissa[ch][bin][blk] = (av_lfg_get(&s->dith_state) & 0x7FFFFF) - 0x400000;
- }
- } else if (hebap < 8) {
- /* Vector Quantization */
- int v = get_bits(gbc, bits);
- for (blk = 0; blk < 6; blk++) {
- s->pre_mantissa[ch][bin][blk] = ff_eac3_mantissa_vq[hebap][v][blk] << 8;
- }
- } else {
- /* Gain Adaptive Quantization */
- int gbits, log_gain;
- if (gaq_mode != EAC3_GAQ_NO && hebap < end_bap) {
- log_gain = gaq_gain[gs++];
- } else {
- log_gain = 0;
- }
- gbits = bits - log_gain;
-
- for (blk = 0; blk < 6; blk++) {
- int mant = get_sbits(gbc, gbits);
- if (log_gain && mant == -(1 << (gbits-1))) {
- /* large mantissa */
- int b;
- int mbits = bits - (2 - log_gain);
- mant = get_sbits(gbc, mbits);
- mant <<= (23 - (mbits - 1));
- /* remap mantissa value to correct for asymmetric quantization */
- if (mant >= 0)
- b = 1 << (23 - log_gain);
- else
- b = ff_eac3_gaq_remap_2_4_b[hebap-8][log_gain-1] << 8;
- mant += ((ff_eac3_gaq_remap_2_4_a[hebap-8][log_gain-1] * (int64_t)mant) >> 15) + b;
- } else {
- /* small mantissa, no GAQ, or Gk=1 */
- mant <<= 24 - bits;
- if (!log_gain) {
- /* remap mantissa value for no GAQ or Gk=1 */
- mant += (ff_eac3_gaq_remap_1[hebap-8] * (int64_t)mant) >> 15;
- }
- }
- s->pre_mantissa[ch][bin][blk] = mant;
- }
- }
- idct6(s->pre_mantissa[ch][bin]);
- }
-}
-
-int ff_eac3_parse_header(AC3DecodeContext *s)
-{
- int i, blk, ch;
- int ac3_exponent_strategy, parse_aht_info, parse_spx_atten_data;
- int parse_transient_proc_info;
- int num_cpl_blocks;
- GetBitContext *gbc = &s->gbc;
-
- /* An E-AC-3 stream can have multiple independent streams which the
- application can select from. each independent stream can also contain
- dependent streams which are used to add or replace channels. */
- if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) {
- avpriv_request_sample(s->avctx, "Dependent substream decoding");
- return AAC_AC3_PARSE_ERROR_FRAME_TYPE;
- } else if (s->frame_type == EAC3_FRAME_TYPE_RESERVED) {
- av_log(s->avctx, AV_LOG_ERROR, "Reserved frame type\n");
- return AAC_AC3_PARSE_ERROR_FRAME_TYPE;
- }
-
- /* The substream id indicates which substream this frame belongs to. each
- independent stream has its own substream id, and the dependent streams
- associated to an independent stream have matching substream id's. */
- if (s->substreamid) {
- /* only decode substream with id=0. skip any additional substreams. */
- avpriv_request_sample(s->avctx, "Additional substreams");
- return AAC_AC3_PARSE_ERROR_FRAME_TYPE;
- }
-
- if (s->bit_alloc_params.sr_code == EAC3_SR_CODE_REDUCED) {
- /* The E-AC-3 specification does not tell how to handle reduced sample
- rates in bit allocation. The best assumption would be that it is
- handled like AC-3 DolbyNet, but we cannot be sure until we have a
- sample which utilizes this feature. */
- avpriv_request_sample(s->avctx, "Reduced sampling rate");
- return AVERROR_PATCHWELCOME;
- }
- skip_bits(gbc, 5); // skip bitstream id
-
- /* volume control params */
- for (i = 0; i < (s->channel_mode ? 1 : 2); i++) {
- skip_bits(gbc, 5); // skip dialog normalization
- if (get_bits1(gbc)) {
- skip_bits(gbc, 8); // skip compression gain word
- }
- }
-
- /* dependent stream channel map */
- if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) {
- if (get_bits1(gbc)) {
- skip_bits(gbc, 16); // skip custom channel map
- }
- }
-
- /* mixing metadata */
- if (get_bits1(gbc)) {
- /* center and surround mix levels */
- if (s->channel_mode > AC3_CHMODE_STEREO) {
- skip_bits(gbc, 2); // skip preferred stereo downmix mode
- if (s->channel_mode & 1) {
- /* if three front channels exist */
- skip_bits(gbc, 3); //skip Lt/Rt center mix level
- s->center_mix_level = get_bits(gbc, 3);
- }
- if (s->channel_mode & 4) {
- /* if a surround channel exists */
- skip_bits(gbc, 3); //skip Lt/Rt surround mix level
- s->surround_mix_level = get_bits(gbc, 3);
- }
- }
-
- /* lfe mix level */
- if (s->lfe_on && get_bits1(gbc)) {
- // TODO: use LFE mix level
- skip_bits(gbc, 5); // skip LFE mix level code
- }
-
- /* info for mixing with other streams and substreams */
- if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT) {
- for (i = 0; i < (s->channel_mode ? 1 : 2); i++) {
- // TODO: apply program scale factor
- if (get_bits1(gbc)) {
- skip_bits(gbc, 6); // skip program scale factor
- }
- }
- if (get_bits1(gbc)) {
- skip_bits(gbc, 6); // skip external program scale factor
- }
- /* skip mixing parameter data */
- switch(get_bits(gbc, 2)) {
- case 1: skip_bits(gbc, 5); break;
- case 2: skip_bits(gbc, 12); break;
- case 3: {
- int mix_data_size = (get_bits(gbc, 5) + 2) << 3;
- skip_bits_long(gbc, mix_data_size);
- break;
- }
- }
- /* skip pan information for mono or dual mono source */
- if (s->channel_mode < AC3_CHMODE_STEREO) {
- for (i = 0; i < (s->channel_mode ? 1 : 2); i++) {
- if (get_bits1(gbc)) {
- /* note: this is not in the ATSC A/52B specification
- reference: ETSI TS 102 366 V1.1.1
- section: E.1.3.1.25 */
- skip_bits(gbc, 8); // skip pan mean direction index
- skip_bits(gbc, 6); // skip reserved paninfo bits
- }
- }
- }
- /* skip mixing configuration information */
- if (get_bits1(gbc)) {
- for (blk = 0; blk < s->num_blocks; blk++) {
- if (s->num_blocks == 1 || get_bits1(gbc)) {
- skip_bits(gbc, 5);
- }
- }
- }
- }
- }
-
- /* informational metadata */
- if (get_bits1(gbc)) {
- s->bitstream_mode = get_bits(gbc, 3);
- skip_bits(gbc, 2); // skip copyright bit and original bitstream bit
- if (s->channel_mode == AC3_CHMODE_STEREO) {
- skip_bits(gbc, 4); // skip Dolby surround and headphone mode
- }
- if (s->channel_mode >= AC3_CHMODE_2F2R) {
- skip_bits(gbc, 2); // skip Dolby surround EX mode
- }
- for (i = 0; i < (s->channel_mode ? 1 : 2); i++) {
- if (get_bits1(gbc)) {
- skip_bits(gbc, 8); // skip mix level, room type, and A/D converter type
- }
- }
- if (s->bit_alloc_params.sr_code != EAC3_SR_CODE_REDUCED) {
- skip_bits1(gbc); // skip source sample rate code
- }
- }
-
- /* converter synchronization flag
- If frames are less than six blocks, this bit should be turned on
- once every 6 blocks to indicate the start of a frame set.
- reference: RFC 4598, Section 2.1.3 Frame Sets */
- if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT && s->num_blocks != 6) {
- skip_bits1(gbc); // skip converter synchronization flag
- }
-
- /* original frame size code if this stream was converted from AC-3 */
- if (s->frame_type == EAC3_FRAME_TYPE_AC3_CONVERT &&
- (s->num_blocks == 6 || get_bits1(gbc))) {
- skip_bits(gbc, 6); // skip frame size code
- }
-
- /* additional bitstream info */
- if (get_bits1(gbc)) {
- int addbsil = get_bits(gbc, 6);
- for (i = 0; i < addbsil + 1; i++) {
- skip_bits(gbc, 8); // skip additional bit stream info
- }
- }
-
- /* audio frame syntax flags, strategy data, and per-frame data */
-
- if (s->num_blocks == 6) {
- ac3_exponent_strategy = get_bits1(gbc);
- parse_aht_info = get_bits1(gbc);
- } else {
- /* less than 6 blocks, so use AC-3-style exponent strategy syntax, and
- do not use AHT */
- ac3_exponent_strategy = 1;
- parse_aht_info = 0;
- }
-
- s->snr_offset_strategy = get_bits(gbc, 2);
- parse_transient_proc_info = get_bits1(gbc);
-
- s->block_switch_syntax = get_bits1(gbc);
- if (!s->block_switch_syntax)
- memset(s->block_switch, 0, sizeof(s->block_switch));
-
- s->dither_flag_syntax = get_bits1(gbc);
- if (!s->dither_flag_syntax) {
- for (ch = 1; ch <= s->fbw_channels; ch++)
- s->dither_flag[ch] = 1;
- }
- s->dither_flag[CPL_CH] = s->dither_flag[s->lfe_ch] = 0;
-
- s->bit_allocation_syntax = get_bits1(gbc);
- if (!s->bit_allocation_syntax) {
- /* set default bit allocation parameters */
- s->bit_alloc_params.slow_decay = ff_ac3_slow_decay_tab[2];
- s->bit_alloc_params.fast_decay = ff_ac3_fast_decay_tab[1];
- s->bit_alloc_params.slow_gain = ff_ac3_slow_gain_tab [1];
- s->bit_alloc_params.db_per_bit = ff_ac3_db_per_bit_tab[2];
- s->bit_alloc_params.floor = ff_ac3_floor_tab [7];
- }
-
- s->fast_gain_syntax = get_bits1(gbc);
- s->dba_syntax = get_bits1(gbc);
- s->skip_syntax = get_bits1(gbc);
- parse_spx_atten_data = get_bits1(gbc);
-
- /* coupling strategy occurrence and coupling use per block */
- num_cpl_blocks = 0;
- if (s->channel_mode > 1) {
- for (blk = 0; blk < s->num_blocks; blk++) {
- s->cpl_strategy_exists[blk] = (!blk || get_bits1(gbc));
- if (s->cpl_strategy_exists[blk]) {
- s->cpl_in_use[blk] = get_bits1(gbc);
- } else {
- s->cpl_in_use[blk] = s->cpl_in_use[blk-1];
- }
- num_cpl_blocks += s->cpl_in_use[blk];
- }
- } else {
- memset(s->cpl_in_use, 0, sizeof(s->cpl_in_use));
- }
-
- /* exponent strategy data */
- if (ac3_exponent_strategy) {
- /* AC-3-style exponent strategy syntax */
- for (blk = 0; blk < s->num_blocks; blk++) {
- for (ch = !s->cpl_in_use[blk]; ch <= s->fbw_channels; ch++) {
- s->exp_strategy[blk][ch] = get_bits(gbc, 2);
- }
- }
- } else {
- /* LUT-based exponent strategy syntax */
- for (ch = !((s->channel_mode > 1) && num_cpl_blocks); ch <= s->fbw_channels; ch++) {
- int frmchexpstr = get_bits(gbc, 5);
- for (blk = 0; blk < 6; blk++) {
- s->exp_strategy[blk][ch] = ff_eac3_frm_expstr[frmchexpstr][blk];
- }
- }
- }
- /* LFE exponent strategy */
- if (s->lfe_on) {
- for (blk = 0; blk < s->num_blocks; blk++) {
- s->exp_strategy[blk][s->lfe_ch] = get_bits1(gbc);
- }
- }
- /* original exponent strategies if this stream was converted from AC-3 */
- if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT &&
- (s->num_blocks == 6 || get_bits1(gbc))) {
- skip_bits(gbc, 5 * s->fbw_channels); // skip converter channel exponent strategy
- }
-
- /* determine which channels use AHT */
- if (parse_aht_info) {
- /* For AHT to be used, all non-zero blocks must reuse exponents from
- the first block. Furthermore, for AHT to be used in the coupling
- channel, all blocks must use coupling and use the same coupling
- strategy. */
- s->channel_uses_aht[CPL_CH]=0;
- for (ch = (num_cpl_blocks != 6); ch <= s->channels; ch++) {
- int use_aht = 1;
- for (blk = 1; blk < 6; blk++) {
- if ((s->exp_strategy[blk][ch] != EXP_REUSE) ||
- (!ch && s->cpl_strategy_exists[blk])) {
- use_aht = 0;
- break;
- }
- }
- s->channel_uses_aht[ch] = use_aht && get_bits1(gbc);
- }
- } else {
- memset(s->channel_uses_aht, 0, sizeof(s->channel_uses_aht));
- }
-
- /* per-frame SNR offset */
- if (!s->snr_offset_strategy) {
- int csnroffst = (get_bits(gbc, 6) - 15) << 4;
- int snroffst = (csnroffst + get_bits(gbc, 4)) << 2;
- for (ch = 0; ch <= s->channels; ch++)
- s->snr_offset[ch] = snroffst;
- }
-
- /* transient pre-noise processing data */
- if (parse_transient_proc_info) {
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- if (get_bits1(gbc)) { // channel in transient processing
- skip_bits(gbc, 10); // skip transient processing location
- skip_bits(gbc, 8); // skip transient processing length
- }
- }
- }
-
- /* spectral extension attenuation data */
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- if (parse_spx_atten_data && get_bits1(gbc)) {
- s->spx_atten_code[ch] = get_bits(gbc, 5);
- } else {
- s->spx_atten_code[ch] = -1;
- }
- }
-
- /* block start information */
- if (s->num_blocks > 1 && get_bits1(gbc)) {
- /* reference: Section E2.3.2.27
- nblkstrtbits = (numblks - 1) * (4 + ceiling(log2(words_per_frame)))
- The spec does not say what this data is or what it's used for.
- It is likely the offset of each block within the frame. */
- int block_start_bits = (s->num_blocks-1) * (4 + av_log2(s->frame_size-2));
- skip_bits_long(gbc, block_start_bits);
- avpriv_request_sample(s->avctx, "Block start info");
- }
-
- /* syntax state initialization */
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- s->first_spx_coords[ch] = 1;
- s->first_cpl_coords[ch] = 1;
- }
- s->first_cpl_leak = 1;
-
- return 0;
-}
diff --git a/libavcodec/eac3enc.c b/libavcodec/eac3enc.c
deleted file mode 100644
index 9944617..0000000
--- a/libavcodec/eac3enc.c
+++ b/dev/null
@@ -1,270 +0,0 @@
-/*
- * E-AC-3 encoder
- * Copyright (c) 2011 Justin Ruggles <justin.ruggles@gmail.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
- */
-
-/**
- * @file
- * E-AC-3 encoder
- */
-
-#define CONFIG_AC3ENC_FLOAT 1
-
-#include "libavutil/attributes.h"
-#include "ac3enc.h"
-#include "eac3enc.h"
-#include "eac3_data.h"
-
-
-#define AC3ENC_TYPE AC3ENC_TYPE_EAC3
-#include "ac3enc_opts_template.c"
-
-static const AVClass eac3enc_class = {
- .class_name = "E-AC-3 Encoder",
- .item_name = av_default_item_name,
- .option = ac3_options,
- .version = LIBAVUTIL_VERSION_INT,
-};
-
-/**
- * LUT for finding a matching frame exponent strategy index from a set of
- * exponent strategies for a single channel across all 6 blocks.
- */
-static int8_t eac3_frame_expstr_index_tab[3][4][4][4][4][4];
-
-
-av_cold void ff_eac3_exponent_init(void)
-{
- int i;
-
- memset(eac3_frame_expstr_index_tab, -1, sizeof(eac3_frame_expstr_index_tab));
- for (i = 0; i < 32; i++) {
- eac3_frame_expstr_index_tab[ff_eac3_frm_expstr[i][0]-1]
- [ff_eac3_frm_expstr[i][1]]
- [ff_eac3_frm_expstr[i][2]]
- [ff_eac3_frm_expstr[i][3]]
- [ff_eac3_frm_expstr[i][4]]
- [ff_eac3_frm_expstr[i][5]] = i;
- }
-}
-
-
-void ff_eac3_get_frame_exp_strategy(AC3EncodeContext *s)
-{
- int ch;
-
- if (s->num_blocks < 6) {
- s->use_frame_exp_strategy = 0;
- return;
- }
-
- s->use_frame_exp_strategy = 1;
- for (ch = !s->cpl_on; ch <= s->fbw_channels; ch++) {
- int expstr = eac3_frame_expstr_index_tab[s->exp_strategy[ch][0]-1]
- [s->exp_strategy[ch][1]]
- [s->exp_strategy[ch][2]]
- [s->exp_strategy[ch][3]]
- [s->exp_strategy[ch][4]]
- [s->exp_strategy[ch][5]];
- if (expstr < 0) {
- s->use_frame_exp_strategy = 0;
- break;
- }
- s->frame_exp_strategy[ch] = expstr;
- }
-}
-
-
-
-void ff_eac3_set_cpl_states(AC3EncodeContext *s)
-{
- int ch, blk;
- int first_cpl_coords[AC3_MAX_CHANNELS];
-
- /* set first cpl coords */
- for (ch = 1; ch <= s->fbw_channels; ch++)
- first_cpl_coords[ch] = 1;
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- if (block->channel_in_cpl[ch]) {
- if (first_cpl_coords[ch]) {
- block->new_cpl_coords[ch] = 2;
- first_cpl_coords[ch] = 0;
- }
- } else {
- first_cpl_coords[ch] = 1;
- }
- }
- }
-
- /* set first cpl leak */
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- if (block->cpl_in_use) {
- block->new_cpl_leak = 2;
- break;
- }
- }
-}
-
-
-void ff_eac3_output_frame_header(AC3EncodeContext *s)
-{
- int blk, ch;
- AC3EncOptions *opt = &s->options;
-
- put_bits(&s->pb, 16, 0x0b77); /* sync word */
-
- /* BSI header */
- put_bits(&s->pb, 2, 0); /* stream type = independent */
- put_bits(&s->pb, 3, 0); /* substream id = 0 */
- put_bits(&s->pb, 11, (s->frame_size / 2) - 1); /* frame size */
- if (s->bit_alloc.sr_shift) {
- put_bits(&s->pb, 2, 0x3); /* fscod2 */
- put_bits(&s->pb, 2, s->bit_alloc.sr_code); /* sample rate code */
- } else {
- put_bits(&s->pb, 2, s->bit_alloc.sr_code); /* sample rate code */
- put_bits(&s->pb, 2, s->num_blks_code); /* number of blocks */
- }
- put_bits(&s->pb, 3, s->channel_mode); /* audio coding mode */
- put_bits(&s->pb, 1, s->lfe_on); /* LFE channel indicator */
- put_bits(&s->pb, 5, s->bitstream_id); /* bitstream id (EAC3=16) */
- put_bits(&s->pb, 5, -opt->dialogue_level); /* dialogue normalization level */
- put_bits(&s->pb, 1, 0); /* no compression gain */
- /* mixing metadata*/
- put_bits(&s->pb, 1, opt->eac3_mixing_metadata);
- if (opt->eac3_mixing_metadata) {
- if (s->channel_mode > AC3_CHMODE_STEREO)
- put_bits(&s->pb, 2, opt->preferred_stereo_downmix);
- if (s->has_center) {
- put_bits(&s->pb, 3, s->ltrt_center_mix_level);
- put_bits(&s->pb, 3, s->loro_center_mix_level);
- }
- if (s->has_surround) {
- put_bits(&s->pb, 3, s->ltrt_surround_mix_level);
- put_bits(&s->pb, 3, s->loro_surround_mix_level);
- }
- if (s->lfe_on)
- put_bits(&s->pb, 1, 0);
- put_bits(&s->pb, 1, 0); /* no program scale */
- put_bits(&s->pb, 1, 0); /* no ext program scale */
- put_bits(&s->pb, 2, 0); /* no mixing parameters */
- if (s->channel_mode < AC3_CHMODE_STEREO)
- put_bits(&s->pb, 1, 0); /* no pan info */
- put_bits(&s->pb, 1, 0); /* no frame mix config info */
- }
- /* info metadata*/
- put_bits(&s->pb, 1, opt->eac3_info_metadata);
- if (opt->eac3_info_metadata) {
- put_bits(&s->pb, 3, s->bitstream_mode);
- put_bits(&s->pb, 1, opt->copyright);
- put_bits(&s->pb, 1, opt->original);
- if (s->channel_mode == AC3_CHMODE_STEREO) {
- put_bits(&s->pb, 2, opt->dolby_surround_mode);
- put_bits(&s->pb, 2, opt->dolby_headphone_mode);
- }
- if (s->channel_mode >= AC3_CHMODE_2F2R)
- put_bits(&s->pb, 2, opt->dolby_surround_ex_mode);
- put_bits(&s->pb, 1, opt->audio_production_info);
- if (opt->audio_production_info) {
- put_bits(&s->pb, 5, opt->mixing_level - 80);
- put_bits(&s->pb, 2, opt->room_type);
- put_bits(&s->pb, 1, opt->ad_converter_type);
- }
- put_bits(&s->pb, 1, 0);
- }
- if (s->num_blocks != 6)
- put_bits(&s->pb, 1, !(s->avctx->frame_number % 6)); /* converter sync flag */
- put_bits(&s->pb, 1, 0); /* no additional bit stream info */
-
- /* frame header */
- if (s->num_blocks == 6) {
- put_bits(&s->pb, 1, !s->use_frame_exp_strategy);/* exponent strategy syntax */
- put_bits(&s->pb, 1, 0); /* aht enabled = no */
- }
- put_bits(&s->pb, 2, 0); /* snr offset strategy = 1 */
- put_bits(&s->pb, 1, 0); /* transient pre-noise processing enabled = no */
- put_bits(&s->pb, 1, 0); /* block switch syntax enabled = no */
- put_bits(&s->pb, 1, 0); /* dither flag syntax enabled = no */
- put_bits(&s->pb, 1, 0); /* bit allocation model syntax enabled = no */
- put_bits(&s->pb, 1, 0); /* fast gain codes enabled = no */
- put_bits(&s->pb, 1, 0); /* dba syntax enabled = no */
- put_bits(&s->pb, 1, 0); /* skip field syntax enabled = no */
- put_bits(&s->pb, 1, 0); /* spx enabled = no */
- /* coupling strategy use flags */
- if (s->channel_mode > AC3_CHMODE_MONO) {
- put_bits(&s->pb, 1, s->blocks[0].cpl_in_use);
- for (blk = 1; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- put_bits(&s->pb, 1, block->new_cpl_strategy);
- if (block->new_cpl_strategy)
- put_bits(&s->pb, 1, block->cpl_in_use);
- }
- }
- /* exponent strategy */
- if (s->use_frame_exp_strategy) {
- for (ch = !s->cpl_on; ch <= s->fbw_channels; ch++)
- put_bits(&s->pb, 5, s->frame_exp_strategy[ch]);
- } else {
- for (blk = 0; blk < s->num_blocks; blk++)
- for (ch = !s->blocks[blk].cpl_in_use; ch <= s->fbw_channels; ch++)
- put_bits(&s->pb, 2, s->exp_strategy[ch][blk]);
- }
- if (s->lfe_on) {
- for (blk = 0; blk < s->num_blocks; blk++)
- put_bits(&s->pb, 1, s->exp_strategy[s->lfe_channel][blk]);
- }
- /* E-AC-3 to AC-3 converter exponent strategy (not optional when num blocks == 6) */
- if (s->num_blocks != 6) {
- put_bits(&s->pb, 1, 0);
- } else {
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- if (s->use_frame_exp_strategy)
- put_bits(&s->pb, 5, s->frame_exp_strategy[ch]);
- else
- put_bits(&s->pb, 5, 0);
- }
- }
- /* snr offsets */
- put_bits(&s->pb, 6, s->coarse_snr_offset);
- put_bits(&s->pb, 4, s->fine_snr_offset[1]);
- /* block start info */
- if (s->num_blocks > 1)
- put_bits(&s->pb, 1, 0);
-}
-
-
-#if CONFIG_EAC3_ENCODER
-AVCodec ff_eac3_encoder = {
- .name = "eac3",
- .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52 E-AC-3"),
- .type = AVMEDIA_TYPE_AUDIO,
- .id = AV_CODEC_ID_EAC3,
- .priv_data_size = sizeof(AC3EncodeContext),
- .init = ff_ac3_encode_init,
- .encode2 = ff_ac3_float_encode_frame,
- .close = ff_ac3_encode_close,
- .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
- AV_SAMPLE_FMT_NONE },
- .priv_class = &eac3enc_class,
- .channel_layouts = ff_ac3_channel_layouts,
- .defaults = ac3_defaults,
-};
-#endif
diff --git a/libavcodec/eac3enc.h b/libavcodec/eac3enc.h
deleted file mode 100644
index 7d61559..0000000
--- a/libavcodec/eac3enc.h
+++ b/dev/null
@@ -1,54 +0,0 @@
-/*
- * E-AC-3 encoder
- * Copyright (c) 2011 Justin Ruggles <justin.ruggles@gmail.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
- */
-
-/**
- * @file
- * E-AC-3 encoder
- */
-
-#ifndef AVCODEC_EAC3ENC_H
-#define AVCODEC_EAC3ENC_H
-
-#include "ac3enc.h"
-
-/**
- * Initialize E-AC-3 exponent tables.
- */
-void ff_eac3_exponent_init(void);
-
-/**
- * Determine frame exponent strategy use and indices.
- */
-void ff_eac3_get_frame_exp_strategy(AC3EncodeContext *s);
-
-/**
- * Set coupling states.
- * This determines whether certain flags must be written to the bitstream or
- * whether they will be implicitly already known by the decoder.
- */
-void ff_eac3_set_cpl_states(AC3EncodeContext *s);
-
-/**
- * Write the E-AC-3 frame header to the output bitstream.
- */
-void ff_eac3_output_frame_header(AC3EncodeContext *s);
-
-#endif /* AVCODEC_EAC3ENC_H */
diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c
index 642f975..12a9fd6 100644..100755
--- a/libavcodec/hevc_parser.c
+++ b/libavcodec/hevc_parser.c
@@ -32,6 +32,44 @@ typedef struct HEVCParseContext {
ParseContext pc;
} HEVCParseContext;
+
+//////////// copy from player_hwdec.c ///////////////////////
+static int check_size_in_buffer(unsigned char *p, int len)
+{
+ unsigned int size;
+ unsigned char *q = p;
+ while ((q + 4) < (p + len)) {
+ size = (*q << 24) | (*(q + 1) << 16) | (*(q + 2) << 8) | (*(q + 3));
+ if (size & 0xff000000) {
+ return 0;
+ }
+
+ if (q + size + 4 == p + len) {
+ return 1;
+ }
+
+ q += size + 4;
+ }
+ return 0;
+}
+
+static int check_size_in_buffer3(unsigned char *p, int len)
+{
+ unsigned int size;
+ unsigned char *q = p;
+ while ((q + 3) < (p + len)) {
+ size = (*q << 16) | (*(q + 1) << 8) | (*(q + 2));
+
+ if (q + size + 3 == p + len) {
+ return 1;
+ }
+
+ q += size + 3;
+ }
+ return 0;
+}
+////////////////////////////////////////////////
+
/**
* Find the end of the current frame in the bitstream.
* @return the position of the first byte of the next frame, or END_NOT_FOUND
@@ -116,9 +154,20 @@ static inline int parse_nal_units(AVCodecParserContext *s,
for (;;) {
int src_length, consumed;
+ if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
+ unsigned char *p = buf;
+ if (check_size_in_buffer(buf, buf_end -buf)) {
+ buf += 4;
+ goto PASS;
+ } else if (check_size_in_buffer3(buf, buf_end -buf)) {
+ buf += 3;
+ goto PASS;
+ }
+ }
buf = avpriv_find_start_code(buf, buf_end, &state);
if (--buf + 2 >= buf_end)
break;
+PASS:
src_length = buf_end - buf;
h->nal_unit_type = (*buf >> 1) & 0x3f;
@@ -173,13 +222,13 @@ static inline int parse_nal_units(AVCodecParserContext *s,
sh->pps_id = get_ue_golomb(gb);
if (sh->pps_id >= MAX_PPS_COUNT || !h->pps_list[sh->pps_id]) {
- av_log(h->avctx, AV_LOG_ERROR, "PPS id out of range: %d\n", sh->pps_id);
+ av_log(h->avctx, AV_LOG_DEBUG, "PPS id out of range: %d\n", sh->pps_id);
return AVERROR_INVALIDDATA;
}
h->pps = (HEVCPPS*)h->pps_list[sh->pps_id]->data;
if (h->pps->sps_id >= MAX_SPS_COUNT || !h->sps_list[h->pps->sps_id]) {
- av_log(h->avctx, AV_LOG_ERROR, "SPS id out of range: %d\n", h->pps->sps_id);
+ av_log(h->avctx, AV_LOG_DEBUG, "SPS id out of range: %d\n", h->pps->sps_id);
return AVERROR_INVALIDDATA;
}
if (h->sps != (HEVCSPS*)h->sps_list[h->pps->sps_id]->data) {
diff --git a/libavcodec/mips/ac3dsp_mips.c b/libavcodec/mips/ac3dsp_mips.c
deleted file mode 100644
index f33c6f1..0000000
--- a/libavcodec/mips/ac3dsp_mips.c
+++ b/dev/null
@@ -1,412 +0,0 @@
-/*
- * Copyright (c) 2012
- * MIPS Technologies, Inc., California.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. Neither the name of the MIPS Technologies, Inc., 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 MIPS TECHNOLOGIES, INC. ``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 MIPS TECHNOLOGIES, INC. 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.
- *
- * Authors: Branimir Vasic (bvasic@mips.com)
- * Nedeljko Babic (nbabic@mips.com)
- *
- * Various AC-3 DSP Utils optimized for MIPS
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General 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
- * Reference: libavcodec/ac3dsp.c
- */
-
-#include "config.h"
-#include "libavcodec/ac3dsp.h"
-#include "libavcodec/ac3.h"
-
-
-#if HAVE_INLINE_ASM
-#if HAVE_MIPSDSPR1
-static void ac3_bit_alloc_calc_bap_mips(int16_t *mask, int16_t *psd,
- int start, int end,
- int snr_offset, int floor,
- const uint8_t *bap_tab, uint8_t *bap)
-{
- int band, band_end, cond;
- int m, address1, address2;
- int16_t *psd1, *psd_end;
- uint8_t *bap1;
-
- if (snr_offset == -960) {
- memset(bap, 0, AC3_MAX_COEFS);
- return;
- }
-
- psd1 = &psd[start];
- bap1 = &bap[start];
- band = ff_ac3_bin_to_band_tab[start];
-
- do {
- m = (FFMAX(mask[band] - snr_offset - floor, 0) & 0x1FE0) + floor;
- band_end = ff_ac3_band_start_tab[++band];
- band_end = FFMIN(band_end, end);
- psd_end = psd + band_end - 1;
-
- __asm__ volatile (
- "slt %[cond], %[psd1], %[psd_end] \n\t"
- "beqz %[cond], 1f \n\t"
- "2: \n\t"
- "lh %[address1], 0(%[psd1]) \n\t"
- "lh %[address2], 2(%[psd1]) \n\t"
- "addiu %[psd1], %[psd1], 4 \n\t"
- "subu %[address1], %[address1], %[m] \n\t"
- "sra %[address1], %[address1], 5 \n\t"
- "addiu %[address1], %[address1], -32 \n\t"
- "shll_s.w %[address1], %[address1], 26 \n\t"
- "subu %[address2], %[address2], %[m] \n\t"
- "sra %[address2], %[address2], 5 \n\t"
- "sra %[address1], %[address1], 26 \n\t"
- "addiu %[address1], %[address1], 32 \n\t"
- "lbux %[address1], %[address1](%[bap_tab]) \n\t"
- "addiu %[address2], %[address2], -32 \n\t"
- "shll_s.w %[address2], %[address2], 26 \n\t"
- "sb %[address1], 0(%[bap1]) \n\t"
- "slt %[cond], %[psd1], %[psd_end] \n\t"
- "sra %[address2], %[address2], 26 \n\t"
- "addiu %[address2], %[address2], 32 \n\t"
- "lbux %[address2], %[address2](%[bap_tab]) \n\t"
- "sb %[address2], 1(%[bap1]) \n\t"
- "addiu %[bap1], %[bap1], 2 \n\t"
- "bnez %[cond], 2b \n\t"
- "addiu %[psd_end], %[psd_end], 2 \n\t"
- "slt %[cond], %[psd1], %[psd_end] \n\t"
- "beqz %[cond], 3f \n\t"
- "1: \n\t"
- "lh %[address1], 0(%[psd1]) \n\t"
- "addiu %[psd1], %[psd1], 2 \n\t"
- "subu %[address1], %[address1], %[m] \n\t"
- "sra %[address1], %[address1], 5 \n\t"
- "addiu %[address1], %[address1], -32 \n\t"
- "shll_s.w %[address1], %[address1], 26 \n\t"
- "sra %[address1], %[address1], 26 \n\t"
- "addiu %[address1], %[address1], 32 \n\t"
- "lbux %[address1], %[address1](%[bap_tab]) \n\t"
- "sb %[address1], 0(%[bap1]) \n\t"
- "addiu %[bap1], %[bap1], 1 \n\t"
- "3: \n\t"
-
- : [address1]"=&r"(address1), [address2]"=&r"(address2),
- [cond]"=&r"(cond), [bap1]"+r"(bap1),
- [psd1]"+r"(psd1), [psd_end]"+r"(psd_end)
- : [m]"r"(m), [bap_tab]"r"(bap_tab)
- : "memory"
- );
- } while (end > band_end);
-}
-
-static void ac3_update_bap_counts_mips(uint16_t mant_cnt[16], uint8_t *bap,
- int len)
-{
- int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
-
- __asm__ volatile (
- "andi %[temp3], %[len], 3 \n\t"
- "addu %[temp2], %[bap], %[len] \n\t"
- "addu %[temp4], %[bap], %[temp3] \n\t"
- "beq %[temp2], %[temp4], 4f \n\t"
- "1: \n\t"
- "lbu %[temp0], -1(%[temp2]) \n\t"
- "lbu %[temp5], -2(%[temp2]) \n\t"
- "lbu %[temp6], -3(%[temp2]) \n\t"
- "sll %[temp0], %[temp0], 1 \n\t"
- "addu %[temp0], %[mant_cnt], %[temp0] \n\t"
- "sll %[temp5], %[temp5], 1 \n\t"
- "addu %[temp5], %[mant_cnt], %[temp5] \n\t"
- "lhu %[temp1], 0(%[temp0]) \n\t"
- "sll %[temp6], %[temp6], 1 \n\t"
- "addu %[temp6], %[mant_cnt], %[temp6] \n\t"
- "addiu %[temp1], %[temp1], 1 \n\t"
- "sh %[temp1], 0(%[temp0]) \n\t"
- "lhu %[temp1], 0(%[temp5]) \n\t"
- "lbu %[temp7], -4(%[temp2]) \n\t"
- "addiu %[temp2], %[temp2], -4 \n\t"
- "addiu %[temp1], %[temp1], 1 \n\t"
- "sh %[temp1], 0(%[temp5]) \n\t"
- "lhu %[temp1], 0(%[temp6]) \n\t"
- "sll %[temp7], %[temp7], 1 \n\t"
- "addu %[temp7], %[mant_cnt], %[temp7] \n\t"
- "addiu %[temp1], %[temp1],1 \n\t"
- "sh %[temp1], 0(%[temp6]) \n\t"
- "lhu %[temp1], 0(%[temp7]) \n\t"
- "addiu %[temp1], %[temp1], 1 \n\t"
- "sh %[temp1], 0(%[temp7]) \n\t"
- "bne %[temp2], %[temp4], 1b \n\t"
- "4: \n\t"
- "beqz %[temp3], 2f \n\t"
- "3: \n\t"
- "addiu %[temp3], %[temp3], -1 \n\t"
- "lbu %[temp0], -1(%[temp2]) \n\t"
- "addiu %[temp2], %[temp2], -1 \n\t"
- "sll %[temp0], %[temp0], 1 \n\t"
- "addu %[temp0], %[mant_cnt], %[temp0] \n\t"
- "lhu %[temp1], 0(%[temp0]) \n\t"
- "addiu %[temp1], %[temp1], 1 \n\t"
- "sh %[temp1], 0(%[temp0]) \n\t"
- "bgtz %[temp3], 3b \n\t"
- "2: \n\t"
-
- : [temp0] "=&r" (temp0), [temp1] "=&r" (temp1),
- [temp2] "=&r" (temp2), [temp3] "=&r" (temp3),
- [temp4] "=&r" (temp4), [temp5] "=&r" (temp5),
- [temp6] "=&r" (temp6), [temp7] "=&r" (temp7)
- : [len] "r" (len), [bap] "r" (bap),
- [mant_cnt] "r" (mant_cnt)
- : "memory"
- );
-}
-#endif
-
-#if HAVE_MIPSFPU && HAVE_MIPS32R2
-static void float_to_fixed24_mips(int32_t *dst, const float *src, unsigned int len)
-{
- const float scale = 1 << 24;
- float src0, src1, src2, src3, src4, src5, src6, src7;
- int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
-
- do {
- __asm__ volatile (
- "lwc1 %[src0], 0(%[src]) \n\t"
- "lwc1 %[src1], 4(%[src]) \n\t"
- "lwc1 %[src2], 8(%[src]) \n\t"
- "lwc1 %[src3], 12(%[src]) \n\t"
- "lwc1 %[src4], 16(%[src]) \n\t"
- "lwc1 %[src5], 20(%[src]) \n\t"
- "lwc1 %[src6], 24(%[src]) \n\t"
- "lwc1 %[src7], 28(%[src]) \n\t"
- "mul.s %[src0], %[src0], %[scale] \n\t"
- "mul.s %[src1], %[src1], %[scale] \n\t"
- "mul.s %[src2], %[src2], %[scale] \n\t"
- "mul.s %[src3], %[src3], %[scale] \n\t"
- "mul.s %[src4], %[src4], %[scale] \n\t"
- "mul.s %[src5], %[src5], %[scale] \n\t"
- "mul.s %[src6], %[src6], %[scale] \n\t"
- "mul.s %[src7], %[src7], %[scale] \n\t"
- "cvt.w.s %[src0], %[src0] \n\t"
- "cvt.w.s %[src1], %[src1] \n\t"
- "cvt.w.s %[src2], %[src2] \n\t"
- "cvt.w.s %[src3], %[src3] \n\t"
- "cvt.w.s %[src4], %[src4] \n\t"
- "cvt.w.s %[src5], %[src5] \n\t"
- "cvt.w.s %[src6], %[src6] \n\t"
- "cvt.w.s %[src7], %[src7] \n\t"
- "mfc1 %[temp0], %[src0] \n\t"
- "mfc1 %[temp1], %[src1] \n\t"
- "mfc1 %[temp2], %[src2] \n\t"
- "mfc1 %[temp3], %[src3] \n\t"
- "mfc1 %[temp4], %[src4] \n\t"
- "mfc1 %[temp5], %[src5] \n\t"
- "mfc1 %[temp6], %[src6] \n\t"
- "mfc1 %[temp7], %[src7] \n\t"
- "sw %[temp0], 0(%[dst]) \n\t"
- "sw %[temp1], 4(%[dst]) \n\t"
- "sw %[temp2], 8(%[dst]) \n\t"
- "sw %[temp3], 12(%[dst]) \n\t"
- "sw %[temp4], 16(%[dst]) \n\t"
- "sw %[temp5], 20(%[dst]) \n\t"
- "sw %[temp6], 24(%[dst]) \n\t"
- "sw %[temp7], 28(%[dst]) \n\t"
-
- : [dst] "+r" (dst), [src] "+r" (src),
- [src0] "=&f" (src0), [src1] "=&f" (src1),
- [src2] "=&f" (src2), [src3] "=&f" (src3),
- [src4] "=&f" (src4), [src5] "=&f" (src5),
- [src6] "=&f" (src6), [src7] "=&f" (src7),
- [temp0] "=r" (temp0), [temp1] "=r" (temp1),
- [temp2] "=r" (temp2), [temp3] "=r" (temp3),
- [temp4] "=r" (temp4), [temp5] "=r" (temp5),
- [temp6] "=r" (temp6), [temp7] "=r" (temp7)
- : [scale] "f" (scale)
- : "memory"
- );
- src = src + 8;
- dst = dst + 8;
- len -= 8;
- } while (len > 0);
-}
-
-static void ac3_downmix_mips(float **samples, float (*matrix)[2],
- int out_ch, int in_ch, int len)
-{
- int i, j, i1, i2, i3;
- float v0, v1, v2, v3;
- float v4, v5, v6, v7;
- float samples0, samples1, samples2, samples3, matrix_j, matrix_j2;
- float *samples_p,*matrix_p, **samples_x, **samples_end, **samples_sw;
-
- __asm__ volatile(
- ".set push \n\t"
- ".set noreorder \n\t"
-
- "li %[i1], 2 \n\t"
- "sll %[len], 2 \n\t"
- "move %[i], $zero \n\t"
- "sll %[j], %[in_ch], 2 \n\t"
-
- "bne %[out_ch], %[i1], 3f \n\t" // if (out_ch == 2)
- " li %[i2], 1 \n\t"
-
- "2: \n\t" // start of the for loop (for (i = 0; i < len; i+=4))
- "move %[matrix_p], %[matrix] \n\t"
- "move %[samples_x], %[samples] \n\t"
- "mtc1 $zero, %[v0] \n\t"
- "mtc1 $zero, %[v1] \n\t"
- "mtc1 $zero, %[v2] \n\t"
- "mtc1 $zero, %[v3] \n\t"
- "mtc1 $zero, %[v4] \n\t"
- "mtc1 $zero, %[v5] \n\t"
- "mtc1 $zero, %[v6] \n\t"
- "mtc1 $zero, %[v7] \n\t"
- "addiu %[i1], %[i], 4 \n\t"
- "addiu %[i2], %[i], 8 \n\t"
- "lw %[samples_p], 0(%[samples_x]) \n\t"
- "addiu %[i3], %[i], 12 \n\t"
- "addu %[samples_end], %[samples_x], %[j] \n\t"
- "move %[samples_sw], %[samples_p] \n\t"
-
- "1: \n\t" // start of the inner for loop (for (j = 0; j < in_ch; j++))
- "lwc1 %[matrix_j], 0(%[matrix_p]) \n\t"
- "lwc1 %[matrix_j2], 4(%[matrix_p]) \n\t"
- "lwxc1 %[samples0], %[i](%[samples_p]) \n\t"
- "lwxc1 %[samples1], %[i1](%[samples_p]) \n\t"
- "lwxc1 %[samples2], %[i2](%[samples_p]) \n\t"
- "lwxc1 %[samples3], %[i3](%[samples_p]) \n\t"
- "addiu %[matrix_p], 8 \n\t"
- "addiu %[samples_x], 4 \n\t"
- "madd.s %[v0], %[v0], %[samples0], %[matrix_j] \n\t"
- "madd.s %[v1], %[v1], %[samples1], %[matrix_j] \n\t"
- "madd.s %[v2], %[v2], %[samples2], %[matrix_j] \n\t"
- "madd.s %[v3], %[v3], %[samples3], %[matrix_j] \n\t"
- "madd.s %[v4], %[v4], %[samples0], %[matrix_j2]\n\t"
- "madd.s %[v5], %[v5], %[samples1], %[matrix_j2]\n\t"
- "madd.s %[v6], %[v6], %[samples2], %[matrix_j2]\n\t"
- "madd.s %[v7], %[v7], %[samples3], %[matrix_j2]\n\t"
- "bne %[samples_x], %[samples_end], 1b \n\t"
- " lw %[samples_p], 0(%[samples_x]) \n\t"
-
- "lw %[samples_p], 4(%[samples]) \n\t"
- "swxc1 %[v0], %[i](%[samples_sw]) \n\t"
- "swxc1 %[v1], %[i1](%[samples_sw]) \n\t"
- "swxc1 %[v2], %[i2](%[samples_sw]) \n\t"
- "swxc1 %[v3], %[i3](%[samples_sw]) \n\t"
- "swxc1 %[v4], %[i](%[samples_p]) \n\t"
- "addiu %[i], 16 \n\t"
- "swxc1 %[v5], %[i1](%[samples_p]) \n\t"
- "swxc1 %[v6], %[i2](%[samples_p]) \n\t"
- "bne %[i], %[len], 2b \n\t"
- " swxc1 %[v7], %[i3](%[samples_p]) \n\t"
-
- "3: \n\t"
- "bne %[out_ch], %[i2], 6f \n\t" // if (out_ch == 1)
- " nop \n\t"
-
- "5: \n\t" // start of the outer for loop (for (i = 0; i < len; i+=4))
- "move %[matrix_p], %[matrix] \n\t"
- "move %[samples_x], %[samples] \n\t"
- "mtc1 $zero, %[v0] \n\t"
- "mtc1 $zero, %[v1] \n\t"
- "mtc1 $zero, %[v2] \n\t"
- "mtc1 $zero, %[v3] \n\t"
- "addiu %[i1], %[i], 4 \n\t"
- "addiu %[i2], %[i], 8 \n\t"
- "lw %[samples_p], 0(%[samples_x]) \n\t"
- "addiu %[i3], %[i], 12 \n\t"
- "addu %[samples_end], %[samples_x], %[j] \n\t"
- "move %[samples_sw], %[samples_p] \n\t"
-
- "4: \n\t" // start of the inner for loop (for (j = 0; j < in_ch; j++))
- "lwc1 %[matrix_j], 0(%[matrix_p]) \n\t"
- "lwxc1 %[samples0], %[i](%[samples_p]) \n\t"
- "lwxc1 %[samples1], %[i1](%[samples_p]) \n\t"
- "lwxc1 %[samples2], %[i2](%[samples_p]) \n\t"
- "lwxc1 %[samples3], %[i3](%[samples_p]) \n\t"
- "addiu %[matrix_p], 8 \n\t"
- "addiu %[samples_x], 4 \n\t"
- "madd.s %[v0], %[v0], %[samples0], %[matrix_j] \n\t"
- "madd.s %[v1], %[v1], %[samples1], %[matrix_j] \n\t"
- "madd.s %[v2], %[v2], %[samples2], %[matrix_j] \n\t"
- "madd.s %[v3], %[v3], %[samples3], %[matrix_j] \n\t"
- "bne %[samples_x], %[samples_end], 4b \n\t"
- " lw %[samples_p], 0(%[samples_x]) \n\t"
-
- "swxc1 %[v0], %[i](%[samples_sw]) \n\t"
- "addiu %[i], 16 \n\t"
- "swxc1 %[v1], %[i1](%[samples_sw]) \n\t"
- "swxc1 %[v2], %[i2](%[samples_sw]) \n\t"
- "bne %[i], %[len], 5b \n\t"
- " swxc1 %[v3], %[i3](%[samples_sw]) \n\t"
- "6: \n\t"
-
- ".set pop"
- :[samples_p]"=&r"(samples_p), [matrix_j]"=&f"(matrix_j), [matrix_j2]"=&f"(matrix_j2),
- [samples0]"=&f"(samples0), [samples1]"=&f"(samples1),
- [samples2]"=&f"(samples2), [samples3]"=&f"(samples3),
- [v0]"=&f"(v0), [v1]"=&f"(v1), [v2]"=&f"(v2), [v3]"=&f"(v3),
- [v4]"=&f"(v4), [v5]"=&f"(v5), [v6]"=&f"(v6), [v7]"=&f"(v7),
- [samples_x]"=&r"(samples_x), [matrix_p]"=&r"(matrix_p),
- [samples_end]"=&r"(samples_end), [samples_sw]"=&r"(samples_sw),
- [i1]"=&r"(i1), [i2]"=&r"(i2), [i3]"=&r"(i3), [i]"=&r"(i),
- [j]"=&r"(j), [len]"+r"(len)
- :[samples]"r"(samples), [matrix]"r"(matrix),
- [in_ch]"r"(in_ch), [out_ch]"r"(out_ch)
- :"memory"
- );
-}
-#endif
-#endif /* HAVE_INLINE_ASM */
-
-void ff_ac3dsp_init_mips(AC3DSPContext *c, int bit_exact) {
-#if HAVE_INLINE_ASM
-#if HAVE_MIPSDSPR1
- c->bit_alloc_calc_bap = ac3_bit_alloc_calc_bap_mips;
- c->update_bap_counts = ac3_update_bap_counts_mips;
-#endif
-#if HAVE_MIPSFPU && HAVE_MIPS32R2
- c->float_to_fixed24 = float_to_fixed24_mips;
- c->downmix = ac3_downmix_mips;
-#endif
-#endif
-
-}
diff --git a/libavcodec/mlp.c b/libavcodec/mlp.c
deleted file mode 100644
index 87f7c77..0000000
--- a/libavcodec/mlp.c
+++ b/dev/null
@@ -1,115 +0,0 @@
-/*
- * MLP codec common code
- * Copyright (c) 2007-2008 Ian Caulfield
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General 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 <stdint.h>
-
-#include "libavutil/crc.h"
-#include "libavutil/intreadwrite.h"
-#include "mlp.h"
-
-const uint8_t ff_mlp_huffman_tables[3][18][2] = {
- { /* Huffman table 0, -7 - +10 */
- {0x01, 9}, {0x01, 8}, {0x01, 7}, {0x01, 6}, {0x01, 5}, {0x01, 4}, {0x01, 3},
- {0x04, 3}, {0x05, 3}, {0x06, 3}, {0x07, 3},
- {0x03, 3}, {0x05, 4}, {0x09, 5}, {0x11, 6}, {0x21, 7}, {0x41, 8}, {0x81, 9},
- }, { /* Huffman table 1, -7 - +8 */
- {0x01, 9}, {0x01, 8}, {0x01, 7}, {0x01, 6}, {0x01, 5}, {0x01, 4}, {0x01, 3},
- {0x02, 2}, {0x03, 2},
- {0x03, 3}, {0x05, 4}, {0x09, 5}, {0x11, 6}, {0x21, 7}, {0x41, 8}, {0x81, 9},
- }, { /* Huffman table 2, -7 - +7 */
- {0x01, 9}, {0x01, 8}, {0x01, 7}, {0x01, 6}, {0x01, 5}, {0x01, 4}, {0x01, 3},
- {0x01, 1},
- {0x03, 3}, {0x05, 4}, {0x09, 5}, {0x11, 6}, {0x21, 7}, {0x41, 8}, {0x81, 9},
- }
-};
-
-static int crc_init = 0;
-#if CONFIG_SMALL
-#define CRC_TABLE_SIZE 257
-#else
-#define CRC_TABLE_SIZE 1024
-#endif
-static AVCRC crc_63[CRC_TABLE_SIZE];
-static AVCRC crc_1D[CRC_TABLE_SIZE];
-static AVCRC crc_2D[CRC_TABLE_SIZE];
-
-av_cold void ff_mlp_init_crc(void)
-{
- if (!crc_init) {
- av_crc_init(crc_63, 0, 8, 0x63, sizeof(crc_63));
- av_crc_init(crc_1D, 0, 8, 0x1D, sizeof(crc_1D));
- av_crc_init(crc_2D, 0, 16, 0x002D, sizeof(crc_2D));
- crc_init = 1;
- }
-}
-
-uint16_t ff_mlp_checksum16(const uint8_t *buf, unsigned int buf_size)
-{
- uint16_t crc;
-
- crc = av_crc(crc_2D, 0, buf, buf_size - 2);
- crc ^= AV_RL16(buf + buf_size - 2);
- return crc;
-}
-
-uint8_t ff_mlp_checksum8(const uint8_t *buf, unsigned int buf_size)
-{
- uint8_t checksum = av_crc(crc_63, 0x3c, buf, buf_size - 1); // crc_63[0xa2] == 0x3c
- checksum ^= buf[buf_size-1];
- return checksum;
-}
-
-uint8_t ff_mlp_restart_checksum(const uint8_t *buf, unsigned int bit_size)
-{
- int i;
- int num_bytes = (bit_size + 2) / 8;
-
- int crc = crc_1D[buf[0] & 0x3f];
- crc = av_crc(crc_1D, crc, buf + 1, num_bytes - 2);
- crc ^= buf[num_bytes - 1];
-
- for (i = 0; i < ((bit_size + 2) & 7); i++) {
- crc <<= 1;
- if (crc & 0x100)
- crc ^= 0x11D;
- crc ^= (buf[num_bytes] >> (7 - i)) & 1;
- }
-
- return crc;
-}
-
-uint8_t ff_mlp_calculate_parity(const uint8_t *buf, unsigned int buf_size)
-{
- uint32_t scratch = 0;
- const uint8_t *buf_end = buf + buf_size;
-
- for (; ((intptr_t) buf & 3) && buf < buf_end; buf++)
- scratch ^= *buf;
- for (; buf < buf_end - 3; buf += 4)
- scratch ^= *((const uint32_t*)buf);
-
- scratch = xor_32_to_8(scratch);
-
- for (; buf < buf_end; buf++)
- scratch ^= *buf;
-
- return scratch;
-}
diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c
index fcd1168..ae42aaf 100644
--- a/libavcodec/mlp_parser.c
+++ b/libavcodec/mlp_parser.c
@@ -211,7 +211,32 @@ typedef struct MLPParseContext
int num_substreams;
} MLPParseContext;
+static int crc_init = 0;
+#if CONFIG_SMALL
+#define CRC_TABLE_SIZE 257
+#else
+#define CRC_TABLE_SIZE 1024
+#endif
+static AVCRC crc_63[CRC_TABLE_SIZE];
+static AVCRC crc_1D[CRC_TABLE_SIZE];
+static AVCRC crc_2D[CRC_TABLE_SIZE];
+av_cold void ff_mlp_init_crc(void)
+{
+ if (!crc_init) {
+ av_crc_init(crc_63, 0, 8, 0x63, sizeof(crc_63));
+ av_crc_init(crc_1D, 0, 8, 0x1D, sizeof(crc_1D));
+ av_crc_init(crc_2D, 0, 16, 0x002D, sizeof(crc_2D));
+ crc_init = 1;
+ }
+}
+uint16_t ff_mlp_checksum16(const uint8_t *buf, unsigned int buf_size)
+{
+ uint16_t crc;
+ crc = av_crc(crc_2D, 0, buf, buf_size - 2);
+ crc ^= AV_RL16(buf + buf_size - 2);
+ return crc;
+}
static av_cold int mlp_init(AVCodecParserContext *s)
{
ff_mlp_init_crc();
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
deleted file mode 100644
index aab8293..0000000
--- a/libavcodec/mlpdec.c
+++ b/dev/null
@@ -1,1275 +0,0 @@
-/*
- * MLP decoder
- * Copyright (c) 2007-2008 Ian Caulfield
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General 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
- * MLP decoder
- */
-
-#include <stdint.h>
-
-#include "avcodec.h"
-#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/channel_layout.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "libavutil/crc.h"
-#include "parser.h"
-#include "mlp_parser.h"
-#include "mlpdsp.h"
-#include "mlp.h"
-
-/** number of bits used for VLC lookup - longest Huffman code is 9 */
-#define VLC_BITS 9
-
-typedef struct SubStream {
- /// Set if a valid restart header has been read. Otherwise the substream cannot be decoded.
- uint8_t restart_seen;
-
- //@{
- /** restart header data */
- /// The type of noise to be used in the rematrix stage.
- uint16_t noise_type;
-
- /// The index of the first channel coded in this substream.
- uint8_t min_channel;
- /// The index of the last channel coded in this substream.
- uint8_t max_channel;
- /// The number of channels input into the rematrix stage.
- uint8_t max_matrix_channel;
- /// For each channel output by the matrix, the output channel to map it to
- uint8_t ch_assign[MAX_CHANNELS];
- /// The channel layout for this substream
- uint64_t ch_layout;
-
- /// Channel coding parameters for channels in the substream
- ChannelParams channel_params[MAX_CHANNELS];
-
- /// The left shift applied to random noise in 0x31ea substreams.
- uint8_t noise_shift;
- /// The current seed value for the pseudorandom noise generator(s).
- uint32_t noisegen_seed;
-
- /// Set if the substream contains extra info to check the size of VLC blocks.
- uint8_t data_check_present;
-
- /// Bitmask of which parameter sets are conveyed in a decoding parameter block.
- uint8_t param_presence_flags;
-#define PARAM_BLOCKSIZE (1 << 7)
-#define PARAM_MATRIX (1 << 6)
-#define PARAM_OUTSHIFT (1 << 5)
-#define PARAM_QUANTSTEP (1 << 4)
-#define PARAM_FIR (1 << 3)
-#define PARAM_IIR (1 << 2)
-#define PARAM_HUFFOFFSET (1 << 1)
-#define PARAM_PRESENCE (1 << 0)
- //@}
-
- //@{
- /** matrix data */
-
- /// Number of matrices to be applied.
- uint8_t num_primitive_matrices;
-
- /// matrix output channel
- uint8_t matrix_out_ch[MAX_MATRICES];
-
- /// Whether the LSBs of the matrix output are encoded in the bitstream.
- uint8_t lsb_bypass[MAX_MATRICES];
- /// Matrix coefficients, stored as 2.14 fixed point.
- int32_t matrix_coeff[MAX_MATRICES][MAX_CHANNELS];
- /// Left shift to apply to noise values in 0x31eb substreams.
- uint8_t matrix_noise_shift[MAX_MATRICES];
- //@}
-
- /// Left shift to apply to Huffman-decoded residuals.
- uint8_t quant_step_size[MAX_CHANNELS];
-
- /// number of PCM samples in current audio block
- uint16_t blocksize;
- /// Number of PCM samples decoded so far in this frame.
- uint16_t blockpos;
-
- /// Left shift to apply to decoded PCM values to get final 24-bit output.
- int8_t output_shift[MAX_CHANNELS];
-
- /// Running XOR of all output samples.
- int32_t lossless_check_data;
-
-} SubStream;
-
-typedef struct MLPDecodeContext {
- AVCodecContext *avctx;
-
- /// Current access unit being read has a major sync.
- int is_major_sync_unit;
-
- /// Set if a valid major sync block has been read. Otherwise no decoding is possible.
- uint8_t params_valid;
-
- /// Number of substreams contained within this stream.
- uint8_t num_substreams;
-
- /// Index of the last substream to decode - further substreams are skipped.
- uint8_t max_decoded_substream;
-
- /// Stream needs channel reordering to comply with FFmpeg's channel order
- uint8_t needs_reordering;
-
- /// number of PCM samples contained in each frame
- int access_unit_size;
- /// next power of two above the number of samples in each frame
- int access_unit_size_pow2;
-
- SubStream substream[MAX_SUBSTREAMS];
-
- int matrix_changed;
- int filter_changed[MAX_CHANNELS][NUM_FILTERS];
-
- int8_t noise_buffer[MAX_BLOCKSIZE_POW2];
- int8_t bypassed_lsbs[MAX_BLOCKSIZE][MAX_CHANNELS];
- int32_t sample_buffer[MAX_BLOCKSIZE][MAX_CHANNELS];
-
- MLPDSPContext dsp;
-} MLPDecodeContext;
-
-static const uint64_t thd_channel_order[] = {
- AV_CH_FRONT_LEFT, AV_CH_FRONT_RIGHT, // LR
- AV_CH_FRONT_CENTER, // C
- AV_CH_LOW_FREQUENCY, // LFE
- AV_CH_SIDE_LEFT, AV_CH_SIDE_RIGHT, // LRs
- AV_CH_TOP_FRONT_LEFT, AV_CH_TOP_FRONT_RIGHT, // LRvh
- AV_CH_FRONT_LEFT_OF_CENTER, AV_CH_FRONT_RIGHT_OF_CENTER, // LRc
- AV_CH_BACK_LEFT, AV_CH_BACK_RIGHT, // LRrs
- AV_CH_BACK_CENTER, // Cs
- AV_CH_TOP_CENTER, // Ts
- AV_CH_SURROUND_DIRECT_LEFT, AV_CH_SURROUND_DIRECT_RIGHT, // LRsd
- AV_CH_WIDE_LEFT, AV_CH_WIDE_RIGHT, // LRw
- AV_CH_TOP_FRONT_CENTER, // Cvh
- AV_CH_LOW_FREQUENCY_2, // LFE2
-};
-
-static uint64_t thd_channel_layout_extract_channel(uint64_t channel_layout,
- int index)
-{
- int i;
-
- if (av_get_channel_layout_nb_channels(channel_layout) <= index)
- return 0;
-
- for (i = 0; i < FF_ARRAY_ELEMS(thd_channel_order); i++)
- if (channel_layout & thd_channel_order[i] && !index--)
- return thd_channel_order[i];
- return 0;
-}
-
-static VLC huff_vlc[3];
-
-/** Initialize static data, constant between all invocations of the codec. */
-
-static av_cold void init_static(void)
-{
- if (!huff_vlc[0].bits) {
- INIT_VLC_STATIC(&huff_vlc[0], VLC_BITS, 18,
- &ff_mlp_huffman_tables[0][0][1], 2, 1,
- &ff_mlp_huffman_tables[0][0][0], 2, 1, 512);
- INIT_VLC_STATIC(&huff_vlc[1], VLC_BITS, 16,
- &ff_mlp_huffman_tables[1][0][1], 2, 1,
- &ff_mlp_huffman_tables[1][0][0], 2, 1, 512);
- INIT_VLC_STATIC(&huff_vlc[2], VLC_BITS, 15,
- &ff_mlp_huffman_tables[2][0][1], 2, 1,
- &ff_mlp_huffman_tables[2][0][0], 2, 1, 512);
- }
-
- ff_mlp_init_crc();
-}
-
-static inline int32_t calculate_sign_huff(MLPDecodeContext *m,
- unsigned int substr, unsigned int ch)
-{
- SubStream *s = &m->substream[substr];
- ChannelParams *cp = &s->channel_params[ch];
- int lsb_bits = cp->huff_lsbs - s->quant_step_size[ch];
- int sign_shift = lsb_bits + (cp->codebook ? 2 - cp->codebook : -1);
- int32_t sign_huff_offset = cp->huff_offset;
-
- if (cp->codebook > 0)
- sign_huff_offset -= 7 << lsb_bits;
-
- if (sign_shift >= 0)
- sign_huff_offset -= 1 << sign_shift;
-
- return sign_huff_offset;
-}
-
-/** Read a sample, consisting of either, both or neither of entropy-coded MSBs
- * and plain LSBs. */
-
-static inline int read_huff_channels(MLPDecodeContext *m, GetBitContext *gbp,
- unsigned int substr, unsigned int pos)
-{
- SubStream *s = &m->substream[substr];
- unsigned int mat, channel;
-
- for (mat = 0; mat < s->num_primitive_matrices; mat++)
- if (s->lsb_bypass[mat])
- m->bypassed_lsbs[pos + s->blockpos][mat] = get_bits1(gbp);
-
- for (channel = s->min_channel; channel <= s->max_channel; channel++) {
- ChannelParams *cp = &s->channel_params[channel];
- int codebook = cp->codebook;
- int quant_step_size = s->quant_step_size[channel];
- int lsb_bits = cp->huff_lsbs - quant_step_size;
- int result = 0;
-
- if (codebook > 0)
- result = get_vlc2(gbp, huff_vlc[codebook-1].table,
- VLC_BITS, (9 + VLC_BITS - 1) / VLC_BITS);
-
- if (result < 0)
- return AVERROR_INVALIDDATA;
-
- if (lsb_bits > 0)
- result = (result << lsb_bits) + get_bits(gbp, lsb_bits);
-
- result += cp->sign_huff_offset;
- result <<= quant_step_size;
-
- m->sample_buffer[pos + s->blockpos][channel] = result;
- }
-
- return 0;
-}
-
-static av_cold int mlp_decode_init(AVCodecContext *avctx)
-{
- MLPDecodeContext *m = avctx->priv_data;
- int substr;
-
- init_static();
- m->avctx = avctx;
- for (substr = 0; substr < MAX_SUBSTREAMS; substr++)
- m->substream[substr].lossless_check_data = 0xffffffff;
- ff_mlpdsp_init(&m->dsp);
-
- return 0;
-}
-
-/** Read a major sync info header - contains high level information about
- * the stream - sample rate, channel arrangement etc. Most of this
- * information is not actually necessary for decoding, only for playback.
- */
-
-static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
-{
- MLPHeaderInfo mh;
- int substr, ret;
-
- if ((ret = ff_mlp_read_major_sync(m->avctx, &mh, gb)) != 0)
- return ret;
-
- if (mh.group1_bits == 0) {
- av_log(m->avctx, AV_LOG_ERROR, "invalid/unknown bits per sample\n");
- return AVERROR_INVALIDDATA;
- }
- if (mh.group2_bits > mh.group1_bits) {
- av_log(m->avctx, AV_LOG_ERROR,
- "Channel group 2 cannot have more bits per sample than group 1.\n");
- return AVERROR_INVALIDDATA;
- }
-
- if (mh.group2_samplerate && mh.group2_samplerate != mh.group1_samplerate) {
- av_log(m->avctx, AV_LOG_ERROR,
- "Channel groups with differing sample rates are not currently supported.\n");
- return AVERROR_INVALIDDATA;
- }
-
- if (mh.group1_samplerate == 0) {
- av_log(m->avctx, AV_LOG_ERROR, "invalid/unknown sampling rate\n");
- return AVERROR_INVALIDDATA;
- }
- if (mh.group1_samplerate > MAX_SAMPLERATE) {
- av_log(m->avctx, AV_LOG_ERROR,
- "Sampling rate %d is greater than the supported maximum (%d).\n",
- mh.group1_samplerate, MAX_SAMPLERATE);
- return AVERROR_INVALIDDATA;
- }
- if (mh.access_unit_size > MAX_BLOCKSIZE) {
- av_log(m->avctx, AV_LOG_ERROR,
- "Block size %d is greater than the supported maximum (%d).\n",
- mh.access_unit_size, MAX_BLOCKSIZE);
- return AVERROR_INVALIDDATA;
- }
- if (mh.access_unit_size_pow2 > MAX_BLOCKSIZE_POW2) {
- av_log(m->avctx, AV_LOG_ERROR,
- "Block size pow2 %d is greater than the supported maximum (%d).\n",
- mh.access_unit_size_pow2, MAX_BLOCKSIZE_POW2);
- return AVERROR_INVALIDDATA;
- }
-
- if (mh.num_substreams == 0)
- return AVERROR_INVALIDDATA;
- if (m->avctx->codec_id == AV_CODEC_ID_MLP && mh.num_substreams > 2) {
- av_log(m->avctx, AV_LOG_ERROR, "MLP only supports up to 2 substreams.\n");
- return AVERROR_INVALIDDATA;
- }
- if (mh.num_substreams > MAX_SUBSTREAMS) {
- avpriv_request_sample(m->avctx,
- "%d substreams (more than the "
- "maximum supported by the decoder)",
- mh.num_substreams);
- return AVERROR_PATCHWELCOME;
- }
-
- m->access_unit_size = mh.access_unit_size;
- m->access_unit_size_pow2 = mh.access_unit_size_pow2;
-
- m->num_substreams = mh.num_substreams;
- m->max_decoded_substream = m->num_substreams - 1;
-
- m->avctx->sample_rate = mh.group1_samplerate;
- m->avctx->frame_size = mh.access_unit_size;
-
- m->avctx->bits_per_raw_sample = mh.group1_bits;
- if (mh.group1_bits > 16)
- m->avctx->sample_fmt = AV_SAMPLE_FMT_S32;
- else
- m->avctx->sample_fmt = AV_SAMPLE_FMT_S16;
-
- m->params_valid = 1;
- for (substr = 0; substr < MAX_SUBSTREAMS; substr++)
- m->substream[substr].restart_seen = 0;
-
- /* Set the layout for each substream. When there's more than one, the first
- * substream is Stereo. Subsequent substreams' layouts are indicated in the
- * major sync. */
- if (m->avctx->codec_id == AV_CODEC_ID_MLP) {
- if ((substr = (mh.num_substreams > 1)))
- m->substream[0].ch_layout = AV_CH_LAYOUT_STEREO;
- m->substream[substr].ch_layout = mh.channel_layout_mlp;
- } else {
- if ((substr = (mh.num_substreams > 1)))
- m->substream[0].ch_layout = AV_CH_LAYOUT_STEREO;
- if (mh.num_substreams > 2)
- if (mh.channel_layout_thd_stream2)
- m->substream[2].ch_layout = mh.channel_layout_thd_stream2;
- else
- m->substream[2].ch_layout = mh.channel_layout_thd_stream1;
- m->substream[substr].ch_layout = mh.channel_layout_thd_stream1;
-
- if (m->avctx->channels<=2 && m->substream[substr].ch_layout == AV_CH_LAYOUT_MONO && m->max_decoded_substream == 1) {
- av_log(m->avctx, AV_LOG_DEBUG, "Mono stream with 2 substreams, ignoring 2nd\n");
- m->max_decoded_substream = 0;
- if (m->avctx->channels==2)
- m->avctx->channel_layout = AV_CH_LAYOUT_STEREO;
- }
- }
-
- m->needs_reordering = mh.channel_arrangement >= 18 && mh.channel_arrangement <= 20;
-
- return 0;
-}
-
-/** Read a restart header from a block in a substream. This contains parameters
- * required to decode the audio that do not change very often. Generally
- * (always) present only in blocks following a major sync. */
-
-static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
- const uint8_t *buf, unsigned int substr)
-{
- SubStream *s = &m->substream[substr];
- unsigned int ch;
- int sync_word, tmp;
- uint8_t checksum;
- uint8_t lossless_check;
- int start_count = get_bits_count(gbp);
- int min_channel, max_channel, max_matrix_channel;
- const int std_max_matrix_channel = m->avctx->codec_id == AV_CODEC_ID_MLP
- ? MAX_MATRIX_CHANNEL_MLP
- : MAX_MATRIX_CHANNEL_TRUEHD;
-
- sync_word = get_bits(gbp, 13);
-
- if (sync_word != 0x31ea >> 1) {
- av_log(m->avctx, AV_LOG_ERROR,
- "restart header sync incorrect (got 0x%04x)\n", sync_word);
- return AVERROR_INVALIDDATA;
- }
-
- s->noise_type = get_bits1(gbp);
-
- if (m->avctx->codec_id == AV_CODEC_ID_MLP && s->noise_type) {
- av_log(m->avctx, AV_LOG_ERROR, "MLP must have 0x31ea sync word.\n");
- return AVERROR_INVALIDDATA;
- }
-
- skip_bits(gbp, 16); /* Output timestamp */
-
- min_channel = get_bits(gbp, 4);
- max_channel = get_bits(gbp, 4);
- max_matrix_channel = get_bits(gbp, 4);
-
- if (max_matrix_channel > std_max_matrix_channel) {
- av_log(m->avctx, AV_LOG_ERROR,
- "Max matrix channel cannot be greater than %d.\n",
- std_max_matrix_channel);
- return AVERROR_INVALIDDATA;
- }
-
- if (max_channel != max_matrix_channel) {
- av_log(m->avctx, AV_LOG_ERROR,
- "Max channel must be equal max matrix channel.\n");
- return AVERROR_INVALIDDATA;
- }
-
- /* This should happen for TrueHD streams with >6 channels and MLP's noise
- * type. It is not yet known if this is allowed. */
- if (max_channel > MAX_MATRIX_CHANNEL_MLP && !s->noise_type) {
- avpriv_request_sample(m->avctx,
- "%d channels (more than the "
- "maximum supported by the decoder)",
- max_channel + 2);
- return AVERROR_PATCHWELCOME;
- }
-
- if (min_channel > max_channel) {
- av_log(m->avctx, AV_LOG_ERROR,
- "Substream min channel cannot be greater than max channel.\n");
- return AVERROR_INVALIDDATA;
- }
-
- s->min_channel = min_channel;
- s->max_channel = max_channel;
- s->max_matrix_channel = max_matrix_channel;
-
-#if FF_API_REQUEST_CHANNELS
-FF_DISABLE_DEPRECATION_WARNINGS
- if (m->avctx->request_channels > 0 &&
- m->avctx->request_channels <= s->max_channel + 1 &&
- m->max_decoded_substream > substr) {
- av_log(m->avctx, AV_LOG_DEBUG,
- "Extracting %d-channel downmix from substream %d. "
- "Further substreams will be skipped.\n",
- s->max_channel + 1, substr);
- m->max_decoded_substream = substr;
-FF_ENABLE_DEPRECATION_WARNINGS
- } else
-#endif
- if (m->avctx->request_channel_layout == s->ch_layout &&
- m->max_decoded_substream > substr) {
- av_log(m->avctx, AV_LOG_DEBUG,
- "Extracting %d-channel downmix (0x%"PRIx64") from substream %d. "
- "Further substreams will be skipped.\n",
- s->max_channel + 1, s->ch_layout, substr);
- m->max_decoded_substream = substr;
- }
-
- s->noise_shift = get_bits(gbp, 4);
- s->noisegen_seed = get_bits(gbp, 23);
-
- skip_bits(gbp, 19);
-
- s->data_check_present = get_bits1(gbp);
- lossless_check = get_bits(gbp, 8);
- if (substr == m->max_decoded_substream
- && s->lossless_check_data != 0xffffffff) {
- tmp = xor_32_to_8(s->lossless_check_data);
- if (tmp != lossless_check)
- av_log(m->avctx, AV_LOG_WARNING,
- "Lossless check failed - expected %02x, calculated %02x.\n",
- lossless_check, tmp);
- }
-
- skip_bits(gbp, 16);
-
- memset(s->ch_assign, 0, sizeof(s->ch_assign));
-
- for (ch = 0; ch <= s->max_matrix_channel; ch++) {
- int ch_assign = get_bits(gbp, 6);
- if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD) {
- uint64_t channel = thd_channel_layout_extract_channel(s->ch_layout,
- ch_assign);
- ch_assign = av_get_channel_layout_channel_index(s->ch_layout,
- channel);
- }
- if ((unsigned)ch_assign > s->max_matrix_channel) {
- avpriv_request_sample(m->avctx,
- "Assignment of matrix channel %d to invalid output channel %d",
- ch, ch_assign);
- return AVERROR_PATCHWELCOME;
- }
- s->ch_assign[ch_assign] = ch;
- }
-
- checksum = ff_mlp_restart_checksum(buf, get_bits_count(gbp) - start_count);
-
- if (checksum != get_bits(gbp, 8))
- av_log(m->avctx, AV_LOG_ERROR, "restart header checksum error\n");
-
- /* Set default decoding parameters. */
- s->param_presence_flags = 0xff;
- s->num_primitive_matrices = 0;
- s->blocksize = 8;
- s->lossless_check_data = 0;
-
- memset(s->output_shift , 0, sizeof(s->output_shift ));
- memset(s->quant_step_size, 0, sizeof(s->quant_step_size));
-
- for (ch = s->min_channel; ch <= s->max_channel; ch++) {
- ChannelParams *cp = &s->channel_params[ch];
- cp->filter_params[FIR].order = 0;
- cp->filter_params[IIR].order = 0;
- cp->filter_params[FIR].shift = 0;
- cp->filter_params[IIR].shift = 0;
-
- /* Default audio coding is 24-bit raw PCM. */
- cp->huff_offset = 0;
- cp->sign_huff_offset = (-1) << 23;
- cp->codebook = 0;
- cp->huff_lsbs = 24;
- }
-
- if (substr == m->max_decoded_substream) {
- m->avctx->channels = s->max_matrix_channel + 1;
- m->avctx->channel_layout = s->ch_layout;
-
- if (m->avctx->codec_id == AV_CODEC_ID_MLP && m->needs_reordering) {
- if (m->avctx->channel_layout == (AV_CH_LAYOUT_QUAD|AV_CH_LOW_FREQUENCY) ||
- m->avctx->channel_layout == AV_CH_LAYOUT_5POINT0_BACK) {
- int i = s->ch_assign[4];
- s->ch_assign[4] = s->ch_assign[3];
- s->ch_assign[3] = s->ch_assign[2];
- s->ch_assign[2] = i;
- } else if (m->avctx->channel_layout == AV_CH_LAYOUT_5POINT1_BACK) {
- FFSWAP(int, s->ch_assign[2], s->ch_assign[4]);
- FFSWAP(int, s->ch_assign[3], s->ch_assign[5]);
- }
- }
-
- }
-
- return 0;
-}
-
-/** Read parameters for one of the prediction filters. */
-
-static int read_filter_params(MLPDecodeContext *m, GetBitContext *gbp,
- unsigned int substr, unsigned int channel,
- unsigned int filter)
-{
- SubStream *s = &m->substream[substr];
- FilterParams *fp = &s->channel_params[channel].filter_params[filter];
- const int max_order = filter ? MAX_IIR_ORDER : MAX_FIR_ORDER;
- const char fchar = filter ? 'I' : 'F';
- int i, order;
-
- // Filter is 0 for FIR, 1 for IIR.
- av_assert0(filter < 2);
-
- if (m->filter_changed[channel][filter]++ > 1) {
- av_log(m->avctx, AV_LOG_ERROR, "Filters may change only once per access unit.\n");
- return AVERROR_INVALIDDATA;
- }
-
- order = get_bits(gbp, 4);
- if (order > max_order) {
- av_log(m->avctx, AV_LOG_ERROR,
- "%cIR filter order %d is greater than maximum %d.\n",
- fchar, order, max_order);
- return AVERROR_INVALIDDATA;
- }
- fp->order = order;
-
- if (order > 0) {
- int32_t *fcoeff = s->channel_params[channel].coeff[filter];
- int coeff_bits, coeff_shift;
-
- fp->shift = get_bits(gbp, 4);
-
- coeff_bits = get_bits(gbp, 5);
- coeff_shift = get_bits(gbp, 3);
- if (coeff_bits < 1 || coeff_bits > 16) {
- av_log(m->avctx, AV_LOG_ERROR,
- "%cIR filter coeff_bits must be between 1 and 16.\n",
- fchar);
- return AVERROR_INVALIDDATA;
- }
- if (coeff_bits + coeff_shift > 16) {
- av_log(m->avctx, AV_LOG_ERROR,
- "Sum of coeff_bits and coeff_shift for %cIR filter must be 16 or less.\n",
- fchar);
- return AVERROR_INVALIDDATA;
- }
-
- for (i = 0; i < order; i++)
- fcoeff[i] = get_sbits(gbp, coeff_bits) << coeff_shift;
-
- if (get_bits1(gbp)) {
- int state_bits, state_shift;
-
- if (filter == FIR) {
- av_log(m->avctx, AV_LOG_ERROR,
- "FIR filter has state data specified.\n");
- return AVERROR_INVALIDDATA;
- }
-
- state_bits = get_bits(gbp, 4);
- state_shift = get_bits(gbp, 4);
-
- /* TODO: Check validity of state data. */
-
- for (i = 0; i < order; i++)
- fp->state[i] = state_bits ? get_sbits(gbp, state_bits) << state_shift : 0;
- }
- }
-
- return 0;
-}
-
-/** Read parameters for primitive matrices. */
-
-static int read_matrix_params(MLPDecodeContext *m, unsigned int substr, GetBitContext *gbp)
-{
- SubStream *s = &m->substream[substr];
- unsigned int mat, ch;
- const int max_primitive_matrices = m->avctx->codec_id == AV_CODEC_ID_MLP
- ? MAX_MATRICES_MLP
- : MAX_MATRICES_TRUEHD;
-
- if (m->matrix_changed++ > 1) {
- av_log(m->avctx, AV_LOG_ERROR, "Matrices may change only once per access unit.\n");
- return AVERROR_INVALIDDATA;
- }
-
- s->num_primitive_matrices = get_bits(gbp, 4);
-
- if (s->num_primitive_matrices > max_primitive_matrices) {
- av_log(m->avctx, AV_LOG_ERROR,
- "Number of primitive matrices cannot be greater than %d.\n",
- max_primitive_matrices);
- return AVERROR_INVALIDDATA;
- }
-
- for (mat = 0; mat < s->num_primitive_matrices; mat++) {
- int frac_bits, max_chan;
- s->matrix_out_ch[mat] = get_bits(gbp, 4);
- frac_bits = get_bits(gbp, 4);
- s->lsb_bypass [mat] = get_bits1(gbp);
-
- if (s->matrix_out_ch[mat] > s->max_matrix_channel) {
- av_log(m->avctx, AV_LOG_ERROR,
- "Invalid channel %d specified as output from matrix.\n",
- s->matrix_out_ch[mat]);
- return AVERROR_INVALIDDATA;
- }
- if (frac_bits > 14) {
- av_log(m->avctx, AV_LOG_ERROR,
- "Too many fractional bits specified.\n");
- return AVERROR_INVALIDDATA;
- }
-
- max_chan = s->max_matrix_channel;
- if (!s->noise_type)
- max_chan+=2;
-
- for (ch = 0; ch <= max_chan; ch++) {
- int coeff_val = 0;
- if (get_bits1(gbp))
- coeff_val = get_sbits(gbp, frac_bits + 2);
-
- s->matrix_coeff[mat][ch] = coeff_val << (14 - frac_bits);
- }
-
- if (s->noise_type)
- s->matrix_noise_shift[mat] = get_bits(gbp, 4);
- else
- s->matrix_noise_shift[mat] = 0;
- }
-
- return 0;
-}
-
-/** Read channel parameters. */
-
-static int read_channel_params(MLPDecodeContext *m, unsigned int substr,
- GetBitContext *gbp, unsigned int ch)
-{
- SubStream *s = &m->substream[substr];
- ChannelParams *cp = &s->channel_params[ch];
- FilterParams *fir = &cp->filter_params[FIR];
- FilterParams *iir = &cp->filter_params[IIR];
- int ret;
-
- if (s->param_presence_flags & PARAM_FIR)
- if (get_bits1(gbp))
- if ((ret = read_filter_params(m, gbp, substr, ch, FIR)) < 0)
- return ret;
-
- if (s->param_presence_flags & PARAM_IIR)
- if (get_bits1(gbp))
- if ((ret = read_filter_params(m, gbp, substr, ch, IIR)) < 0)
- return ret;
-
- if (fir->order + iir->order > 8) {
- av_log(m->avctx, AV_LOG_ERROR, "Total filter orders too high.\n");
- return AVERROR_INVALIDDATA;
- }
-
- if (fir->order && iir->order &&
- fir->shift != iir->shift) {
- av_log(m->avctx, AV_LOG_ERROR,
- "FIR and IIR filters must use the same precision.\n");
- return AVERROR_INVALIDDATA;
- }
- /* The FIR and IIR filters must have the same precision.
- * To simplify the filtering code, only the precision of the
- * FIR filter is considered. If only the IIR filter is employed,
- * the FIR filter precision is set to that of the IIR filter, so
- * that the filtering code can use it. */
- if (!fir->order && iir->order)
- fir->shift = iir->shift;
-
- if (s->param_presence_flags & PARAM_HUFFOFFSET)
- if (get_bits1(gbp))
- cp->huff_offset = get_sbits(gbp, 15);
-
- cp->codebook = get_bits(gbp, 2);
- cp->huff_lsbs = get_bits(gbp, 5);
-
- if (cp->huff_lsbs > 24) {
- av_log(m->avctx, AV_LOG_ERROR, "Invalid huff_lsbs.\n");
- cp->huff_lsbs = 0;
- return AVERROR_INVALIDDATA;
- }
-
- cp->sign_huff_offset = calculate_sign_huff(m, substr, ch);
-
- return 0;
-}
-
-/** Read decoding parameters that change more often than those in the restart
- * header. */
-
-static int read_decoding_params(MLPDecodeContext *m, GetBitContext *gbp,
- unsigned int substr)
-{
- SubStream *s = &m->substream[substr];
- unsigned int ch;
- int ret;
-
- if (s->param_presence_flags & PARAM_PRESENCE)
- if (get_bits1(gbp))
- s->param_presence_flags = get_bits(gbp, 8);
-
- if (s->param_presence_flags & PARAM_BLOCKSIZE)
- if (get_bits1(gbp)) {
- s->blocksize = get_bits(gbp, 9);
- if (s->blocksize < 8 || s->blocksize > m->access_unit_size) {
- av_log(m->avctx, AV_LOG_ERROR, "Invalid blocksize.\n");
- s->blocksize = 0;
- return AVERROR_INVALIDDATA;
- }
- }
-
- if (s->param_presence_flags & PARAM_MATRIX)
- if (get_bits1(gbp))
- if ((ret = read_matrix_params(m, substr, gbp)) < 0)
- return ret;
-
- if (s->param_presence_flags & PARAM_OUTSHIFT)
- if (get_bits1(gbp))
- for (ch = 0; ch <= s->max_matrix_channel; ch++)
- s->output_shift[ch] = get_sbits(gbp, 4);
-
- if (s->param_presence_flags & PARAM_QUANTSTEP)
- if (get_bits1(gbp))
- for (ch = 0; ch <= s->max_channel; ch++) {
- ChannelParams *cp = &s->channel_params[ch];
-
- s->quant_step_size[ch] = get_bits(gbp, 4);
-
- cp->sign_huff_offset = calculate_sign_huff(m, substr, ch);
- }
-
- for (ch = s->min_channel; ch <= s->max_channel; ch++)
- if (get_bits1(gbp))
- if ((ret = read_channel_params(m, substr, gbp, ch)) < 0)
- return ret;
-
- return 0;
-}
-
-#define MSB_MASK(bits) (-1u << bits)
-
-/** Generate PCM samples using the prediction filters and residual values
- * read from the data stream, and update the filter state. */
-
-static void filter_channel(MLPDecodeContext *m, unsigned int substr,
- unsigned int channel)
-{
- SubStream *s = &m->substream[substr];
- const int32_t *fircoeff = s->channel_params[channel].coeff[FIR];
- int32_t state_buffer[NUM_FILTERS][MAX_BLOCKSIZE + MAX_FIR_ORDER];
- int32_t *firbuf = state_buffer[FIR] + MAX_BLOCKSIZE;
- int32_t *iirbuf = state_buffer[IIR] + MAX_BLOCKSIZE;
- FilterParams *fir = &s->channel_params[channel].filter_params[FIR];
- FilterParams *iir = &s->channel_params[channel].filter_params[IIR];
- unsigned int filter_shift = fir->shift;
- int32_t mask = MSB_MASK(s->quant_step_size[channel]);
-
- memcpy(firbuf, fir->state, MAX_FIR_ORDER * sizeof(int32_t));
- memcpy(iirbuf, iir->state, MAX_IIR_ORDER * sizeof(int32_t));
-
- m->dsp.mlp_filter_channel(firbuf, fircoeff,
- fir->order, iir->order,
- filter_shift, mask, s->blocksize,
- &m->sample_buffer[s->blockpos][channel]);
-
- memcpy(fir->state, firbuf - s->blocksize, MAX_FIR_ORDER * sizeof(int32_t));
- memcpy(iir->state, iirbuf - s->blocksize, MAX_IIR_ORDER * sizeof(int32_t));
-}
-
-/** Read a block of PCM residual data (or actual if no filtering active). */
-
-static int read_block_data(MLPDecodeContext *m, GetBitContext *gbp,
- unsigned int substr)
-{
- SubStream *s = &m->substream[substr];
- unsigned int i, ch, expected_stream_pos = 0;
- int ret;
-
- if (s->data_check_present) {
- expected_stream_pos = get_bits_count(gbp);
- expected_stream_pos += get_bits(gbp, 16);
- avpriv_request_sample(m->avctx,
- "Substreams with VLC block size check info");
- }
-
- if (s->blockpos + s->blocksize > m->access_unit_size) {
- av_log(m->avctx, AV_LOG_ERROR, "too many audio samples in frame\n");
- return AVERROR_INVALIDDATA;
- }
-
- memset(&m->bypassed_lsbs[s->blockpos][0], 0,
- s->blocksize * sizeof(m->bypassed_lsbs[0]));
-
- for (i = 0; i < s->blocksize; i++)
- if ((ret = read_huff_channels(m, gbp, substr, i)) < 0)
- return ret;
-
- for (ch = s->min_channel; ch <= s->max_channel; ch++)
- filter_channel(m, substr, ch);
-
- s->blockpos += s->blocksize;
-
- if (s->data_check_present) {
- if (get_bits_count(gbp) != expected_stream_pos)
- av_log(m->avctx, AV_LOG_ERROR, "block data length mismatch\n");
- skip_bits(gbp, 8);
- }
-
- return 0;
-}
-
-/** Data table used for TrueHD noise generation function. */
-
-static const int8_t noise_table[256] = {
- 30, 51, 22, 54, 3, 7, -4, 38, 14, 55, 46, 81, 22, 58, -3, 2,
- 52, 31, -7, 51, 15, 44, 74, 30, 85, -17, 10, 33, 18, 80, 28, 62,
- 10, 32, 23, 69, 72, 26, 35, 17, 73, 60, 8, 56, 2, 6, -2, -5,
- 51, 4, 11, 50, 66, 76, 21, 44, 33, 47, 1, 26, 64, 48, 57, 40,
- 38, 16, -10, -28, 92, 22, -18, 29, -10, 5, -13, 49, 19, 24, 70, 34,
- 61, 48, 30, 14, -6, 25, 58, 33, 42, 60, 67, 17, 54, 17, 22, 30,
- 67, 44, -9, 50, -11, 43, 40, 32, 59, 82, 13, 49, -14, 55, 60, 36,
- 48, 49, 31, 47, 15, 12, 4, 65, 1, 23, 29, 39, 45, -2, 84, 69,
- 0, 72, 37, 57, 27, 41, -15, -16, 35, 31, 14, 61, 24, 0, 27, 24,
- 16, 41, 55, 34, 53, 9, 56, 12, 25, 29, 53, 5, 20, -20, -8, 20,
- 13, 28, -3, 78, 38, 16, 11, 62, 46, 29, 21, 24, 46, 65, 43, -23,
- 89, 18, 74, 21, 38, -12, 19, 12, -19, 8, 15, 33, 4, 57, 9, -8,
- 36, 35, 26, 28, 7, 83, 63, 79, 75, 11, 3, 87, 37, 47, 34, 40,
- 39, 19, 20, 42, 27, 34, 39, 77, 13, 42, 59, 64, 45, -1, 32, 37,
- 45, -5, 53, -6, 7, 36, 50, 23, 6, 32, 9, -21, 18, 71, 27, 52,
- -25, 31, 35, 42, -1, 68, 63, 52, 26, 43, 66, 37, 41, 25, 40, 70,
-};
-
-/** Noise generation functions.
- * I'm not sure what these are for - they seem to be some kind of pseudorandom
- * sequence generators, used to generate noise data which is used when the
- * channels are rematrixed. I'm not sure if they provide a practical benefit
- * to compression, or just obfuscate the decoder. Are they for some kind of
- * dithering? */
-
-/** Generate two channels of noise, used in the matrix when
- * restart sync word == 0x31ea. */
-
-static void generate_2_noise_channels(MLPDecodeContext *m, unsigned int substr)
-{
- SubStream *s = &m->substream[substr];
- unsigned int i;
- uint32_t seed = s->noisegen_seed;
- unsigned int maxchan = s->max_matrix_channel;
-
- for (i = 0; i < s->blockpos; i++) {
- uint16_t seed_shr7 = seed >> 7;
- m->sample_buffer[i][maxchan+1] = ((int8_t)(seed >> 15)) << s->noise_shift;
- m->sample_buffer[i][maxchan+2] = ((int8_t) seed_shr7) << s->noise_shift;
-
- seed = (seed << 16) ^ seed_shr7 ^ (seed_shr7 << 5);
- }
-
- s->noisegen_seed = seed;
-}
-
-/** Generate a block of noise, used when restart sync word == 0x31eb. */
-
-static void fill_noise_buffer(MLPDecodeContext *m, unsigned int substr)
-{
- SubStream *s = &m->substream[substr];
- unsigned int i;
- uint32_t seed = s->noisegen_seed;
-
- for (i = 0; i < m->access_unit_size_pow2; i++) {
- uint8_t seed_shr15 = seed >> 15;
- m->noise_buffer[i] = noise_table[seed_shr15];
- seed = (seed << 8) ^ seed_shr15 ^ (seed_shr15 << 5);
- }
-
- s->noisegen_seed = seed;
-}
-
-
-/** Apply the channel matrices in turn to reconstruct the original audio
- * samples. */
-
-static void rematrix_channels(MLPDecodeContext *m, unsigned int substr)
-{
- SubStream *s = &m->substream[substr];
- unsigned int mat, src_ch, i;
- unsigned int maxchan;
-
- maxchan = s->max_matrix_channel;
- if (!s->noise_type) {
- generate_2_noise_channels(m, substr);
- maxchan += 2;
- } else {
- fill_noise_buffer(m, substr);
- }
-
- for (mat = 0; mat < s->num_primitive_matrices; mat++) {
- int matrix_noise_shift = s->matrix_noise_shift[mat];
- unsigned int dest_ch = s->matrix_out_ch[mat];
- int32_t mask = MSB_MASK(s->quant_step_size[dest_ch]);
- int32_t *coeffs = s->matrix_coeff[mat];
- int index = s->num_primitive_matrices - mat;
- int index2 = 2 * index + 1;
-
- /* TODO: DSPContext? */
-
- for (i = 0; i < s->blockpos; i++) {
- int32_t bypassed_lsb = m->bypassed_lsbs[i][mat];
- int32_t *samples = m->sample_buffer[i];
- int64_t accum = 0;
-
- for (src_ch = 0; src_ch <= maxchan; src_ch++)
- accum += (int64_t) samples[src_ch] * coeffs[src_ch];
-
- if (matrix_noise_shift) {
- index &= m->access_unit_size_pow2 - 1;
- accum += m->noise_buffer[index] << (matrix_noise_shift + 7);
- index += index2;
- }
-
- samples[dest_ch] = ((accum >> 14) & mask) + bypassed_lsb;
- }
- }
-}
-
-/** Write the audio data into the output buffer. */
-
-static int output_data(MLPDecodeContext *m, unsigned int substr,
- AVFrame *frame, int *got_frame_ptr)
-{
- AVCodecContext *avctx = m->avctx;
- SubStream *s = &m->substream[substr];
- unsigned int i, out_ch = 0;
- int32_t *data_32;
- int16_t *data_16;
- int ret;
- int is32 = (m->avctx->sample_fmt == AV_SAMPLE_FMT_S32);
-
- if (m->avctx->channels != s->max_matrix_channel + 1) {
- av_log(m->avctx, AV_LOG_ERROR, "channel count mismatch\n");
- return AVERROR_INVALIDDATA;
- }
-
- if (!s->blockpos) {
- av_log(avctx, AV_LOG_ERROR, "No samples to output.\n");
- return AVERROR_INVALIDDATA;
- }
-
- /* get output buffer */
- frame->nb_samples = s->blockpos;
- if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
- return ret;
- data_32 = (int32_t *)frame->data[0];
- data_16 = (int16_t *)frame->data[0];
-
- for (i = 0; i < s->blockpos; i++) {
- for (out_ch = 0; out_ch <= s->max_matrix_channel; out_ch++) {
- int mat_ch = s->ch_assign[out_ch];
- int32_t sample = m->sample_buffer[i][mat_ch]
- << s->output_shift[mat_ch];
- s->lossless_check_data ^= (sample & 0xffffff) << mat_ch;
- if (is32) *data_32++ = sample << 8;
- else *data_16++ = sample >> 8;
- }
- }
-
- *got_frame_ptr = 1;
-
- return 0;
-}
-
-/** Read an access unit from the stream.
- * @return negative on error, 0 if not enough data is present in the input stream,
- * otherwise the number of bytes consumed. */
-
-static int read_access_unit(AVCodecContext *avctx, void* data,
- int *got_frame_ptr, AVPacket *avpkt)
-{
- const uint8_t *buf = avpkt->data;
- int buf_size = avpkt->size;
- MLPDecodeContext *m = avctx->priv_data;
- GetBitContext gb;
- unsigned int length, substr;
- unsigned int substream_start;
- unsigned int header_size = 4;
- unsigned int substr_header_size = 0;
- uint8_t substream_parity_present[MAX_SUBSTREAMS];
- uint16_t substream_data_len[MAX_SUBSTREAMS];
- uint8_t parity_bits;
- int ret;
-
- if (buf_size < 4)
- return AVERROR_INVALIDDATA;
-
- length = (AV_RB16(buf) & 0xfff) * 2;
-
- if (length < 4 || length > buf_size)
- return AVERROR_INVALIDDATA;
-
- init_get_bits(&gb, (buf + 4), (length - 4) * 8);
-
- m->is_major_sync_unit = 0;
- if (show_bits_long(&gb, 31) == (0xf8726fba >> 1)) {
- if (read_major_sync(m, &gb) < 0)
- goto error;
- m->is_major_sync_unit = 1;
- header_size += 28;
- }
-
- if (!m->params_valid) {
- av_log(m->avctx, AV_LOG_WARNING,
- "Stream parameters not seen; skipping frame.\n");
- *got_frame_ptr = 0;
- return length;
- }
-
- substream_start = 0;
-
- for (substr = 0; substr < m->num_substreams; substr++) {
- int extraword_present, checkdata_present, end, nonrestart_substr;
-
- extraword_present = get_bits1(&gb);
- nonrestart_substr = get_bits1(&gb);
- checkdata_present = get_bits1(&gb);
- skip_bits1(&gb);
-
- end = get_bits(&gb, 12) * 2;
-
- substr_header_size += 2;
-
- if (extraword_present) {
- if (m->avctx->codec_id == AV_CODEC_ID_MLP) {
- av_log(m->avctx, AV_LOG_ERROR, "There must be no extraword for MLP.\n");
- goto error;
- }
- skip_bits(&gb, 16);
- substr_header_size += 2;
- }
-
- if (!(nonrestart_substr ^ m->is_major_sync_unit)) {
- av_log(m->avctx, AV_LOG_ERROR, "Invalid nonrestart_substr.\n");
- goto error;
- }
-
- if (end + header_size + substr_header_size > length) {
- av_log(m->avctx, AV_LOG_ERROR,
- "Indicated length of substream %d data goes off end of "
- "packet.\n", substr);
- end = length - header_size - substr_header_size;
- }
-
- if (end < substream_start) {
- av_log(avctx, AV_LOG_ERROR,
- "Indicated end offset of substream %d data "
- "is smaller than calculated start offset.\n",
- substr);
- goto error;
- }
-
- if (substr > m->max_decoded_substream)
- continue;
-
- substream_parity_present[substr] = checkdata_present;
- substream_data_len[substr] = end - substream_start;
- substream_start = end;
- }
-
- parity_bits = ff_mlp_calculate_parity(buf, 4);
- parity_bits ^= ff_mlp_calculate_parity(buf + header_size, substr_header_size);
-
- if ((((parity_bits >> 4) ^ parity_bits) & 0xF) != 0xF) {
- av_log(avctx, AV_LOG_ERROR, "Parity check failed.\n");
- goto error;
- }
-
- buf += header_size + substr_header_size;
-
- for (substr = 0; substr <= m->max_decoded_substream; substr++) {
- SubStream *s = &m->substream[substr];
- init_get_bits(&gb, buf, substream_data_len[substr] * 8);
-
- m->matrix_changed = 0;
- memset(m->filter_changed, 0, sizeof(m->filter_changed));
-
- s->blockpos = 0;
- do {
- if (get_bits1(&gb)) {
- if (get_bits1(&gb)) {
- /* A restart header should be present. */
- if (read_restart_header(m, &gb, buf, substr) < 0)
- goto next_substr;
- s->restart_seen = 1;
- }
-
- if (!s->restart_seen)
- goto next_substr;
- if (read_decoding_params(m, &gb, substr) < 0)
- goto next_substr;
- }
-
- if (!s->restart_seen)
- goto next_substr;
-
- if ((ret = read_block_data(m, &gb, substr)) < 0)
- return ret;
-
- if (get_bits_count(&gb) >= substream_data_len[substr] * 8)
- goto substream_length_mismatch;
-
- } while (!get_bits1(&gb));
-
- skip_bits(&gb, (-get_bits_count(&gb)) & 15);
-
- if (substream_data_len[substr] * 8 - get_bits_count(&gb) >= 32) {
- int shorten_by;
-
- if (get_bits(&gb, 16) != 0xD234)
- return AVERROR_INVALIDDATA;
-
- shorten_by = get_bits(&gb, 16);
- if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD && shorten_by & 0x2000)
- s->blockpos -= FFMIN(shorten_by & 0x1FFF, s->blockpos);
- else if (m->avctx->codec_id == AV_CODEC_ID_MLP && shorten_by != 0xD234)
- return AVERROR_INVALIDDATA;
-
- if (substr == m->max_decoded_substream)
- av_log(m->avctx, AV_LOG_INFO, "End of stream indicated.\n");
- }
-
- if (substream_parity_present[substr]) {
- uint8_t parity, checksum;
-
- if (substream_data_len[substr] * 8 - get_bits_count(&gb) != 16)
- goto substream_length_mismatch;
-
- parity = ff_mlp_calculate_parity(buf, substream_data_len[substr] - 2);
- checksum = ff_mlp_checksum8 (buf, substream_data_len[substr] - 2);
-
- if ((get_bits(&gb, 8) ^ parity) != 0xa9 )
- av_log(m->avctx, AV_LOG_ERROR, "Substream %d parity check failed.\n", substr);
- if ( get_bits(&gb, 8) != checksum)
- av_log(m->avctx, AV_LOG_ERROR, "Substream %d checksum failed.\n" , substr);
- }
-
- if (substream_data_len[substr] * 8 != get_bits_count(&gb))
- goto substream_length_mismatch;
-
-next_substr:
- if (!s->restart_seen)
- av_log(m->avctx, AV_LOG_ERROR,
- "No restart header present in substream %d.\n", substr);
-
- buf += substream_data_len[substr];
- }
-
- rematrix_channels(m, m->max_decoded_substream);
-
- if ((ret = output_data(m, m->max_decoded_substream, data, got_frame_ptr)) < 0)
- return ret;
-
- return length;
-
-substream_length_mismatch:
- av_log(m->avctx, AV_LOG_ERROR, "substream %d length mismatch\n", substr);
- return AVERROR_INVALIDDATA;
-
-error:
- m->params_valid = 0;
- return AVERROR_INVALIDDATA;
-}
-
-#if CONFIG_MLP_DECODER
-AVCodec ff_mlp_decoder = {
- .name = "mlp",
- .long_name = NULL_IF_CONFIG_SMALL("MLP (Meridian Lossless Packing)"),
- .type = AVMEDIA_TYPE_AUDIO,
- .id = AV_CODEC_ID_MLP,
- .priv_data_size = sizeof(MLPDecodeContext),
- .init = mlp_decode_init,
- .decode = read_access_unit,
- .capabilities = CODEC_CAP_DR1,
-};
-#endif
-#if CONFIG_TRUEHD_DECODER
-AVCodec ff_truehd_decoder = {
- .name = "truehd",
- .long_name = NULL_IF_CONFIG_SMALL("TrueHD"),
- .type = AVMEDIA_TYPE_AUDIO,
- .id = AV_CODEC_ID_TRUEHD,
- .priv_data_size = sizeof(MLPDecodeContext),
- .init = mlp_decode_init,
- .decode = read_access_unit,
- .capabilities = CODEC_CAP_DR1,
-};
-#endif /* CONFIG_TRUEHD_DECODER */
diff --git a/libavcodec/mlpdsp.c b/libavcodec/mlpdsp.c
deleted file mode 100644
index b413e86..0000000
--- a/libavcodec/mlpdsp.c
+++ b/dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Ian Caulfield
- * 2009 Ramiro Polla
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General 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 "config.h"
-#include "libavutil/attributes.h"
-#include "mlpdsp.h"
-#include "mlp.h"
-
-static void mlp_filter_channel(int32_t *state, const int32_t *coeff,
- int firorder, int iirorder,
- unsigned int filter_shift, int32_t mask,
- int blocksize, int32_t *sample_buffer)
-{
- int32_t *firbuf = state;
- int32_t *iirbuf = state + MAX_BLOCKSIZE + MAX_FIR_ORDER;
- const int32_t *fircoeff = coeff;
- const int32_t *iircoeff = coeff + MAX_FIR_ORDER;
- int i;
-
- for (i = 0; i < blocksize; i++) {
- int32_t residual = *sample_buffer;
- unsigned int order;
- int64_t accum = 0;
- int32_t result;
-
- for (order = 0; order < firorder; order++)
- accum += (int64_t) firbuf[order] * fircoeff[order];
- for (order = 0; order < iirorder; order++)
- accum += (int64_t) iirbuf[order] * iircoeff[order];
-
- accum = accum >> filter_shift;
- result = (accum + residual) & mask;
-
- *--firbuf = result;
- *--iirbuf = result - accum;
-
- *sample_buffer = result;
- sample_buffer += MAX_CHANNELS;
- }
-}
-
-av_cold void ff_mlpdsp_init(MLPDSPContext *c)
-{
- c->mlp_filter_channel = mlp_filter_channel;
- if (ARCH_X86)
- ff_mlpdsp_init_x86(c);
-}
diff --git a/libavcodec/mlpdsp.h b/libavcodec/mlpdsp.h
deleted file mode 100644
index 84a8aa3..0000000
--- a/libavcodec/mlpdsp.h
+++ b/dev/null
@@ -1,37 +0,0 @@
-/*
- * MLP codec common header file
- * Copyright (c) 2007-2008 Ian Caulfield
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General 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_MLPDSP_H
-#define AVCODEC_MLPDSP_H
-
-#include <stdint.h>
-
-typedef struct MLPDSPContext {
- void (*mlp_filter_channel)(int32_t *state, const int32_t *coeff,
- int firorder, int iirorder,
- unsigned int filter_shift, int32_t mask,
- int blocksize, int32_t *sample_buffer);
-} MLPDSPContext;
-
-void ff_mlpdsp_init(MLPDSPContext *c);
-void ff_mlpdsp_init_x86(MLPDSPContext *c);
-
-#endif /* AVCODEC_MLPDSP_H */
diff --git a/libavcodec/synth_filter.c b/libavcodec/synth_filter.c
index 5f10530..54cd44a 100644
--- a/libavcodec/synth_filter.c
+++ b/libavcodec/synth_filter.c
@@ -60,5 +60,5 @@ av_cold void ff_synth_filter_init(SynthFilterContext *c)
{
c->synth_filter_float = synth_filter_float;
- if (ARCH_ARM) ff_synth_filter_init_arm(c);
+ //if (ARCH_ARM) ff_synth_filter_init_arm(c);
}
diff --git a/libavcodec/x86/ac3dsp.asm b/libavcodec/x86/ac3dsp.asm
deleted file mode 100644
index 89a64f5..0000000
--- a/libavcodec/x86/ac3dsp.asm
+++ b/dev/null
@@ -1,421 +0,0 @@
-;*****************************************************************************
-;* x86-optimized AC-3 DSP utils
-;* Copyright (c) 2011 Justin Ruggles
-;*
-;* This file is part of FFmpeg.
-;*
-;* FFmpeg is free software; you can redistribute it and/or
-;* modify it under the terms of the GNU Lesser General Public
-;* License as published by the Free Software Foundation; either
-;* version 2.1 of the License, or (at your option) any later version.
-;*
-;* FFmpeg is distributed in the hope that it will be useful,
-;* but WITHOUT ANY WARRANTY; without even the implied warranty of
-;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;* Lesser General Public License for more details.
-;*
-;* You should have received a copy of the GNU Lesser General 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 "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-; 16777216.0f - used in ff_float_to_fixed24()
-pf_1_24: times 4 dd 0x4B800000
-
-; used in ff_ac3_compute_mantissa_size()
-cextern ac3_bap_bits
-pw_bap_mul1: dw 21846, 21846, 0, 32768, 21846, 21846, 0, 32768
-pw_bap_mul2: dw 5, 7, 0, 7, 5, 7, 0, 7
-
-; used in ff_ac3_extract_exponents()
-pd_1: times 4 dd 1
-pd_151: times 4 dd 151
-
-SECTION .text
-
-;-----------------------------------------------------------------------------
-; void ff_ac3_exponent_min(uint8_t *exp, int num_reuse_blocks, int nb_coefs)
-;-----------------------------------------------------------------------------
-
-%macro AC3_EXPONENT_MIN 0
-cglobal ac3_exponent_min, 3, 4, 2, exp, reuse_blks, expn, offset
- shl reuse_blksq, 8
- jz .end
- LOOP_ALIGN
-.nextexp:
- mov offsetq, reuse_blksq
- mova m0, [expq+offsetq]
- sub offsetq, 256
- LOOP_ALIGN
-.nextblk:
- PMINUB m0, [expq+offsetq], m1
- sub offsetq, 256
- jae .nextblk
- mova [expq], m0
- add expq, mmsize
- sub expnq, mmsize
- jg .nextexp
-.end:
- REP_RET
-%endmacro
-
-%define LOOP_ALIGN
-INIT_MMX mmx
-AC3_EXPONENT_MIN
-%if HAVE_MMXEXT_EXTERNAL
-%define LOOP_ALIGN ALIGN 16
-INIT_MMX mmxext
-AC3_EXPONENT_MIN
-%endif
-%if HAVE_SSE2_EXTERNAL
-INIT_XMM sse2
-AC3_EXPONENT_MIN
-%endif
-%undef LOOP_ALIGN
-
-;-----------------------------------------------------------------------------
-; int ff_ac3_max_msb_abs_int16(const int16_t *src, int len)
-;
-; This function uses 2 different methods to calculate a valid result.
-; 1) logical 'or' of abs of each element
-; This is used for ssse3 because of the pabsw instruction.
-; It is also used for mmx because of the lack of min/max instructions.
-; 2) calculate min/max for the array, then or(abs(min),abs(max))
-; This is used for mmxext and sse2 because they have pminsw/pmaxsw.
-;-----------------------------------------------------------------------------
-
-; logical 'or' of 4 or 8 words in an mmx or xmm register into the low word
-%macro OR_WORDS_HORIZ 2 ; src, tmp
-%if cpuflag(sse2)
- movhlps %2, %1
- por %1, %2
- pshuflw %2, %1, q0032
- por %1, %2
- pshuflw %2, %1, q0001
- por %1, %2
-%elif cpuflag(mmxext)
- pshufw %2, %1, q0032
- por %1, %2
- pshufw %2, %1, q0001
- por %1, %2
-%else ; mmx
- movq %2, %1
- psrlq %2, 32
- por %1, %2
- movq %2, %1
- psrlq %2, 16
- por %1, %2
-%endif
-%endmacro
-
-%macro AC3_MAX_MSB_ABS_INT16 1
-cglobal ac3_max_msb_abs_int16, 2,2,5, src, len
- pxor m2, m2
- pxor m3, m3
-.loop:
-%ifidn %1, min_max
- mova m0, [srcq]
- mova m1, [srcq+mmsize]
- pminsw m2, m0
- pminsw m2, m1
- pmaxsw m3, m0
- pmaxsw m3, m1
-%else ; or_abs
-%if notcpuflag(ssse3)
- mova m0, [srcq]
- mova m1, [srcq+mmsize]
- ABS2 m0, m1, m3, m4
-%else ; ssse3
- ; using memory args is faster for ssse3
- pabsw m0, [srcq]
- pabsw m1, [srcq+mmsize]
-%endif
- por m2, m0
- por m2, m1
-%endif
- add srcq, mmsize*2
- sub lend, mmsize
- ja .loop
-%ifidn %1, min_max
- ABS2 m2, m3, m0, m1
- por m2, m3
-%endif
- OR_WORDS_HORIZ m2, m0
- movd eax, m2
- and eax, 0xFFFF
- RET
-%endmacro
-
-INIT_MMX mmx
-AC3_MAX_MSB_ABS_INT16 or_abs
-INIT_MMX mmxext
-AC3_MAX_MSB_ABS_INT16 min_max
-INIT_XMM sse2
-AC3_MAX_MSB_ABS_INT16 min_max
-INIT_XMM ssse3
-AC3_MAX_MSB_ABS_INT16 or_abs
-
-;-----------------------------------------------------------------------------
-; macro used for ff_ac3_lshift_int16() and ff_ac3_rshift_int32()
-;-----------------------------------------------------------------------------
-
-%macro AC3_SHIFT 3 ; l/r, 16/32, shift instruction, instruction set
-cglobal ac3_%1shift_int%2, 3, 3, 5, src, len, shift
- movd m0, shiftd
-.loop:
- mova m1, [srcq ]
- mova m2, [srcq+mmsize ]
- mova m3, [srcq+mmsize*2]
- mova m4, [srcq+mmsize*3]
- %3 m1, m0
- %3 m2, m0
- %3 m3, m0
- %3 m4, m0
- mova [srcq ], m1
- mova [srcq+mmsize ], m2
- mova [srcq+mmsize*2], m3
- mova [srcq+mmsize*3], m4
- add srcq, mmsize*4
- sub lend, mmsize*32/%2
- ja .loop
-.end:
- REP_RET
-%endmacro
-
-;-----------------------------------------------------------------------------
-; void ff_ac3_lshift_int16(int16_t *src, unsigned int len, unsigned int shift)
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmx
-AC3_SHIFT l, 16, psllw
-INIT_XMM sse2
-AC3_SHIFT l, 16, psllw
-
-;-----------------------------------------------------------------------------
-; void ff_ac3_rshift_int32(int32_t *src, unsigned int len, unsigned int shift)
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmx
-AC3_SHIFT r, 32, psrad
-INIT_XMM sse2
-AC3_SHIFT r, 32, psrad
-
-;-----------------------------------------------------------------------------
-; void ff_float_to_fixed24(int32_t *dst, const float *src, unsigned int len)
-;-----------------------------------------------------------------------------
-
-; The 3DNow! version is not bit-identical because pf2id uses truncation rather
-; than round-to-nearest.
-INIT_MMX 3dnow
-cglobal float_to_fixed24, 3, 3, 0, dst, src, len
- movq m0, [pf_1_24]
-.loop:
- movq m1, [srcq ]
- movq m2, [srcq+8 ]
- movq m3, [srcq+16]
- movq m4, [srcq+24]
- pfmul m1, m0
- pfmul m2, m0
- pfmul m3, m0
- pfmul m4, m0
- pf2id m1, m1
- pf2id m2, m2
- pf2id m3, m3
- pf2id m4, m4
- movq [dstq ], m1
- movq [dstq+8 ], m2
- movq [dstq+16], m3
- movq [dstq+24], m4
- add srcq, 32
- add dstq, 32
- sub lend, 8
- ja .loop
- femms
- RET
-
-INIT_XMM sse
-cglobal float_to_fixed24, 3, 3, 3, dst, src, len
- movaps m0, [pf_1_24]
-.loop:
- movaps m1, [srcq ]
- movaps m2, [srcq+16]
- mulps m1, m0
- mulps m2, m0
- cvtps2pi mm0, m1
- movhlps m1, m1
- cvtps2pi mm1, m1
- cvtps2pi mm2, m2
- movhlps m2, m2
- cvtps2pi mm3, m2
- movq [dstq ], mm0
- movq [dstq+ 8], mm1
- movq [dstq+16], mm2
- movq [dstq+24], mm3
- add srcq, 32
- add dstq, 32
- sub lend, 8
- ja .loop
- emms
- RET
-
-INIT_XMM sse2
-cglobal float_to_fixed24, 3, 3, 9, dst, src, len
- movaps m0, [pf_1_24]
-.loop:
- movaps m1, [srcq ]
- movaps m2, [srcq+16 ]
- movaps m3, [srcq+32 ]
- movaps m4, [srcq+48 ]
-%ifdef m8
- movaps m5, [srcq+64 ]
- movaps m6, [srcq+80 ]
- movaps m7, [srcq+96 ]
- movaps m8, [srcq+112]
-%endif
- mulps m1, m0
- mulps m2, m0
- mulps m3, m0
- mulps m4, m0
-%ifdef m8
- mulps m5, m0
- mulps m6, m0
- mulps m7, m0
- mulps m8, m0
-%endif
- cvtps2dq m1, m1
- cvtps2dq m2, m2
- cvtps2dq m3, m3
- cvtps2dq m4, m4
-%ifdef m8
- cvtps2dq m5, m5
- cvtps2dq m6, m6
- cvtps2dq m7, m7
- cvtps2dq m8, m8
-%endif
- movdqa [dstq ], m1
- movdqa [dstq+16 ], m2
- movdqa [dstq+32 ], m3
- movdqa [dstq+48 ], m4
-%ifdef m8
- movdqa [dstq+64 ], m5
- movdqa [dstq+80 ], m6
- movdqa [dstq+96 ], m7
- movdqa [dstq+112], m8
- add srcq, 128
- add dstq, 128
- sub lenq, 32
-%else
- add srcq, 64
- add dstq, 64
- sub lenq, 16
-%endif
- ja .loop
- REP_RET
-
-;------------------------------------------------------------------------------
-; int ff_ac3_compute_mantissa_size(uint16_t mant_cnt[6][16])
-;------------------------------------------------------------------------------
-
-%macro PHADDD4 2 ; xmm src, xmm tmp
- movhlps %2, %1
- paddd %1, %2
- pshufd %2, %1, 0x1
- paddd %1, %2
-%endmacro
-
-INIT_XMM sse2
-cglobal ac3_compute_mantissa_size, 1, 2, 4, mant_cnt, sum
- movdqa m0, [mant_cntq ]
- movdqa m1, [mant_cntq+ 1*16]
- paddw m0, [mant_cntq+ 2*16]
- paddw m1, [mant_cntq+ 3*16]
- paddw m0, [mant_cntq+ 4*16]
- paddw m1, [mant_cntq+ 5*16]
- paddw m0, [mant_cntq+ 6*16]
- paddw m1, [mant_cntq+ 7*16]
- paddw m0, [mant_cntq+ 8*16]
- paddw m1, [mant_cntq+ 9*16]
- paddw m0, [mant_cntq+10*16]
- paddw m1, [mant_cntq+11*16]
- pmaddwd m0, [ac3_bap_bits ]
- pmaddwd m1, [ac3_bap_bits+16]
- paddd m0, m1
- PHADDD4 m0, m1
- movd sumd, m0
- movdqa m3, [pw_bap_mul1]
- movhpd m0, [mant_cntq +2]
- movlpd m0, [mant_cntq+1*32+2]
- movhpd m1, [mant_cntq+2*32+2]
- movlpd m1, [mant_cntq+3*32+2]
- movhpd m2, [mant_cntq+4*32+2]
- movlpd m2, [mant_cntq+5*32+2]
- pmulhuw m0, m3
- pmulhuw m1, m3
- pmulhuw m2, m3
- paddusw m0, m1
- paddusw m0, m2
- pmaddwd m0, [pw_bap_mul2]
- PHADDD4 m0, m1
- movd eax, m0
- add eax, sumd
- RET
-
-;------------------------------------------------------------------------------
-; void ff_ac3_extract_exponents(uint8_t *exp, int32_t *coef, int nb_coefs)
-;------------------------------------------------------------------------------
-
-%macro PABSD 1-2 ; src/dst, unused
-%if cpuflag(ssse3)
- pabsd %1, %1
-%else ; src/dst, tmp
- pxor %2, %2
- pcmpgtd %2, %1
- pxor %1, %2
- psubd %1, %2
-%endif
-%endmacro
-
-%macro AC3_EXTRACT_EXPONENTS 0
-cglobal ac3_extract_exponents, 3, 3, 4, exp, coef, len
- add expq, lenq
- lea coefq, [coefq+4*lenq]
- neg lenq
- mova m2, [pd_1]
- mova m3, [pd_151]
-.loop:
- ; move 4 32-bit coefs to xmm0
- mova m0, [coefq+4*lenq]
- ; absolute value
- PABSD m0, m1
- ; convert to float and extract exponents
- pslld m0, 1
- por m0, m2
- cvtdq2ps m1, m0
- psrld m1, 23
- mova m0, m3
- psubd m0, m1
- ; move the lowest byte in each of 4 dwords to the low dword
- ; NOTE: We cannot just extract the low bytes with pshufb because the dword
- ; result for 16777215 is -1 due to float inaccuracy. Using packuswb
- ; clips this to 0, which is the correct exponent.
- packssdw m0, m0
- packuswb m0, m0
- movd [expq+lenq], m0
-
- add lenq, 4
- jl .loop
- REP_RET
-%endmacro
-
-%if HAVE_SSE2_EXTERNAL
-INIT_XMM sse2
-AC3_EXTRACT_EXPONENTS
-%endif
-%if HAVE_SSSE3_EXTERNAL
-INIT_XMM ssse3
-AC3_EXTRACT_EXPONENTS
-%endif
diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c
deleted file mode 100644
index 8c94db0..0000000
--- a/libavcodec/x86/ac3dsp_init.c
+++ b/dev/null
@@ -1,231 +0,0 @@
-/*
- * x86-optimized AC-3 DSP utils
- * Copyright (c) 2011 Justin Ruggles
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General 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 "libavutil/mem.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "dsputil_x86.h"
-#include "libavcodec/ac3.h"
-#include "libavcodec/ac3dsp.h"
-
-void ff_ac3_exponent_min_mmx (uint8_t *exp, int num_reuse_blocks, int nb_coefs);
-void ff_ac3_exponent_min_mmxext(uint8_t *exp, int num_reuse_blocks, int nb_coefs);
-void ff_ac3_exponent_min_sse2 (uint8_t *exp, int num_reuse_blocks, int nb_coefs);
-
-int ff_ac3_max_msb_abs_int16_mmx (const int16_t *src, int len);
-int ff_ac3_max_msb_abs_int16_mmxext(const int16_t *src, int len);
-int ff_ac3_max_msb_abs_int16_sse2 (const int16_t *src, int len);
-int ff_ac3_max_msb_abs_int16_ssse3(const int16_t *src, int len);
-
-void ff_ac3_lshift_int16_mmx (int16_t *src, unsigned int len, unsigned int shift);
-void ff_ac3_lshift_int16_sse2(int16_t *src, unsigned int len, unsigned int shift);
-
-void ff_ac3_rshift_int32_mmx (int32_t *src, unsigned int len, unsigned int shift);
-void ff_ac3_rshift_int32_sse2(int32_t *src, unsigned int len, unsigned int shift);
-
-void ff_float_to_fixed24_3dnow(int32_t *dst, const float *src, unsigned int len);
-void ff_float_to_fixed24_sse (int32_t *dst, const float *src, unsigned int len);
-void ff_float_to_fixed24_sse2 (int32_t *dst, const float *src, unsigned int len);
-
-int ff_ac3_compute_mantissa_size_sse2(uint16_t mant_cnt[6][16]);
-
-void ff_ac3_extract_exponents_3dnow(uint8_t *exp, int32_t *coef, int nb_coefs);
-void ff_ac3_extract_exponents_sse2 (uint8_t *exp, int32_t *coef, int nb_coefs);
-void ff_ac3_extract_exponents_ssse3(uint8_t *exp, int32_t *coef, int nb_coefs);
-
-#if ARCH_X86_32 && defined(__INTEL_COMPILER)
-# undef HAVE_7REGS
-# define HAVE_7REGS 0
-#endif
-
-#if HAVE_SSE_INLINE && HAVE_7REGS
-
-#define IF1(x) x
-#define IF0(x)
-
-#define MIX5(mono, stereo) \
- __asm__ volatile ( \
- "movss 0(%1), %%xmm5 \n" \
- "movss 8(%1), %%xmm6 \n" \
- "movss 24(%1), %%xmm7 \n" \
- "shufps $0, %%xmm5, %%xmm5 \n" \
- "shufps $0, %%xmm6, %%xmm6 \n" \
- "shufps $0, %%xmm7, %%xmm7 \n" \
- "1: \n" \
- "movaps (%0, %2), %%xmm0 \n" \
- "movaps (%0, %3), %%xmm1 \n" \
- "movaps (%0, %4), %%xmm2 \n" \
- "movaps (%0, %5), %%xmm3 \n" \
- "movaps (%0, %6), %%xmm4 \n" \
- "mulps %%xmm5, %%xmm0 \n" \
- "mulps %%xmm6, %%xmm1 \n" \
- "mulps %%xmm5, %%xmm2 \n" \
- "mulps %%xmm7, %%xmm3 \n" \
- "mulps %%xmm7, %%xmm4 \n" \
- stereo("addps %%xmm1, %%xmm0 \n") \
- "addps %%xmm1, %%xmm2 \n" \
- "addps %%xmm3, %%xmm0 \n" \
- "addps %%xmm4, %%xmm2 \n" \
- mono("addps %%xmm2, %%xmm0 \n") \
- "movaps %%xmm0, (%0, %2) \n" \
- stereo("movaps %%xmm2, (%0, %3) \n") \
- "add $16, %0 \n" \
- "jl 1b \n" \
- : "+&r"(i) \
- : "r"(matrix), \
- "r"(samples[0] + len), \
- "r"(samples[1] + len), \
- "r"(samples[2] + len), \
- "r"(samples[3] + len), \
- "r"(samples[4] + len) \
- : XMM_CLOBBERS("%xmm0", "%xmm1", "%xmm2", "%xmm3", \
- "%xmm4", "%xmm5", "%xmm6", "%xmm7",) \
- "memory" \
- );
-
-#define MIX_MISC(stereo) \
- __asm__ volatile ( \
- "mov %5, %2 \n" \
- "1: \n" \
- "mov -%c7(%6, %2, %c8), %3 \n" \
- "movaps (%3, %0), %%xmm0 \n" \
- stereo("movaps %%xmm0, %%xmm1 \n") \
- "mulps %%xmm4, %%xmm0 \n" \
- stereo("mulps %%xmm5, %%xmm1 \n") \
- "2: \n" \
- "mov (%6, %2, %c8), %1 \n" \
- "movaps (%1, %0), %%xmm2 \n" \
- stereo("movaps %%xmm2, %%xmm3 \n") \
- "mulps (%4, %2, 8), %%xmm2 \n" \
- stereo("mulps 16(%4, %2, 8), %%xmm3 \n") \
- "addps %%xmm2, %%xmm0 \n" \
- stereo("addps %%xmm3, %%xmm1 \n") \
- "add $4, %2 \n" \
- "jl 2b \n" \
- "mov %5, %2 \n" \
- stereo("mov (%6, %2, %c8), %1 \n") \
- "movaps %%xmm0, (%3, %0) \n" \
- stereo("movaps %%xmm1, (%1, %0) \n") \
- "add $16, %0 \n" \
- "jl 1b \n" \
- : "+&r"(i), "=&r"(j), "=&r"(k), "=&r"(m) \
- : "r"(matrix_simd + in_ch), \
- "g"((intptr_t) - 4 * (in_ch - 1)), \
- "r"(samp + in_ch), \
- "i"(sizeof(float *)), "i"(sizeof(float *)/4) \
- : "memory" \
- );
-
-static void ac3_downmix_sse(float **samples, float (*matrix)[2],
- int out_ch, int in_ch, int len)
-{
- int (*matrix_cmp)[2] = (int(*)[2])matrix;
- intptr_t i, j, k, m;
-
- i = -len * sizeof(float);
- if (in_ch == 5 && out_ch == 2 &&
- !(matrix_cmp[0][1] | matrix_cmp[2][0] |
- matrix_cmp[3][1] | matrix_cmp[4][0] |
- (matrix_cmp[1][0] ^ matrix_cmp[1][1]) |
- (matrix_cmp[0][0] ^ matrix_cmp[2][1]))) {
- MIX5(IF0, IF1);
- } else if (in_ch == 5 && out_ch == 1 &&
- matrix_cmp[0][0] == matrix_cmp[2][0] &&
- matrix_cmp[3][0] == matrix_cmp[4][0]) {
- MIX5(IF1, IF0);
- } else {
- DECLARE_ALIGNED(16, float, matrix_simd)[AC3_MAX_CHANNELS][2][4];
- float *samp[AC3_MAX_CHANNELS];
-
- for (j = 0; j < in_ch; j++)
- samp[j] = samples[j] + len;
-
- j = 2 * in_ch * sizeof(float);
- __asm__ volatile (
- "1: \n"
- "sub $8, %0 \n"
- "movss (%2, %0), %%xmm4 \n"
- "movss 4(%2, %0), %%xmm5 \n"
- "shufps $0, %%xmm4, %%xmm4 \n"
- "shufps $0, %%xmm5, %%xmm5 \n"
- "movaps %%xmm4, (%1, %0, 4) \n"
- "movaps %%xmm5, 16(%1, %0, 4) \n"
- "jg 1b \n"
- : "+&r"(j)
- : "r"(matrix_simd), "r"(matrix)
- : "memory"
- );
- if (out_ch == 2) {
- MIX_MISC(IF1);
- } else {
- MIX_MISC(IF0);
- }
- }
-}
-
-#endif /* HAVE_SSE_INLINE && HAVE_7REGS */
-
-av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact)
-{
- int cpu_flags = av_get_cpu_flags();
-
- if (EXTERNAL_MMX(cpu_flags)) {
- c->ac3_exponent_min = ff_ac3_exponent_min_mmx;
- c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_mmx;
- c->ac3_lshift_int16 = ff_ac3_lshift_int16_mmx;
- c->ac3_rshift_int32 = ff_ac3_rshift_int32_mmx;
- }
- if (EXTERNAL_AMD3DNOW(cpu_flags)) {
- if (!bit_exact) {
- c->float_to_fixed24 = ff_float_to_fixed24_3dnow;
- }
- }
- if (EXTERNAL_MMXEXT(cpu_flags)) {
- c->ac3_exponent_min = ff_ac3_exponent_min_mmxext;
- c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_mmxext;
- }
- if (EXTERNAL_SSE(cpu_flags)) {
- c->float_to_fixed24 = ff_float_to_fixed24_sse;
- }
- if (EXTERNAL_SSE2(cpu_flags)) {
- c->ac3_exponent_min = ff_ac3_exponent_min_sse2;
- c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_sse2;
- c->float_to_fixed24 = ff_float_to_fixed24_sse2;
- c->compute_mantissa_size = ff_ac3_compute_mantissa_size_sse2;
- c->extract_exponents = ff_ac3_extract_exponents_sse2;
- if (!(cpu_flags & AV_CPU_FLAG_SSE2SLOW)) {
- c->ac3_lshift_int16 = ff_ac3_lshift_int16_sse2;
- c->ac3_rshift_int32 = ff_ac3_rshift_int32_sse2;
- }
- }
- if (EXTERNAL_SSSE3(cpu_flags)) {
- c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_ssse3;
- if (!(cpu_flags & AV_CPU_FLAG_ATOM)) {
- c->extract_exponents = ff_ac3_extract_exponents_ssse3;
- }
- }
-
-#if HAVE_SSE_INLINE && HAVE_7REGS
- if (INLINE_SSE(cpu_flags)) {
- c->downmix = ac3_downmix_sse;
- }
-#endif
-}
diff --git a/libavcodec/x86/mlpdsp.c b/libavcodec/x86/mlpdsp.c
deleted file mode 100644
index 94849b7..0000000
--- a/libavcodec/x86/mlpdsp.c
+++ b/dev/null
@@ -1,186 +0,0 @@
-/*
- * MLP DSP functions x86-optimized
- * Copyright (c) 2009 Ramiro Polla
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General 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 "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/mlpdsp.h"
-#include "libavcodec/mlp.h"
-
-#if HAVE_7REGS && HAVE_INLINE_ASM
-
-extern char ff_mlp_firorder_8;
-extern char ff_mlp_firorder_7;
-extern char ff_mlp_firorder_6;
-extern char ff_mlp_firorder_5;
-extern char ff_mlp_firorder_4;
-extern char ff_mlp_firorder_3;
-extern char ff_mlp_firorder_2;
-extern char ff_mlp_firorder_1;
-extern char ff_mlp_firorder_0;
-
-extern char ff_mlp_iirorder_4;
-extern char ff_mlp_iirorder_3;
-extern char ff_mlp_iirorder_2;
-extern char ff_mlp_iirorder_1;
-extern char ff_mlp_iirorder_0;
-
-static const void *firtable[9] = { &ff_mlp_firorder_0, &ff_mlp_firorder_1,
- &ff_mlp_firorder_2, &ff_mlp_firorder_3,
- &ff_mlp_firorder_4, &ff_mlp_firorder_5,
- &ff_mlp_firorder_6, &ff_mlp_firorder_7,
- &ff_mlp_firorder_8 };
-static const void *iirtable[5] = { &ff_mlp_iirorder_0, &ff_mlp_iirorder_1,
- &ff_mlp_iirorder_2, &ff_mlp_iirorder_3,
- &ff_mlp_iirorder_4 };
-
-#if ARCH_X86_64
-
-#define MLPMUL(label, offset, offs, offc) \
- LABEL_MANGLE(label)": \n\t" \
- "movslq "offset"+"offs"(%0), %%rax\n\t" \
- "movslq "offset"+"offc"(%1), %%rdx\n\t" \
- "imul %%rdx, %%rax\n\t" \
- "add %%rax, %%rsi\n\t"
-
-#define FIRMULREG(label, offset, firc)\
- LABEL_MANGLE(label)": \n\t" \
- "movslq "#offset"(%0), %%rax\n\t" \
- "imul %"#firc", %%rax\n\t" \
- "add %%rax, %%rsi\n\t"
-
-#define CLEAR_ACCUM \
- "xor %%rsi, %%rsi\n\t"
-
-#define SHIFT_ACCUM \
- "shr %%cl, %%rsi\n\t"
-
-#define ACCUM "%%rdx"
-#define RESULT "%%rsi"
-#define RESULT32 "%%esi"
-
-#else /* if ARCH_X86_32 */
-
-#define MLPMUL(label, offset, offs, offc) \
- LABEL_MANGLE(label)": \n\t" \
- "mov "offset"+"offs"(%0), %%eax\n\t" \
- "imull "offset"+"offc"(%1) \n\t" \
- "add %%eax , %%esi\n\t" \
- "adc %%edx , %%ecx\n\t"
-
-#define FIRMULREG(label, offset, firc) \
- MLPMUL(label, #offset, "0", "0")
-
-#define CLEAR_ACCUM \
- "xor %%esi, %%esi\n\t" \
- "xor %%ecx, %%ecx\n\t"
-
-#define SHIFT_ACCUM \
- "mov %%ecx, %%edx\n\t" \
- "mov %%esi, %%eax\n\t" \
- "movzbl %7 , %%ecx\n\t" \
- "shrd %%cl, %%edx, %%eax\n\t" \
-
-#define ACCUM "%%edx"
-#define RESULT "%%eax"
-#define RESULT32 "%%eax"
-
-#endif /* !ARCH_X86_64 */
-
-#define BINC AV_STRINGIFY(4* MAX_CHANNELS)
-#define IOFFS AV_STRINGIFY(4*(MAX_FIR_ORDER + MAX_BLOCKSIZE))
-#define IOFFC AV_STRINGIFY(4* MAX_FIR_ORDER)
-
-#define FIRMUL(label, offset) MLPMUL(label, #offset, "0", "0")
-#define IIRMUL(label, offset) MLPMUL(label, #offset, IOFFS, IOFFC)
-
-static void mlp_filter_channel_x86(int32_t *state, const int32_t *coeff,
- int firorder, int iirorder,
- unsigned int filter_shift, int32_t mask,
- int blocksize, int32_t *sample_buffer)
-{
- const void *firjump = firtable[firorder];
- const void *iirjump = iirtable[iirorder];
-
- blocksize = -blocksize;
-
- __asm__ volatile(
- "1: \n\t"
- CLEAR_ACCUM
- "jmp *%5 \n\t"
- FIRMUL (ff_mlp_firorder_8, 0x1c )
- FIRMUL (ff_mlp_firorder_7, 0x18 )
- FIRMUL (ff_mlp_firorder_6, 0x14 )
- FIRMUL (ff_mlp_firorder_5, 0x10 )
- FIRMUL (ff_mlp_firorder_4, 0x0c )
- FIRMULREG(ff_mlp_firorder_3, 0x08,10)
- FIRMULREG(ff_mlp_firorder_2, 0x04, 9)
- FIRMULREG(ff_mlp_firorder_1, 0x00, 8)
- LABEL_MANGLE(ff_mlp_firorder_0)":\n\t"
- "jmp *%6 \n\t"
- IIRMUL (ff_mlp_iirorder_4, 0x0c )
- IIRMUL (ff_mlp_iirorder_3, 0x08 )
- IIRMUL (ff_mlp_iirorder_2, 0x04 )
- IIRMUL (ff_mlp_iirorder_1, 0x00 )
- LABEL_MANGLE(ff_mlp_iirorder_0)":\n\t"
- SHIFT_ACCUM
- "mov "RESULT" ,"ACCUM" \n\t"
- "add (%2) ,"RESULT" \n\t"
- "and %4 ,"RESULT" \n\t"
- "sub $4 , %0 \n\t"
- "mov "RESULT32", (%0) \n\t"
- "mov "RESULT32", (%2) \n\t"
- "add $"BINC" , %2 \n\t"
- "sub "ACCUM" ,"RESULT" \n\t"
- "mov "RESULT32","IOFFS"(%0) \n\t"
- "incl %3 \n\t"
- "js 1b \n\t"
- : /* 0*/"+r"(state),
- /* 1*/"+r"(coeff),
- /* 2*/"+r"(sample_buffer),
-#if ARCH_X86_64
- /* 3*/"+r"(blocksize)
- : /* 4*/"r"((x86_reg)mask), /* 5*/"r"(firjump),
- /* 6*/"r"(iirjump) , /* 7*/"c"(filter_shift)
- , /* 8*/"r"((int64_t)coeff[0])
- , /* 9*/"r"((int64_t)coeff[1])
- , /*10*/"r"((int64_t)coeff[2])
- : "rax", "rdx", "rsi"
-#else /* ARCH_X86_32 */
- /* 3*/"+m"(blocksize)
- : /* 4*/"m"( mask), /* 5*/"m"(firjump),
- /* 6*/"m"(iirjump) , /* 7*/"m"(filter_shift)
- : "eax", "edx", "esi", "ecx"
-#endif /* !ARCH_X86_64 */
- );
-}
-
-#endif /* HAVE_7REGS && HAVE_INLINE_ASM */
-
-av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
-{
-#if HAVE_7REGS && HAVE_INLINE_ASM
- int cpu_flags = av_get_cpu_flags();
- if (INLINE_MMX(cpu_flags))
- c->mlp_filter_channel = mlp_filter_channel_x86;
-#endif
-}
diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c
index d93e75e..19fe6e1 100644..100755
--- a/libavformat/aacdec.c
+++ b/libavformat/aacdec.c
@@ -26,6 +26,8 @@
#include "rawdec.h"
#include "id3v1.h"
#include "apetag.h"
+#include "id3v2.h"
+#include "adif.h"
static int adts_aac_probe(AVProbeData *p)
{
@@ -38,6 +40,10 @@ static int adts_aac_probe(AVProbeData *p)
buf = buf0;
+ if(!memcmp(buf, "ADIF", 4)){
+ return AVPROBE_SCORE_EXTENSION+1;
+ }
+
for(; buf < end; buf= buf2+1) {
buf2 = buf;
@@ -65,7 +71,10 @@ static int adts_aac_probe(AVProbeData *p)
static int adts_aac_read_header(AVFormatContext *s)
{
AVStream *st;
-
+ int err;
+ uint8_t *buf=s->pb->buffer;
+ ID3v2ExtraMeta *id3v2_extra_meta = NULL;
+
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
@@ -84,6 +93,19 @@ static int adts_aac_read_header(AVFormatContext *s)
//LCM of all possible ADTS sample rates
avpriv_set_pts_info(st, 64, 1, 28224000);
+ ff_id3v2_read(s, "ID3", &id3v2_extra_meta);
+
+ if (buf[0]=='A' && buf[1]=='D' && buf[2]=='I' && buf[3]=='F')
+ {
+ err = adif_header_parse(st,s->pb);
+ if(err){
+ av_log(NULL, AV_LOG_INFO," adif parser header failed\n");
+ return err;
+ } else{
+ st->need_parsing = AVSTREAM_PARSE_NONE;
+ st->codec->codec_id = AV_CODEC_ID_AAC;
+ }
+ }
return 0;
}
diff --git a/libavformat/ac3dec.c b/libavformat/ac3parser.c
index 3db2339..77d489e 100644
--- a/libavformat/ac3dec.c
+++ b/libavformat/ac3parser.c
@@ -36,50 +36,50 @@ static int ac3_eac3_probe(AVProbeData *p, enum AVCodecID expected_codec_id)
buf = p->buf;
end = buf + p->buf_size;
- for(; buf < end; buf++) {
- if(buf > p->buf && !(buf[0] == 0x0B && buf[1] == 0x77)
+ for (; buf < end; buf++) {
+ if (buf > p->buf && !(buf[0] == 0x0B && buf[1] == 0x77)
&& !(buf[0] == 0x77 && buf[1] == 0x0B) )
continue;
buf2 = buf;
- for(frames = 0; buf2 < end; frames++) {
+ for (frames = 0; buf2 < end; frames++) {
uint8_t buf3[4096];
int i;
- if(!memcmp(buf2, "\x1\x10\0\0\0\0\0\0", 8))
+ if (!memcmp(buf2, "\x1\x10\0\0\0\0\0\0", 8))
buf2+=16;
if (buf[0] == 0x77 && buf[1] == 0x0B) {
- for(i=0; i<8; i+=2) {
+ for (i=0; i<8; i+=2) {
buf3[i ] = buf[i+1];
buf3[i+1] = buf[i ];
}
init_get_bits(&gbc, buf3, 54);
}else
init_get_bits(&gbc, buf2, 54);
- if(avpriv_ac3_parse_header(&gbc, &hdr) < 0)
+ if (avpriv_ac3_parse_header(&gbc, &hdr) < 0)
break;
- if(buf2 + hdr.frame_size > end)
+ if (buf2 + hdr.frame_size > end)
break;
if (buf[0] == 0x77 && buf[1] == 0x0B) {
av_assert0(hdr.frame_size <= sizeof(buf3));
- for(i=8; i<hdr.frame_size; i+=2) {
+ for (i=8; i<hdr.frame_size; i+=2) {
buf3[i ] = buf[i+1];
buf3[i+1] = buf[i ];
}
}
- if(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, gbc.buffer + 2, hdr.frame_size - 2))
+ if (av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, gbc.buffer + 2, hdr.frame_size - 2))
break;
if (hdr.bitstream_id > 10)
codec_id = AV_CODEC_ID_EAC3;
buf2 += hdr.frame_size;
}
max_frames = FFMAX(max_frames, frames);
- if(buf == p->buf)
+ if (buf == p->buf)
first_frames = frames;
}
- if(codec_id != expected_codec_id) return 0;
+ if (codec_id != expected_codec_id) return 0;
// keep this in sync with mp3 probe, both need to avoid
// issues with MPEG-files!
- if (first_frames>=4) return AVPROBE_SCORE_EXTENSION + 1;
+ if (first_frames >=4 ) return AVPROBE_SCORE_EXTENSION + 1;
else if(max_frames>200)return AVPROBE_SCORE_EXTENSION;
else if(max_frames>=4) return AVPROBE_SCORE_EXTENSION/2;
else if(max_frames>=1) return 1;
diff --git a/libavformat/adif.c b/libavformat/adif.c
new file mode 100755
index 0000000..9b0fdec
--- a/dev/null
+++ b/libavformat/adif.c
@@ -0,0 +1,225 @@
+
+#include "adif.h"
+
+
+/**************************************************************************************
+ * Function: DecodeProgramConfigElement
+ *
+ * Description: decode one PCE
+ *
+ * Inputs: BitStreamInfo struct pointing to start of PCE (14496-3, table 4.4.2)
+ *
+ * Outputs: filled-in ProgConfigElement struct
+ * updated BitStreamInfo struct
+ *
+ * Return: 0 if successful, error code (< 0) if error
+ *
+ * Notes: #define KEEP_PCE_COMMENTS to save the comment field of the PCE
+ * (otherwise we just skip it in the bitstream, to save memory)
+ **************************************************************************************/
+static int DecodeProgramConfigElement(ProgConfigElement *pce, GetBitContext *bsi)
+{
+ int i;
+
+ pce->elemInstTag = get_bits(bsi, 4);
+ pce->profile = get_bits(bsi, 2);
+ pce->sampRateIdx = get_bits(bsi, 4);
+ pce->numFCE = get_bits(bsi, 4);
+ pce->numSCE = get_bits(bsi, 4);
+ pce->numBCE = get_bits(bsi, 4);
+ pce->numLCE = get_bits(bsi, 2);
+ pce->numADE = get_bits(bsi, 3);
+ pce->numCCE = get_bits(bsi, 4);
+
+ pce->monoMixdown = get_bits(bsi, 1) << 4; /* present flag */
+ if (pce->monoMixdown)
+ pce->monoMixdown |= get_bits(bsi, 4); /* element number */
+
+ pce->stereoMixdown = get_bits(bsi, 1) << 4; /* present flag */
+ if (pce->stereoMixdown)
+ pce->stereoMixdown |= get_bits(bsi, 4); /* element number */
+
+ pce->matrixMixdown = get_bits(bsi, 1) << 4; /* present flag */
+ if (pce->matrixMixdown) {
+ pce->matrixMixdown |= get_bits(bsi, 2) << 1; /* index */
+ pce->matrixMixdown |= get_bits(bsi, 1); /* pseudo-surround enable */
+ }
+
+ for (i = 0; i < pce->numFCE; i++) {
+ pce->fce[i] = get_bits(bsi, 1) << 4; /* is_cpe flag */
+ pce->fce[i] |= get_bits(bsi, 4); /* tag select */
+ }
+
+ for (i = 0; i < pce->numSCE; i++) {
+ pce->sce[i] = get_bits(bsi, 1) << 4; /* is_cpe flag */
+ pce->sce[i] |= get_bits(bsi, 4); /* tag select */
+ }
+
+ for (i = 0; i < pce->numBCE; i++) {
+ pce->bce[i] = get_bits(bsi, 1) << 4; /* is_cpe flag */
+ pce->bce[i] |= get_bits(bsi, 4); /* tag select */
+ }
+
+ for (i = 0; i < pce->numLCE; i++)
+ pce->lce[i] = get_bits(bsi, 4); /* tag select */
+
+ for (i = 0; i < pce->numADE; i++)
+ pce->ade[i] = get_bits(bsi, 4); /* tag select */
+
+ for (i = 0; i < pce->numCCE; i++) {
+ pce->cce[i] = get_bits(bsi, 1) << 4; /* independent/dependent flag */
+ pce->cce[i] |= get_bits(bsi, 4); /* tag select */
+ }
+
+
+ align_get_bits(bsi);
+
+#if 0//def KEEP_PCE_COMMENTS
+ pce->commentBytes = get_bits(bsi, 8);
+ for (i = 0; i < pce->commentBytes; i++)
+ pce->commentField[i] = get_bits(bsi, 8);
+#else
+ /* eat comment bytes and throw away */
+ i = get_bits(bsi, 8);
+ while (i--)
+ get_bits(bsi, 8);
+#endif
+
+ return 0;
+}
+/**************************************************************************************
+ * Function: GetNumChannelsADIF
+ *
+ * Description: get number of channels from program config elements in an ADIF file
+ *
+ * Inputs: array of filled-in program config element structures
+ * number of PCE's
+ *
+ * Outputs: none
+ *
+ * Return: total number of channels in file
+ * -1 if error (invalid number of PCE's or unsupported mode)
+ **************************************************************************************/
+static int GetNumChannelsADIF(ProgConfigElement *fhPCE, int nPCE)
+{
+ int i, j, nChans;
+
+ if (/*nPCE < 1 ||*/ nPCE > MAX_NUM_PCE_ADIF)
+ return -1;
+
+ nChans = 0;
+ for (i = 0; i < nPCE; i++) {
+ av_log(NULL, AV_LOG_INFO,"ADIF_INFO:fhPCE[i].profile=%d fhPCE[i].numCCE=%d\n",fhPCE[i].profile,fhPCE[i].numCCE);
+ #if 0
+ /* for now: only support LC, no channel coupling */
+ if (fhPCE[i].profile != 1/*LC*/ || fhPCE[i].numCCE > 0)
+ return -1;
+ #endif
+ /* add up number of channels in all channel elements (assume all single-channel) */
+ nChans += fhPCE[i].numFCE;
+ nChans += fhPCE[i].numSCE;
+ nChans += fhPCE[i].numBCE;
+ nChans += fhPCE[i].numLCE;
+
+ /* add one more for every element which is a channel pair */
+ for (j = 0; j < fhPCE[i].numFCE; j++) {
+ if (CHAN_ELEM_IS_CPE(fhPCE[i].fce[j]))
+ nChans++;
+ }
+ for (j = 0; j < fhPCE[i].numSCE; j++) {
+ if (CHAN_ELEM_IS_CPE(fhPCE[i].sce[j]))
+ nChans++;
+ }
+ for (j = 0; j < fhPCE[i].numBCE; j++) {
+ if (CHAN_ELEM_IS_CPE(fhPCE[i].bce[j]))
+ nChans++;
+ }
+
+ }
+
+ return nChans;
+}
+/**************************************************************************************
+ * Function: GetSampleRateIdxADIF
+ *
+ * Description: get sampling rate index from program config elements in an ADIF file
+ *
+ * Inputs: array of filled-in program config element structures
+ * number of PCE's
+ *
+ * Outputs: none
+ *
+ * Return: sample rate of file
+ * -1 if error (invalid number of PCE's or sample rate mismatch)
+ **************************************************************************************/
+ static int GetSampleRateIdxADIF(ProgConfigElement *fhPCE, int nPCE)
+{
+ int i, idx;
+
+ if (nPCE < 1 || nPCE > MAX_NUM_PCE_ADIF)
+ return -1;
+
+ /* make sure all PCE's have the same sample rate */
+ idx = fhPCE[0].sampRateIdx;
+ for (i = 1; i < nPCE; i++) {
+ if (fhPCE[i].sampRateIdx != idx)
+ return -1;
+ }
+
+ return idx;
+}
+
+int adif_header_parse(AVStream *st, AVIOContext *pb)
+{
+ GetBitContext gbc;
+ ADIFHeader hADIF;
+ ADIFHeader *fhADIF = &hADIF;
+ int ch,sr_index,i;
+ ProgConfigElement pce[MAX_NUM_PCE_ADIF];
+ const int aac_sample_rates[16] = {
+ 96000, 88200, 64000, 48000, 44100, 32000,
+ 24000, 22050, 16000, 12000, 11025, 8000, 7350
+ };
+ init_get_bits(&gbc, pb->buffer+4, pb->buffer_size-4);//skip adif tag
+ /* read ADIF header fields */
+ fhADIF->copyBit = get_bits(&gbc, 1);
+ if (fhADIF->copyBit) {
+ for (i = 0; i < ADIF_COPYID_SIZE; i++)
+ fhADIF->copyID[i] = get_bits(&gbc,8);
+ }
+ fhADIF->origCopy = get_bits(&gbc, 1);
+ fhADIF->home = get_bits(&gbc, 1);
+ fhADIF->bsType = get_bits(&gbc,1);
+ fhADIF->bitRate = get_bits(&gbc,23);
+ fhADIF->numPCE = get_bits(&gbc, 4) + 1; /* add 1 (so range = [1, 16]) */
+ /* parse all program config elements */
+ for (i = 0; i < fhADIF->numPCE; i++){
+ if (fhADIF->bsType == 0)
+ fhADIF->bufferFull = get_bits(&gbc, 20);
+ else
+ fhADIF->bufferFull = 0;
+ DecodeProgramConfigElement(pce + i, &gbc);
+ }
+
+ /* byte align */
+ align_get_bits(&gbc);
+
+ /* update codec info */
+ ch = GetNumChannelsADIF(pce, 1/*fhADIF->numPCE*/);
+ sr_index = GetSampleRateIdxADIF(pce, fhADIF->numPCE);
+
+ av_log(st, AV_LOG_INFO,"ADIF_INFO:ch=%d sr_index=%d\n",ch,sr_index);
+ // /* check validity of header */
+ if (ch < 0 || sr_index < 0 || sr_index >= NUM_SAMPLE_RATES){
+
+ return -1;
+ }
+ st->codec->bit_rate = fhADIF->bitRate;
+ st->codec->channels = ch;
+ st->codec->sample_rate = aac_sample_rates[sr_index];
+ st->codec->profile = pce[0].profile;
+ av_log(st, AV_LOG_INFO," sr %d,ch %d,bitraete %d,profile %d",st->codec->sample_rate ,st->codec->channels,\
+ st->codec->bit_rate,st->codec->profile);
+ return 0;
+}
+
diff --git a/libavformat/adif.h b/libavformat/adif.h
new file mode 100755
index 0000000..adb137f
--- a/dev/null
+++ b/libavformat/adif.h
@@ -0,0 +1,60 @@
+#ifndef _ADIF_H_
+#define _ADIF_H_
+#include "libavcodec/get_bits.h"
+#include "libavcodec/bytestream.h"
+#include "avformat.h"
+
+
+/* sizeof(ProgConfigElement) = 82 bytes (if KEEP_PCE_COMMENTS not defined) */
+#define MAX_NUM_FCE 15
+#define MAX_NUM_SCE 15
+#define MAX_NUM_BCE 15
+#define MAX_NUM_LCE 3
+#define MAX_NUM_ADE 7
+#define MAX_NUM_CCE 15
+#define MAX_NUM_PCE_ADIF 16
+
+#define CHAN_ELEM_IS_CPE(x) (((x) & 0x10) >> 4) /* bit 4 = SCE/CPE flag */
+#define NUM_SAMPLE_RATES 12
+
+#define ADIF_COPYID_SIZE 9
+
+typedef struct _ADIFHeader {
+ unsigned char copyBit; /* 0 = no copyright ID, 1 = 72-bit copyright ID follows immediately */
+ unsigned char origCopy; /* 0 = copy, 1 = original */
+ unsigned char home; /* ignore */
+ unsigned char bsType; /* bitstream type: 0 = CBR, 1 = VBR */
+ int bitRate; /* bitRate: CBR = bits/sec, VBR = peak bits/frame, 0 = unknown */
+ unsigned char numPCE; /* number of program config elements (max = 16) */
+ int bufferFull; /* bits left in bit reservoir */
+ unsigned char copyID[ADIF_COPYID_SIZE]; /* optional 72-bit copyright ID */
+} ADIFHeader;
+
+
+
+typedef struct _ProgConfigElement {
+ unsigned char elemInstTag; /* element instance tag */
+ unsigned char profile; /* 0 = main, 1 = LC, 2 = SSR, 3 = reserved */
+ unsigned char sampRateIdx; /* sample rate index range = [0, 11] */
+ unsigned char numFCE; /* number of front channel elements (max = 15) */
+ unsigned char numSCE; /* number of side channel elements (max = 15) */
+ unsigned char numBCE; /* number of back channel elements (max = 15) */
+ unsigned char numLCE; /* number of LFE channel elements (max = 3) */
+ unsigned char numADE; /* number of associated data elements (max = 7) */
+ unsigned char numCCE; /* number of valid channel coupling elements (max = 15) */
+ unsigned char monoMixdown; /* mono mixdown: bit 4 = present flag, bits 3-0 = element number */
+ unsigned char stereoMixdown; /* stereo mixdown: bit 4 = present flag, bits 3-0 = element number */
+ unsigned char matrixMixdown; /* matrix mixdown: bit 4 = present flag, bit 3 = unused, bits 2-1 = index, bit 0 = pseudo-surround enable */
+ unsigned char fce[MAX_NUM_FCE]; /* front element channel pair: bit 4 = SCE/CPE flag, bits 3-0 = inst tag */
+ unsigned char sce[MAX_NUM_SCE]; /* side element channel pair: bit 4 = SCE/CPE flag, bits 3-0 = inst tag */
+ unsigned char bce[MAX_NUM_BCE]; /* back element channel pair: bit 4 = SCE/CPE flag, bits 3-0 = inst tag */
+ unsigned char lce[MAX_NUM_LCE]; /* instance tag for LFE elements */
+ unsigned char ade[MAX_NUM_ADE]; /* instance tag for ADE elements */
+ unsigned char cce[MAX_NUM_BCE]; /* channel coupling elements: bit 4 = switching flag, bits 3-0 = inst tag */
+} ProgConfigElement;
+
+extern int adif_header_parse(AVStream *st, AVIOContext *pb);
+int adts_bitrate_parse(AVFormatContext *s, int *bitrate, int64_t old_offset);
+
+
+#endif
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 528bcbd..56b0613 100644..100755
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -146,6 +146,36 @@ static void print_guid(ff_asf_guid *g)
#define print_guid(g)
#endif
+#include <dlfcn.h>
+
+typedef int PRDecryptWMAFunc(char* a, uint8_t* b, uint32_t c,
+ int d, int e, int64_t f, int g);
+typedef int PRSetDrmHeaderFunc(const void *headerData, size_t size, const void *licenseurl);
+typedef void PRCloseFunc(void);
+
+void *gPRWMVLibHandle = NULL;
+static PRDecryptWMAFunc* PRDecryptWMA = NULL;
+static PRSetDrmHeaderFunc* PRSetDrmHeader = NULL;
+static PRCloseFunc* PRClose = NULL;
+
+static int get_PRWMV_func_handle()
+{
+ if (gPRWMVLibHandle == NULL)
+ gPRWMVLibHandle = dlopen("libprwmv.so", RTLD_NOW);
+ if (NULL == gPRWMVLibHandle) {
+ av_log(NULL, AV_LOG_WARNING, "DRM asf file loading lib libprwmv.so failure %s",dlerror());
+ return -1;
+ }
+ PRSetDrmHeader = (PRSetDrmHeaderFunc*)dlsym(gPRWMVLibHandle, "PRSetDrmHeader");
+ PRDecryptWMA = (PRDecryptWMAFunc*)dlsym(gPRWMVLibHandle, "PRDecryptWMA");
+ PRClose = (PRCloseFunc*)dlsym(gPRWMVLibHandle, "PRClose");
+ if (PRSetDrmHeader == NULL || PRDecryptWMA == NULL || PRClose == NULL) {
+ av_log(NULL, AV_LOG_ERROR, "Get PR decrypt func handle failed \n");
+ return -1;
+ }
+ return 0;
+}
+
static int asf_probe(AVProbeData *pd)
{
/* check file header */
@@ -318,6 +348,34 @@ finish:
avio_seek(s->pb, off + len, SEEK_SET);
}
+static int asf_extract_cover_pic(AVFormatContext *s, int size)
+{
+ AVIOContext *pb = s->pb;
+ int pic_type, data_len, ret;
+ char mime_type[64];
+ char *data;
+
+ pic_type = avio_r8(pb);
+ data_len = avio_rl32(pb);
+ ret = avio_get_str16le(pb, size - data_len -5, mime_type, sizeof(mime_type));
+ avio_skip(pb, (size - data_len - ret - 5));
+ av_dict_set(&s->metadata, "cover_pic", mime_type, 0);
+
+ if(s->cover_data){
+ av_log(s, AV_LOG_INFO, "Extract cover picture in other object!\n");
+ return 0;
+ }
+ s->cover_data= av_malloc(data_len);
+ if(!s->cover_data){
+ av_log(s, AV_LOG_INFO, "no memery, av_alloc failed!\n");
+ return 0;
+ }
+ s->cover_data_len = data_len;
+ avio_read(pb, s->cover_data, data_len);
+
+ return 1;
+}
+
static int asf_read_file_properties(AVFormatContext *s, int64_t size)
{
ASFContext *asf = s->priv_data;
@@ -610,6 +668,8 @@ static int asf_read_ext_content_desc(AVFormatContext *s, int64_t size)
asf->dar[0].num = get_value(s->pb, value_type, 32);
else if (!strcmp(name, "AspectRatioY"))
asf->dar[0].den = get_value(s->pb, value_type, 32);
+ else if(!strcmp(name, "WM/Picture"))
+ asf_extract_cover_pic(s, value_len);
else
get_tag(s, name, value_type, value_len, 32);
}
@@ -668,6 +728,8 @@ static int asf_read_metadata(AVFormatContext *s, int64_t size)
int aspect_y = get_value(s->pb, value_type, 16);
if(stream_num < 128)
asf->dar[stream_num].den = aspect_y;
+ } else if(!strcmp(name, "WM/Picture")){
+ asf_extract_cover_pic(s, value_len);
} else {
get_tag(s, name, value_type, value_len, 16);
}
@@ -798,9 +860,23 @@ static int asf_read_header(AVFormatContext *s)
len= avio_rl32(pb);
get_tag(s, "ASF_License_URL", -1, len, 32);
} else if (!ff_guidcmp(&g, &ff_asf_ext_content_encryption)) {
- av_log(s, AV_LOG_WARNING,
- "Ext DRM protected stream detected, decoding will likely fail!\n");
- av_dict_set(&s->metadata, "encryption", "ASF Extended Content Encryption", 0);
+ //av_log(s, AV_LOG_WARNING,
+ // "Ext DRM protected stream detected, decoding will likely fail!\n");
+ //av_dict_set(&s->metadata, "encryption", "ASF Extended Content Encryption", 0);
+ unsigned int len= avio_rl32(pb);
+ AVPacket pkt;
+ av_log(s, AV_LOG_WARNING, "Ext DRM size %d\n", len);
+ av_get_packet(pb, &pkt, len);
+ if (!get_PRWMV_func_handle()) {
+ int ret = PRSetDrmHeader(pkt.data, len, NULL);
+ if (!ret) {
+ av_log(NULL, AV_LOG_ERROR, "PlayReady header format error!!!%d\n", ret);
+ } else {
+ s->flags |= AVFMT_FLAG_PR_WMA;
+ av_log(NULL, AV_LOG_WARNING, "PlayReady encrypted WMA, Support!");
+ }
+ }
+ av_free_packet(&pkt);
} else if (!ff_guidcmp(&g, &ff_asf_digital_signature)) {
av_log(s, AV_LOG_INFO, "Digital signature detected!\n");
}
@@ -1253,6 +1329,8 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
if (s->key && s->keylen == 20)
ff_asfcrypt_dec(s->key, asf_st->pkt.data + asf->packet_frag_offset,
ret);
+ if (s->flags & AVFMT_FLAG_PR_WMA && PRDecryptWMA)
+ PRDecryptWMA(NULL, asf_st->pkt.data, 1, ret, 1, asf_st->pkt.pts, 0);
asf_st->frag_offset += ret;
/* test if whole packet is read */
if (asf_st->frag_offset == asf_st->pkt.size) {
@@ -1394,6 +1472,9 @@ static void skip_to_key(AVFormatContext *s)
static int asf_read_close(AVFormatContext *s)
{
asf_reset_header(s);
+ if ((s->flags & AVFMT_FLAG_PR_WMA) && PRClose) {
+ PRClose();
+ }
return 0;
}
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 6bd54ce..9c3d612 100644..100755
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -892,6 +892,8 @@ typedef struct AVStream {
*/
int pts_wrap_behavior;
+ int rotation_degree;
+
} AVStream;
AVRational av_stream_get_r_frame_rate(const AVStream *s);
@@ -1052,6 +1054,7 @@ typedef struct AVFormatContext {
#define AVFMT_FLAG_SORT_DTS 0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down)
#define AVFMT_FLAG_PRIV_OPT 0x20000 ///< Enable use of private options by delaying codec open (this could be made default once all code is converted)
#define AVFMT_FLAG_KEEP_SIDE_DATA 0x40000 ///< Don't merge side data but keep it separate.
+#define AVFMT_FLAG_PR_WMA 0x2000000 ///< PlayReady WMA;
/**
* decoding: size of data to probe; encoding: unused.
@@ -1343,6 +1346,9 @@ typedef struct AVFormatContext {
* Demuxing: Set by user via av_format_set_subtitle_codec (NO direct access).
*/
AVCodec *subtitle_codec;
+
+ int cover_data_len;
+ uint8_t *cover_data;
} AVFormatContext;
int av_format_get_probe_score(const AVFormatContext *s);
diff --git a/libavformat/dtsdec.c b/libavformat/dca_parser.c
index 23cbe93..01eb150 100644
--- a/libavformat/dtsdec.c
+++ b/libavformat/dca_parser.c
@@ -38,7 +38,7 @@ static int dts_probe(AVProbeData *p)
buf = p->buf;
- for(; buf < (p->buf+p->buf_size)-2; buf+=2) {
+ for (; buf < (p->buf+p->buf_size)-2; buf+=2) {
bufp = buf;
state = (state << 16) | bytestream_get_be16(&bufp);
diff --git a/libavformat/dtshddec.c b/libavformat/dcahd_parser.c
index 55c4ca6..55c4ca6 100644
--- a/libavformat/dtshddec.c
+++ b/libavformat/dcahd_parser.c
diff --git a/libavformat/flv.h b/libavformat/flv.h
index db9468f..a701e94 100644..100755
--- a/libavformat/flv.h
+++ b/libavformat/flv.h
@@ -109,6 +109,9 @@ enum {
FLV_CODECID_H264 = 7,
FLV_CODECID_REALH263= 8,
FLV_CODECID_MPEG4 = 9,
+ FLV_CODECID_HM91 = 12,
+ FLV_CODECID_HM10 = 13,
+ FLV_CODECID_HM12 = 14,
};
enum {
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 1024001..8ab629a 100644..100755
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -217,6 +217,10 @@ static int flv_same_video_codec(AVCodecContext *vcodec, int flags)
return vcodec->codec_id == AV_CODEC_ID_VP6A;
case FLV_CODECID_H264:
return vcodec->codec_id == AV_CODEC_ID_H264;
+ case FLV_CODECID_HM91:
+ case FLV_CODECID_HM10:
+ case FLV_CODECID_HM12:
+ return vcodec->codec_id == AV_CODEC_ID_HEVC;
default:
return vcodec->codec_tag == flv_codecid;
}
@@ -260,6 +264,11 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream,
case FLV_CODECID_MPEG4:
vcodec->codec_id = AV_CODEC_ID_MPEG4;
return 3;
+ case FLV_CODECID_HM91:
+ case FLV_CODECID_HM10:
+ case FLV_CODECID_HM12:
+ vcodec->codec_id = AV_CODEC_ID_HEVC;
+ return 3;
default:
avpriv_request_sample(s, "Video codec (%x)", flv_codecid);
vcodec->codec_tag = flv_codecid;
@@ -611,6 +620,55 @@ static int flv_read_close(AVFormatContext *s)
return 0;
}
+/***************** defined for lentoid hevc ************************/
+static const uint8_t nal_start_code[] = {0x00, 0x00, 0x00, 0x01};
+static void flv_extradata_process(AVStream *st)
+{
+ int len = 1024, offset = 6;
+ uint8_t * buf = av_malloc(len);
+ uint8_t * buf_t = buf;
+ uint8_t * ptr = st->codec->extradata;
+ int size_0, size_1, size;
+ len = 0;
+ int count=0;
+ while(st->codec->extradata_size - offset > 0) {
+ count++;
+ size_0 = (*(ptr+offset)&0xFF)*0x100;
+ size_1 = *(ptr+offset+1)&0xFF;
+ size = size_0+size_1;
+ if(count==2)
+ size += 1; // very ugly
+ memcpy(buf_t, nal_start_code, 4);
+ buf_t += 4;
+ memcpy(buf_t, ptr+offset+2, size);
+ buf_t += size;
+ offset = offset+size+2;
+ len = len+size+4;
+ }
+ st->codec->extradata = av_realloc(st->codec->extradata, len);
+ memcpy(st->codec->extradata, buf, len);
+ st->codec->extradata_size = len;
+ av_free(buf);
+}
+
+
+static int flv_get_hevc_packet(AVFormatContext *s, AVPacket *pkt, int size)
+{
+ int len =0;
+ int ret = av_new_packet(pkt, size);
+ if(ret < 0)
+ return ret;
+ int offset = 0;
+ while(size-offset > 0) {
+ len = avio_rb32(s->pb);
+ memcpy(pkt->data+offset, nal_start_code, 4);
+ len = avio_read(s->pb, pkt->data+offset+4, len);
+ offset = offset+len+4;
+ }
+ return 0;
+}
+/***************** defined for lentoid hevc ************************/
+
static int flv_get_extradata(AVFormatContext *s, AVStream *st, int size)
{
av_free(st->codec->extradata);
@@ -927,10 +985,12 @@ retry_duration:
if (st->codec->codec_id == AV_CODEC_ID_AAC ||
st->codec->codec_id == AV_CODEC_ID_H264 ||
- st->codec->codec_id == AV_CODEC_ID_MPEG4) {
+ st->codec->codec_id == AV_CODEC_ID_MPEG4 ||
+ st->codec->codec_id == AV_CODEC_ID_HEVC) {
int type = avio_r8(s->pb);
size--;
- if (st->codec->codec_id == AV_CODEC_ID_H264 || st->codec->codec_id == AV_CODEC_ID_MPEG4) {
+ if (st->codec->codec_id == AV_CODEC_ID_H264 || st->codec->codec_id == AV_CODEC_ID_MPEG4 ||
+ st->codec->codec_id == AV_CODEC_ID_HEVC) {
// sign extension
int32_t cts = (avio_rb24(s->pb) + 0xff800000) ^ 0xff800000;
pts = dts + cts;
@@ -951,6 +1011,10 @@ retry_duration:
}
if ((ret = flv_get_extradata(s, st, size)) < 0)
return ret;
+
+ if(st->codec->codec_id == AV_CODEC_ID_HEVC) {
+ flv_extradata_process(st);
+ }
if (st->codec->codec_id == AV_CODEC_ID_AAC && 0) {
MPEG4AudioConfig cfg;
if (avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata,
@@ -977,7 +1041,11 @@ retry_duration:
goto leave;
}
- ret = av_get_packet(s->pb, pkt, size);
+ if(st->codec->codec_id == AV_CODEC_ID_HEVC) {
+ ret = flv_get_hevc_packet(s, pkt, size);
+ } else {
+ ret = av_get_packet(s->pb, pkt, size);
+ }
if (ret < 0)
return ret;
pkt->dts = dts;
diff --git a/libavformat/id3v1.c b/libavformat/id3v1.c
index d73adc7..471945f 100644
--- a/libavformat/id3v1.c
+++ b/libavformat/id3v1.c
@@ -175,12 +175,58 @@ const char * const ff_id3v1_genre_str[ID3v1_GENRE_MAX + 1] = {
[147] = "SynthPop",
};
+static void convert_iso8859_to_string(const uint8_t *data, int size, char *s) {
+ int utf8len = 0;
+ int i;
+
+ for (i = 0; i < size; ++i) {
+ if (data[i] == '\0') {
+ size = i;
+ break;
+ } else if (data[i] < 0x80) {
+ ++utf8len;
+ } else {
+ utf8len += 2;
+ }
+ }
+
+ if (utf8len == size) {
+ // Only ASCII characters present.
+
+ memcpy(s, data, size);
+ s[size] = '\0';
+ return;
+ }
+
+ char *ptr = s;
+ for (i = 0; i < size; ++i) {
+ if (data[i] == '\0') {
+ break;
+ } else if (data[i] < 0x80) {
+ *ptr++ = data[i];
+ } else if (data[i] < 0xc0) {
+ *ptr++ = 0xc2;
+ *ptr++ = data[i];
+ } else {
+ *ptr++ = 0xc3;
+ *ptr++ = data[i] - 64;
+ }
+ }
+ *ptr = '\0';
+
+}
+
static void get_string(AVFormatContext *s, const char *key,
const uint8_t *buf, int buf_size)
{
int i, c;
- char *q, str[512];
+ char *q;
+#define BUF_SIZE 512
+ uint8_t str[BUF_SIZE] = {0};
+ //convert_iso8859_to_string(buf, buf_size, str);
+ memcpy(str, buf, (buf_size<BUF_SIZE)?buf_size:BUF_SIZE);
+#if 0
q = str;
for(i = 0; i < buf_size; i++) {
c = buf[i];
@@ -191,9 +237,11 @@ static void get_string(AVFormatContext *s, const char *key,
*q++ = c;
}
*q = '\0';
+#endif
- if (*str)
+ if (str[0] != '\0') {
av_dict_set(&s->metadata, key, str, 0);
+ }
}
/**
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index 4bc76a3..b4acced 100644..100755
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -210,11 +210,19 @@ static int decode_str(AVFormatContext *s, AVIOContext *pb, int encoding,
switch (encoding) {
case ID3v2_ENCODING_ISO8859:
+#if 0
while (left && ch) {
ch = avio_r8(pb);
PUT_UTF8(ch, tmp, avio_w8(dynbuf, tmp);)
left--;
}
+#endif
+ while (left) {
+ int byte = (char)avio_r8(pb);
+ avio_w8(dynbuf, byte);
+ left--;
+ }
+
break;
case ID3v2_ENCODING_UTF16BOM:
@@ -236,6 +244,33 @@ static int decode_str(AVFormatContext *s, AVIOContext *pb, int encoding,
*maxread = left;
return AVERROR_INVALIDDATA;
}
+
+ int i = 0;
+ int len = left / 2;
+ int tlen = left;
+ int eightBit = 1;
+ uint16_t *framedata = malloc(left+1);
+ memset(framedata, 0, left+1);
+ for (i = 0; i < len; i++) {
+ framedata[i] = get(pb);
+ left -= 2;
+ if (framedata[i] > 0xff) {
+ eightBit = 0;
+ }
+ }
+ if (eightBit) {
+ for (i = 0; i < len; i++) {
+ avio_w8(dynbuf, framedata[i]);
+ }
+ free(framedata);
+ break;
+ }
+ else {
+ free(framedata);
+ left = tlen - left;
+ avio_seek(pb, -left, SEEK_CUR);
+ }
+
// fall-through
case ID3v2_ENCODING_UTF16BE:
@@ -436,6 +471,61 @@ finish:
av_dict_set(m, "date", date, 0);
}
+static int parse_apic_tag(AVFormatContext *s, AVIOContext *pb, int taglen, const char *key, int flag)
+{
+ int cover_len = taglen;
+ char mime[32];
+ char dscrp[512];
+ int ret;
+
+ if(s->cover_data){
+ av_log(s, AV_LOG_INFO, "Has parsed APIC tag!\n");
+ return 0;
+ }
+
+ if(flag) {
+ avio_r8(pb); // Text encoding
+ cover_len --;
+ ret = avio_get_str(pb, cover_len, mime, sizeof(mime)); // MIME Type
+ cover_len -= ret;
+ avio_r8(pb); // Picture Type
+ cover_len --;
+ ret = avio_get_str(pb, cover_len, dscrp, sizeof(dscrp)); // Description
+ cover_len -= ret;
+ } else {
+ avio_r8(pb); // Text encoding
+ cover_len --;
+ ret = avio_get_str(pb, 3, mime, sizeof(mime)); // MIME Type
+ cover_len -= 3;
+ avio_r8(pb); // Picture Type
+ cover_len --;
+ ret = avio_get_str(pb, cover_len, dscrp, sizeof(dscrp)); // Description
+ cover_len -= ret;
+ }
+
+ s->cover_data = av_malloc(cover_len);
+ if(!s->cover_data){
+ av_log(s, AV_LOG_INFO, "no memery, av_alloc failed!\n");
+ return -1;
+ }
+ if(!strcmp(mime,"image/jpeg")) {
+ av_log(NULL, AV_LOG_INFO, "cover is image/jpeg, first byte must be 0xff!\n");
+ do{
+ ret = avio_r8(pb);
+ cover_len --;
+ }while(ret!=0xff& cover_len > 0);
+ avio_seek(pb, -1, SEEK_CUR);
+ cover_len ++;
+ av_log(NULL, AV_LOG_INFO, "[%s:%d]cover data offset=%llx ret=%x\n", __FUNCTION__, __LINE__, avio_tell(pb));
+ }
+ s->cover_data_len = cover_len;
+ avio_read(pb, s->cover_data, cover_len);
+
+ av_dict_set(&s->metadata, "cover_pic", mime, 0);
+
+ return 0;
+}
+
static void free_apic(void *obj)
{
ID3v2ExtraMetaAPIC *apic = obj;
@@ -786,6 +876,10 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
if (tag[0] == 'T')
/* parse text tag */
read_ttag(s, pbx, tlen, &s->metadata, tag);
+ else if(tag[0] == 'A' && tag[1] == 'P' && tag[2] == 'I' && tag[3] == 'C')
+ parse_apic_tag(s, pbx, tlen, tag, isv34);
+ else if(tag[0] == 'P' && tag[1] == 'I' && tag[2] == 'C')
+ parse_apic_tag(s, pbx, tlen, tag, isv34);
else
/* parse special meta tag */
extra_func->read(s, pbx, tlen, tag, extra_meta);
diff --git a/libavformat/mov.c b/libavformat/mov.c
index eec8485..7d026df 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -45,6 +45,7 @@
#include "libavcodec/get_bits.h"
#include "id3v1.h"
#include "mov_chan.h"
+#include "seek.h"
#if CONFIG_ZLIB
#include <zlib.h>
@@ -56,6 +57,7 @@
#undef NDEBUG
#include <assert.h>
+#include "id3v2.h"
/* those functions parse an atom */
/* links atom IDs to parse functions */
typedef struct MOVParseTableEntry {
@@ -233,6 +235,29 @@ static int mov_read_mac_string(MOVContext *c, AVIOContext *pb, int len,
return p - dst;
}
+static int mov_extract_cover_pic(AVFormatContext *s, AVIOContext *pb, int type, int size, char *value)
+{
+ if(s->cover_data){
+ av_log(s, AV_LOG_INFO, "Extract cover picture in other atom!\n");
+ return 0;
+ }
+
+ s->cover_data = av_malloc(size);
+ if(!s->cover_data){
+ av_log(s, AV_LOG_INFO, "no memery, av_alloc failed!\n");
+ return -1;
+ }
+ s->cover_data_len = size;
+ avio_read(pb, s->cover_data, size);
+
+ if (type == 13)
+ strcpy(value, "image/jpeg"); // jpeg
+ else if (type == 14)
+ strcpy(value, "image/png"); // png
+
+ return 0;
+}
+
static int mov_read_covr(MOVContext *c, AVIOContext *pb, int type, int len)
{
AVPacket pkt;
@@ -286,6 +311,140 @@ static int mov_metadata_raw(MOVContext *c, AVIOContext *pb,
return av_dict_set(&c->fc->metadata, key, value, AV_DICT_DONT_STRDUP_VAL);
}
+static int mov_metadata_3gpp_general(MOVContext *c, AVIOContext *pb,
+ unsigned len, const char *key)
+{
+ char key2[16];
+ uint8_t version;
+ uint32_t flags;
+ uint8_t pad;
+ uint16_t langcode;
+ uint16_t shortbytes;
+ char language[4] = {0};
+ char byte = 0;
+ char str[128] = {0};
+ int offset = 0;
+ uint16_t byteOrderMark = 0;
+
+ version = avio_r8(pb); // version
+ flags = avio_rb24(pb); //flags
+ shortbytes = avio_rb16(pb);
+ pad = (shortbytes & 0x8000) >> 15;
+ langcode = shortbytes & 0x7ffff;
+ ff_mov_lang_to_iso639(langcode, language);
+ len -= 6;
+
+ //read BYTE ORDER MARK
+ byteOrderMark = avio_rb16(pb);
+ if (byteOrderMark == 0xFEFF) {//UTF-16BE
+ len -= 2;
+ offset += 2;
+ avio_get_str16be(pb, len, str, 128);
+ av_dict_set(&c->fc->metadata, key, str, 0);
+ } else if (byteOrderMark == 0xFFFE) {//UTF-16LE
+ len -= 2;
+ offset += 2;
+ avio_get_str16le(pb, len, str, 128);
+ av_dict_set(&c->fc->metadata, key, str, 0);
+ } else { //not BYTE ORDER MARK,UTF-8 format
+ avio_seek(pb, -2, SEEK_CUR);
+ avio_read(pb, str+offset, len);
+ str[len] = 0;
+ av_dict_set(&c->fc->metadata, key, str, 0);
+ if (*language && strcmp(language, "und")) {
+ snprintf(key2, sizeof(key2), "%s-%s", key, language);
+ av_dict_set(&c->fc->metadata, key2, str, 0);
+ }
+ }
+ return 0;
+}
+
+static int mov_metadata_3gpp_yrrc(MOVContext *c, AVIOContext *pb,
+ unsigned len, const char *key)
+{
+ uint8_t version;
+ uint32_t flags;
+ char byte = 0;
+ char str[128] = {0};
+ char year[32] = {0};
+ uint16_t yearCode = 0;
+
+ version = avio_r8(pb); // version
+ flags = avio_rb24(pb); //flags
+ len -= 4;
+
+ //get the year when the media was recorded
+ yearCode = avio_rb16(pb);
+ snprintf(year, sizeof(year), "%d", yearCode);
+ av_dict_set(&c->fc->metadata, key, year, 0);
+
+ return 0;
+}
+
+static int mov_metadata_3gpp_album(MOVContext *c, AVIOContext *pb,
+ unsigned len, const char *key)
+{
+ char key2[16];
+ uint8_t version;
+ uint32_t flags;
+ uint8_t pad;
+ uint16_t langcode;
+ uint16_t shortbytes;
+ char language[4] = {0};
+ char byte = 0;
+ int read_byte = 0;
+ char str[128] = {0};
+ int offset = 0;
+ uint16_t byteOrderMark = 0;
+ uint8_t trackNum[16] ={0};
+
+ version = avio_r8(pb); // version
+ flags = avio_rb24(pb); //flags
+ shortbytes = avio_rb16(pb);
+ pad = (shortbytes & 0x8000) >> 15; //pad
+ langcode = shortbytes & 0x7ffff; //language
+ ff_mov_lang_to_iso639(langcode, language);
+ len -= 6;
+
+ //get track num
+ do {
+ byte = avio_r8(pb);
+ read_byte++;
+ } while(byte != '\0');
+ byte = avio_r8(pb);
+ read_byte++;
+ snprintf(trackNum, sizeof(trackNum), "%d", byte);
+ av_dict_set(&c->fc->metadata, "track", trackNum, 0);
+
+ //seek back to get Text of album title
+ avio_seek(pb, -read_byte, SEEK_CUR);
+
+ //read BYTE ORDER MARK
+ byteOrderMark = avio_rb16(pb);
+ if (byteOrderMark == 0xFEFF) {//UTF-16BE
+ len -= 2;
+ offset += 2;
+ avio_get_str16be(pb, len, str, 128);
+ av_dict_set(&c->fc->metadata, key, str, 0);
+ } else if (byteOrderMark == 0xFFFE) {//UTF-16LE
+ len -= 2;
+ offset += 2;
+ avio_get_str16le(pb, len, str, 128);
+ av_dict_set(&c->fc->metadata, key, str, 0);
+ } else { //not BYTE ORDER MARK,UTF-8 format
+ avio_seek(pb, -2, SEEK_CUR);
+ avio_read(pb, str+offset, len);
+ str[len] = 0;
+ av_dict_set(&c->fc->metadata, key, str, 0);
+ if (*language && strcmp(language, "und")) {
+ snprintf(key2, sizeof(key2), "%s-%s", key, language);
+ av_dict_set(&c->fc->metadata, key2, str, 0);
+ }
+ }
+
+ return 0;
+}
+
static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
#ifdef MOV_EXPORT_ALL_METADATA
@@ -295,12 +454,40 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
const char *key = NULL;
uint16_t langcode = 0;
uint32_t data_type = 0, str_size;
+ uint32_t cover_size = 0;
+ int skip_read = 0;
int (*parse)(MOVContext*, AVIOContext*, unsigned, const char*) = NULL;
if (c->itunes_metadata && atom.type == MKTAG('-','-','-','-'))
return mov_read_custom_metadata(c, pb, atom);
switch (atom.type) {
+ case MKTAG('t', 'i', 't', 'l'):
+ key = "title";
+ skip_read = 1;
+ parse = mov_metadata_3gpp_general;
+ break;
+ case MKTAG('a', 'l', 'b', 'm'):
+ key = "album";
+ skip_read = 1;
+ parse = mov_metadata_3gpp_album;
+ break;
+ case MKTAG('d', 's', 'c', 'p'):
+ key = "description";
+ skip_read = 1;
+ parse = mov_metadata_3gpp_general;
+ break;
+ case MKTAG('p', 'e', 'r', 'f'):
+ key = "artist";
+ skip_read = 1;
+ parse = mov_metadata_3gpp_general;
+ break;
+ case MKTAG('y', 'r', 'r', 'c'):
+ key = "year";
+ skip_read = 1;
+ parse = mov_metadata_3gpp_yrrc;
+ break;
+
case MKTAG(0xa9,'n','a','m'): key = "title"; break;
case MKTAG(0xa9,'a','u','t'):
case MKTAG(0xa9,'A','R','T'): key = "artist"; break;
@@ -355,6 +542,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
data_type = avio_rb32(pb); // type
avio_rb32(pb); // unknown
str_size = data_size - 16;
+ cover_size = data_size -16;
atom.size -= 16;
if (atom.type == MKTAG('c', 'o', 'v', 'r')) {
@@ -366,10 +554,15 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
}
} else return 0;
} else if (atom.size > 4 && key && !c->itunes_metadata) {
- str_size = avio_rb16(pb); // string length
- langcode = avio_rb16(pb);
- ff_mov_lang_to_iso639(langcode, language);
- atom.size -= 4;
+ if (skip_read) {
+ str_size = atom.size;
+ }
+ else{
+ str_size = avio_rb16(pb); // string length
+ langcode = avio_rb16(pb);
+ ff_mov_lang_to_iso639(langcode, language);
+ atom.size -= 4;
+ }
} else
str_size = atom.size;
@@ -392,10 +585,17 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
else {
if (data_type == 3 || (data_type == 0 && (langcode < 0x400 || langcode == 0x7fff))) { // MAC Encoded
mov_read_mac_string(c, pb, str_size, str, sizeof(str));
+ } else if (data_type == 13 || data_type == 14){
+ mov_extract_cover_pic(c->fc, pb, data_type, cover_size, str);
} else {
avio_read(pb, str, str_size);
str[str_size] = 0;
}
+ // Android MP4 writer put an additional '/' at the end, discard it.
+ // The CTS test seems the added '/' is not needed.
+ if ((atom.type == MKTAG(0xa9,'x','y','z')) && (str[str_size-1] == 0x2f)) {
+ str[str_size-1] = 0;
+ }
av_dict_set(&c->fc->metadata, key, str, 0);
if (*language && strcmp(language, "und")) {
snprintf(key2, sizeof(key2), "%s-%s", key, language);
@@ -1566,6 +1766,9 @@ static int mov_finalize_stsd_codec(MOVContext *c, AVIOContext *pb,
case AV_CODEC_ID_VC1:
st->need_parsing = AVSTREAM_PARSE_FULL;
break;
+ case AV_CODEC_ID_HEVC:
+ st->need_parsing = AVSTREAM_PARSE_HEADERS;
+ break;
default:
break;
}
@@ -2499,16 +2702,24 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
//Assign clockwise rotate values based on transform matrix so that
//we can compensate for iPhone orientation during capture.
+ if (display_matrix[0][0] == 65536 && display_matrix[1][1] == 65536) {
+ av_dict_set(&st->metadata, "rotate", "0", 0);
+ st->rotation_degree = 0;
+ }
+
if (display_matrix[1][0] == -65536 && display_matrix[0][1] == 65536) {
av_dict_set(&st->metadata, "rotate", "90", 0);
+ st->rotation_degree = 1;
}
if (display_matrix[0][0] == -65536 && display_matrix[1][1] == -65536) {
av_dict_set(&st->metadata, "rotate", "180", 0);
+ st->rotation_degree = 2;
}
if (display_matrix[1][0] == 65536 && display_matrix[0][1] == -65536) {
av_dict_set(&st->metadata, "rotate", "270", 0);
+ st->rotation_degree = 3;
}
// transform the display width/height according to the matrix
@@ -2902,6 +3113,49 @@ static int mov_read_uuid(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return 0;
}
+static void mov_id32_date2year(AVDictionary **m)
+{
+ AVDictionaryEntry *t;
+ if (t = av_dict_get(*m, "date", t, AV_DICT_MATCH_CASE)) {
+ av_dict_set(m, "year", t->value, 0);
+ av_log(NULL, AV_LOG_INFO, "[%s:%d]========date:%s\n", __FUNCTION__, __LINE__, t->value);
+ }
+}
+
+static int mov_read_id32(MOVContext *c, AVIOContext *pb, MOVAtom atom)
+{
+ uint8_t version;
+ uint32_t flags;
+ uint8_t pad;
+ uint16_t langcode;
+ uint16_t shortbytes;
+ char language[4] = {0};
+ uint32_t str_size;
+ AVFormatContext *s = c->fc;
+ ID3v2ExtraMeta *id3v2_extra_meta = NULL;
+
+ str_size = atom.size;
+ version = avio_r8(pb); // version
+ flags = avio_rb24(pb); //flags
+ shortbytes = avio_rb16(pb);
+ pad = (shortbytes & 0x8000) >> 15; //pad
+ langcode = shortbytes & 0x7ffff; //language
+ ff_mov_lang_to_iso639(langcode, language);
+ str_size -= 6;
+ ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
+ if (id3v2_extra_meta) {
+ int err = ff_id3v2_parse_apic(s, &id3v2_extra_meta);
+ if (err < 0) {
+ av_log(NULL, AV_LOG_INFO, "[%s:%d]ff_id3v2_parse_apic err:%d\n", __FUNCTION__, __LINE__, err);
+ return err;
+ }
+ }
+ ff_id3v2_free_extra_meta(&id3v2_extra_meta);
+ mov_id32_date2year(&s->metadata);
+
+ return 0;
+}
+
static const MOVParseTableEntry mov_default_parse_table[] = {
{ MKTAG('A','C','L','R'), mov_read_avid },
{ MKTAG('A','P','R','G'), mov_read_avid },
@@ -2968,6 +3222,8 @@ static const MOVParseTableEntry mov_default_parse_table[] = {
{ MKTAG('h','v','c','C'), mov_read_glbl },
{ MKTAG('u','u','i','d'), mov_read_uuid },
{ MKTAG('C','i','n', 0x8e), mov_read_targa_y216 },
+{ MKTAG('I','D','3','2'), mov_read_id32 },
+
{ 0, NULL }
};
@@ -3069,7 +3325,7 @@ static int mov_probe(AVProbeData *p)
offset = 0;
for (;;) {
/* ignore invalid offset */
- if ((offset + 8) > (unsigned int)p->buf_size)
+ if ((offset + 8) > p->buf_size)
break;
tag = AV_RL32(p->buf + offset + 4);
switch(tag) {
@@ -3525,6 +3781,93 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
return 0;
}
+
+static int64_t mov_read_seek_sync(AVFormatContext *s,
+ int stream_index,
+ int64_t min_ts,
+ int64_t target_ts,
+ int64_t max_ts,
+ int flags)
+{
+ int64_t pos, t_pos;
+
+ int64_t ts_ret, ts_adj;
+ int stream_index_gen_search = stream_index;
+ int sample, i;
+ AVStream *st;
+ AVParserState *backup;
+
+ backup = ff_store_parser_state(s);
+
+ // detect direction of seeking for search purposes
+ flags |= (target_ts - min_ts > (uint64_t)(max_ts - target_ts)) ?
+ AVSEEK_FLAG_BACKWARD : 0;
+
+ st = s->streams[stream_index_gen_search];
+ sample = av_index_search_timestamp(st, target_ts, AVSEEK_FLAG_ANY);
+ pos = st->index_entries[sample].pos;
+ target_ts = st->index_entries[sample].timestamp;
+ for (i = 0; i < s->nb_streams; i++) {
+ MOVStreamContext *sc = s->streams[i]->priv_data;
+ sc->current_sample = (sample - 500) > 0 ? (sample - 500) : 0; // hard code for mov, repos the sample.
+ }
+
+ // search for actual matching keyframe/starting position for all streams
+ if ((t_pos = ff_gen_syncpoint_search(s, stream_index, pos,
+ min_ts, target_ts, max_ts,
+ flags)) < 0) {
+ ff_restore_parser_state(s, backup);
+ return -1;
+ }
+
+ ff_free_parser_state(s, backup);
+ return t_pos;
+}
+
+static int64_t mov_read_seek2(AVFormatContext *s, int stream_index, int64_t target_ts, int flags){
+ int ret;
+ if (flags & AVSEEK_FLAG_BACKWARD) {
+ flags &= ~AVSEEK_FLAG_BACKWARD;
+ ret = mov_read_seek_sync(s, stream_index, INT64_MIN, target_ts, target_ts, flags);
+ if (ret < 0) {
+ // for compatibility reasons, seek to the best-fitting timestamp
+ ret = mov_read_seek_sync(s, stream_index, INT64_MIN, target_ts, INT64_MAX, flags);
+ }
+ } else {
+ ret = mov_read_seek_sync(s, stream_index, target_ts, target_ts, INT64_MAX, flags);
+ if (ret < 0)
+ // for compatibility reasons, seek to the best-fitting timestamp
+ ret = mov_read_seek_sync(s, stream_index, INT64_MIN, target_ts, INT64_MAX, flags);
+ }
+ return ret;
+}
+
+static int mov_index_search_pos(const AVIndexEntry *entries, int nb_entries,
+ int64_t pos, int flags)
+{
+ int a, b, m;
+ int64_t ppos;
+
+ a = - 1;
+ b = nb_entries;
+
+ //optimize appending index entries at the end
+ if(b && entries[b-1].pos < pos)
+ a= b-1;
+
+ while (b - a > 1) {
+ m = (a + b) >> 1;
+ ppos = entries[m].pos;
+ if(ppos >= pos)
+ b = m;
+ if(ppos <= pos)
+ a = m;
+ }
+
+ m= (flags & AVSEEK_FLAG_BACKWARD) ? a : b;
+ return m;
+}
+
static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp, int flags)
{
MOVStreamContext *sc = st->priv_data;
@@ -3532,6 +3875,14 @@ static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp,
int i;
sample = av_index_search_timestamp(st, timestamp, flags);
+
+ // mov's stss is wrong sometimes, need to read seek
+ // added by senbai.tao
+ if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO && sample <=0 && st->nb_index_entries && sc->keyframe_count <= 1) {
+ int64_t sync_point = mov_read_seek2(s, st->index, timestamp, flags);
+ sample = mov_index_search_pos(st->index_entries, st->nb_index_entries, sync_point, AVSEEK_FLAG_ANY);
+ }
+
av_dlog(s, "stream %d, timestamp %"PRId64", sample %d\n", st->index, timestamp, sample);
if (sample < 0 && st->nb_index_entries && timestamp < st->index_entries[0].timestamp)
sample = 0;
diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index 30ec777..6e72e17 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -198,11 +198,79 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
return 0;
}
+static int read_id3_version(AVIOContext * pb)
+{
+ struct id3_header {
+ char id[3];
+ uint8_t version_major;
+ uint8_t version_minor;
+ uint8_t flags;
+ uint8_t enc_size[4];
+ };
+ struct id3_header header;
+ avio_seek(pb, 0, SEEK_SET);
+ avio_read(pb, &header, sizeof(struct id3_header));
+ avio_seek(pb, -sizeof(struct id3_header), SEEK_CUR);
+ if (memcmp(header.id, "ID3", 3)) {
+ return 1;
+ }
+ if (header.version_major == 0xff || header.version_minor == 0xff) {
+ return 0;
+ }
+ if (header.version_major == 2) {
+ if (header.flags & 0x3f) {
+ // We only support the 2 high bits, if any of the lower bits are
+ // set, we cannot guarantee to understand the tag format.
+ return 0;
+ }
+
+ if (header.flags & 0x40) {
+ // No compression scheme has been decided yet, ignore the
+ // tag if compression is indicated.
+
+ return 0;
+ }
+ return 2;
+ } else if (header.version_major == 3) {
+ if (header.flags & 0x1f) {
+ // We only support the 3 high bits, if any of the lower bits are
+ // set, we cannot guarantee to understand the tag format.
+ return 0;
+ }
+ return 3;
+ } else if (header.version_major == 4) {
+ if (header.flags & 0x0f) {
+ // The lower 4 bits are undefined in this spec.
+ return 0;
+ }
+ return 4;
+ } else {
+ return 0;
+ }
+}
+
+static int mp3_read_id32(AVFormatContext *s)
+{
+ ID3v2ExtraMeta *id3v2_extra_meta = NULL;
+ int err;
+ ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
+ if (id3v2_extra_meta) {
+ int err = ff_id3v2_parse_apic(s, &id3v2_extra_meta);
+ if (err < 0) {
+ av_log(NULL, AV_LOG_INFO, "[%s:%d]ff_id3v2_parse_apic err:%d\n", __FUNCTION__, __LINE__, err);
+ return err;
+ }
+ }
+ ff_id3v2_free_extra_meta(&id3v2_extra_meta);
+ return 0;
+}
+
static int mp3_read_header(AVFormatContext *s)
{
MP3DecContext *mp3 = s->priv_data;
AVStream *st;
int64_t off;
+ int version = 0;
st = avformat_new_stream(s, NULL);
if (!st)
@@ -219,8 +287,23 @@ static int mp3_read_header(AVFormatContext *s)
s->pb->maxsize = -1;
off = avio_tell(s->pb);
+ version = read_id3_version(s->pb);
+ switch (version) {
+ case 1:
+ ff_id3v1_read(s);
+ break;
+ case 2:
+ case 3:
+ case 4:
+ mp3_read_id32(s);
+ break;
+ default:
+ return -1;
+ }
+#if 0
if (!av_dict_get(s->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX))
ff_id3v1_read(s);
+#endif
if(s->pb->seekable)
mp3->filesize = avio_size(s->pb);
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index c91018e..22fb33c 100644..100755
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -125,6 +125,8 @@ struct MpegTSContext {
/** to detect seek */
int64_t last_pos;
+ int64_t first_pcrscr;
+
/******************************************/
/* private mpegts data */
/* scan context */
@@ -2145,6 +2147,8 @@ static int mpegts_read_header(AVFormatContext *s)
int len;
int64_t pos;
+ ts->first_pcrscr=AV_NOPTS_VALUE;
+
ffio_ensure_seekback(pb, s->probesize);
/* read the first 8192 bytes to get packet size */
@@ -2381,7 +2385,7 @@ static int64_t mpegts_get_dts(AVFormatContext *s, int stream_index,
if(ret < 0)
return AV_NOPTS_VALUE;
av_free_packet(&pkt);
- if(pkt.dts != AV_NOPTS_VALUE && pkt.pos >= 0){
+ if(pkt.dts != AV_NOPTS_VALUE && pkt.pos >= 0 && (pkt.flags & AV_PKT_FLAG_KEY)){
ff_reduce_index(s, pkt.stream_index);
av_add_index_entry(s->streams[pkt.stream_index], pkt.pos, pkt.dts, 0, 0, AVINDEX_KEYFRAME /* FIXME keyframe? */);
if(pkt.stream_index == stream_index && pkt.pos >= *ppos){
@@ -2395,6 +2399,89 @@ static int64_t mpegts_get_dts(AVFormatContext *s, int stream_index,
return AV_NOPTS_VALUE;
}
+static int read_seek2(AVFormatContext *s,
+ int stream_index,
+ int64_t min_ts,
+ int64_t target_ts,
+ int64_t max_ts,
+ int flags)
+{
+ int64_t pos;
+
+ int64_t ts_ret, ts_adj;
+ int stream_index_gen_search;
+ AVStream *st;
+ AVParserState *backup;
+
+ backup = ff_store_parser_state(s);
+
+ // detect direction of seeking for search purposes
+ flags |= (target_ts - min_ts > (uint64_t)(max_ts - target_ts)) ?
+ AVSEEK_FLAG_BACKWARD : 0;
+
+ if (flags & AVSEEK_FLAG_BYTE) {
+ // use position directly, we will search starting from it
+ pos = target_ts;
+ } else {
+ // search for some position with good timestamp match
+ if (stream_index < 0) {
+ stream_index_gen_search = av_find_default_stream_index(s);
+ if (stream_index_gen_search < 0) {
+ ff_restore_parser_state(s, backup);
+ return -1;
+ }
+
+ st = s->streams[stream_index_gen_search];
+ // timestamp for default must be expressed in AV_TIME_BASE units
+ ts_adj = av_rescale(target_ts,
+ st->time_base.den,
+ AV_TIME_BASE * (int64_t)st->time_base.num);
+ } else {
+ ts_adj = target_ts;
+ stream_index_gen_search = stream_index;
+ }
+ pos = ff_gen_search(s, stream_index_gen_search, ts_adj,
+ 0, INT64_MAX, -1,
+ AV_NOPTS_VALUE,
+ AV_NOPTS_VALUE,
+ flags, &ts_ret, mpegts_get_dts);
+ if (pos < 0) {
+ ff_restore_parser_state(s, backup);
+ return -1;
+ }
+ }
+
+ // search for actual matching keyframe/starting position for all streams
+ if (ff_gen_syncpoint_search(s, stream_index, pos,
+ min_ts, target_ts, max_ts,
+ flags) < 0) {
+ ff_restore_parser_state(s, backup);
+ return -1;
+ }
+
+ ff_free_parser_state(s, backup);
+ return 0;
+}
+
+static int mpegts_read_seek(AVFormatContext *s, int stream_index, int64_t target_ts, int flags){
+ int ret;
+ if (flags & AVSEEK_FLAG_BACKWARD) {
+ flags &= ~AVSEEK_FLAG_BACKWARD;
+ ret = read_seek2(s, stream_index, INT64_MIN, target_ts, target_ts, flags);
+ if (ret < 0) {
+ // for compatibility reasons, seek to the best-fitting timestamp
+ ret = read_seek2(s, stream_index, INT64_MIN, target_ts, INT64_MAX, flags);
+ }
+ } else {
+ ret = read_seek2(s, stream_index, target_ts, target_ts, INT64_MAX, flags);
+ if (ret < 0)
+ // for compatibility reasons, seek to the best-fitting timestamp
+ ret = read_seek2(s, stream_index, INT64_MIN, target_ts, INT64_MAX, flags);
+ }
+ return ret;
+}
+
+
/**************************************************************/
/* parsing functions - called from other demuxers such as RTP */
@@ -2456,8 +2543,9 @@ AVInputFormat ff_mpegts_demuxer = {
.read_header = mpegts_read_header,
.read_packet = mpegts_read_packet,
.read_close = mpegts_read_close,
+ .read_seek = mpegts_read_seek,
.read_timestamp = mpegts_get_dts,
- .flags = AVFMT_SHOW_IDS | AVFMT_TS_DISCONT,
+ .flags = AVFMT_SHOW_IDS | AVFMT_TS_DISCONT | AVFMT_GENERIC_INDEX,
.priv_class = &mpegts_class,
};
@@ -2468,7 +2556,8 @@ AVInputFormat ff_mpegtsraw_demuxer = {
.read_header = mpegts_read_header,
.read_packet = mpegts_raw_read_packet,
.read_close = mpegts_read_close,
+ .read_seek = mpegts_read_seek,
.read_timestamp = mpegts_get_dts,
- .flags = AVFMT_SHOW_IDS | AVFMT_TS_DISCONT,
+ .flags = AVFMT_SHOW_IDS | AVFMT_TS_DISCONT | AVFMT_GENERIC_INDEX,
.priv_class = &mpegtsraw_class,
};
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3bb837a..dbadc4f 100644..100755
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3250,6 +3250,9 @@ void avformat_free_context(AVFormatContext *s)
if (!s)
return;
+ if(s->cover_data)
+ av_free(s->cover_data);
+
av_opt_free(s);
if (s->iformat && s->iformat->priv_class && s->priv_data)
av_opt_free(s->priv_data);
diff --git a/libavformat/vorbiscomment.c b/libavformat/vorbiscomment.c
index f17a0c1..051ac04 100644
--- a/libavformat/vorbiscomment.c
+++ b/libavformat/vorbiscomment.c
@@ -35,6 +35,10 @@ const AVMetadataConv ff_vorbiscomment_metadata_conv[] = {
{ "TRACKNUMBER", "track" },
{ "DISCNUMBER", "disc" },
{ "DESCRIPTION", "comment" },
+ { "ARTIST", "artist" },
+ { "ALBUM", "album" },
+ { "TITLE", "title" },
+ { "GENRE", "genre" },
{ 0 }
};
diff --git a/libavutil/avconfig.h b/libavutil/avconfig.h
new file mode 100644
index 0000000..f6685b7
--- a/dev/null
+++ b/libavutil/avconfig.h
@@ -0,0 +1,8 @@
+/* Generated by ffconf */
+#ifndef AVUTIL_AVCONFIG_H
+#define AVUTIL_AVCONFIG_H
+#define AV_HAVE_BIGENDIAN 0
+#define AV_HAVE_FAST_UNALIGNED 1
+#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
+#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
+#endif /* AVUTIL_AVCONFIG_H */
diff --git a/libavutil/log.c b/libavutil/log.c
index 56ef53b..65c831a 100644..100755
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -78,6 +78,18 @@ static HANDLE con;
#define set_color(x) SetConsoleTextAttribute(con, background | color[x])
#define set_256color set_color
#define reset_color() SetConsoleTextAttribute(con, attr_orig)
+#elif defined(ANDROID)
+#include <android/log.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#define LOG_TAG "exffmpeg"
+#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
+#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
+#define set_color(x)
+#define reset_color()
+#define set_256color set_color
+#define LOG(tag,...) __android_log_print(ANDROID_LOG_INFO,tag,__VA_ARGS__)
#else
static const uint32_t color[16 + AV_CLASS_CATEGORY_NB] = {
@@ -136,7 +148,11 @@ static void colored_fputs(int level, const char *str)
set_color(level);
} else if (use_color == 256)
set_256color(level);
- fputs(str, stderr);
+#ifdef ANDROID
+ LOGI("%s", str);
+#else
+ fputs(str, stderr);
+#endif
if (use_color) {
reset_color();
}