From bb83478d2c91db2c9150bb78568ccef25f0e975f Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 5 Jul 2011 14:58:49 +0200 Subject: [PATCH 01/28] build: remove unused copy regression test script The copy regression test script is unused, bash-specific and did not even work properly when it was originally committed. --- tests/copy.regression.ref | 465 -------------------------------------- tests/copycooker.sh | 30 --- 2 files changed, 495 deletions(-) delete mode 100644 tests/copy.regression.ref delete mode 100755 tests/copycooker.sh diff --git a/tests/copy.regression.ref b/tests/copy.regression.ref deleted file mode 100644 index 0f62a7be75..0000000000 --- a/tests/copy.regression.ref +++ /dev/null @@ -1,465 +0,0 @@ ----------------- -./tests/data/a-ac3.rm -first.nut second.nut differ: char 34, line 1 -1dd5a62b7edb3a1bcf77626af0a85bc1 first.nut ----------------- -./tests/data/a-adpcm_ima.wav -first.nut second.nut differ: char 34, line 1 -c95390143078f08db8a3bfba5789c2da first.nut ----------------- -./tests/data/a-adpcm_ms.wav -first.nut second.nut differ: char 34, line 1 -05e4d8842f4001fed506423e1a8ef963 first.nut ----------------- -./tests/data/a-adpcm_qt.aiff -first.nut second.nut differ: char 34, line 1 -7455d87f626f05e20030f4c93ec91e69 first.nut ----------------- -./tests/data/a-adpcm_swf.flv -c0402ee010a483403a655f353e184df1 first.nut ----------------- -./tests/data/a-adpcm_yam.wav -first.nut second.nut differ: char 34, line 1 -f861047f6c6f75cdf3ce7bb78a4003ad first.nut ----------------- -./tests/data/a-alac.m4a -first.nut second.nut differ: char 34, line 1 -ab152b0b01e540e74b04a807e3882083 first.nut ----------------- -./tests/data/a-asv1.avi -636fc0dfef1830cc51cf2c182bd4a7b2 first.nut ----------------- -./tests/data/a-asv2.avi -bbfc299390378c7bdbd7463434d8fcbe first.nut ----------------- -./tests/data/a-dnxhd-1080i.mov -first.nut second.nut differ: char 113, line 1 -037e31900e6cdf7161c2a0df23d9dc9d first.nut ----------------- -./tests/data/a-dnxhd-720p-rd.dnxhd -first.nut second.nut differ: char 113, line 1 -1237abac554ea9adb2a926641eec0de0 first.nut ----------------- -./tests/data/a-dnxhd-720p.dnxhd -first.nut second.nut differ: char 113, line 1 -6694322cefa2f482bc3dac8be22eb5d5 first.nut ----------------- -./tests/data/a-dv.dv -1aa367a56d31bb45f98d820121820909 first.nut ----------------- -./tests/data/a-dv411.dv -7ef296512960e00d96850f2606b4b683 first.nut ----------------- -./tests/data/a-dv50.dv -6424dd39e22a1789a8182d7e8da224a9 first.nut ----------------- -./tests/data/a-error-mpeg4-adv.avi -715b262e3e7c9be2b59525ba0289f30e first.nut ----------------- -./tests/data/a-ffv1.avi -edada4da2170ffd3386636cff67a90f0 first.nut ----------------- -./tests/data/a-flac.flac -d5e0a6d87034c21627afb2a904412a21 first.nut ----------------- -./tests/data/a-flashsv.flv -985076a8a87df1f91b34cbb81ce96217 first.nut ----------------- -./tests/data/a-flv.flv -6d01a0eb07c15ec3d0a70bfad0615bec first.nut ----------------- -./tests/data/a-g726.wav -first.nut second.nut differ: char 34, line 1 -59540b44c97b8e1eafc53ebdaeaf3eb8 first.nut ----------------- -./tests/data/a-h261.avi -18d47cc50e05e5c855a8aec1a5d8d9ec first.nut ----------------- -./tests/data/a-h263.avi -91b67a478420a30cf10c3d872f7e799b first.nut ----------------- -./tests/data/a-h263p.avi -1e9f108181dca2dd3bb621bb45fc5834 first.nut ----------------- -./tests/data/a-huffyuv.avi -62dccc2a428b561c08497f8378ea1567 first.nut ----------------- -./tests/data/a-jpegls.avi -35f1bb0f9b14bf3eb29134784f278c4f first.nut ----------------- -./tests/data/a-ljpeg.avi -45ec1072d8e55d6cfa784cc732830f3c first.nut ----------------- -./tests/data/a-mjpeg.avi -4e6d42fdda880661de8308cfa45652ee first.nut ----------------- -./tests/data/a-mp2.mp2 -6c8d1a33dd994d63c68e5c9953b5cb8c first.nut ----------------- -./tests/data/a-mpeg1.mpg -first.nut second.nut differ: char 34, line 1 -9d444c67713ef70c06d35fd355200ed5 first.nut ----------------- -./tests/data/a-mpeg1b.mpg -first.nut second.nut differ: char 34, line 1 -9d444c67713ef70c06d35fd355200ed5 first.nut ----------------- -./tests/data/a-mpeg2.mpg -first.nut second.nut differ: char 34, line 1 -328f6a0069b76397c5ed0dcea8b69b50 first.nut ----------------- -./tests/data/a-mpeg2.mpg -first.nut second.nut differ: char 34, line 1 -328f6a0069b76397c5ed0dcea8b69b50 first.nut ----------------- -./tests/data/a-mpeg2_422.mpg -first.nut second.nut differ: char 34, line 1 -d27035bcf30801cd1bee6ac59e8f5e3e first.nut ----------------- -./tests/data/a-mpeg2i.mpg -first.nut second.nut differ: char 34, line 1 -c3351b79649825a6b9f62a2a1db633c1 first.nut ----------------- -./tests/data/a-mpeg2ivlc-qprd.mpg -first.nut second.nut differ: char 34, line 1 -d910da52fa10eb1deca10fa9443132d2 first.nut ----------------- -./tests/data/a-mpeg2reuse.mpg -first.nut second.nut differ: char 34, line 1 -c3351b79649825a6b9f62a2a1db633c1 first.nut ----------------- -./tests/data/a-mpeg2thread.mpg -first.nut second.nut differ: char 34, line 1 -c3351b79649825a6b9f62a2a1db633c1 first.nut ----------------- -./tests/data/a-mpeg2threadivlc.mpg -first.nut second.nut differ: char 34, line 1 -c3351b79649825a6b9f62a2a1db633c1 first.nut ----------------- -./tests/data/a-mpeg4-Q.avi -first.nut second.nut differ: char 34, line 1 -305bab90451e2c3b741e3aef51bc2a4c first.nut ----------------- -./tests/data/a-mpeg4-adap.avi -first.nut second.nut differ: char 34, line 1 -5d9315ec49c4122f6f23cf84cab5fc53 first.nut ----------------- -./tests/data/a-mpeg4-adv.avi -5d672bf4c2e879d6a20e349cb4dc09a6 first.nut ----------------- -./tests/data/a-mpeg4-nr.avi -0243b2e03115fe948f99da1ee10ae588 first.nut ----------------- -./tests/data/a-mpeg4-qprd.avi -first.nut second.nut differ: char 34, line 1 -5d9315ec49c4122f6f23cf84cab5fc53 first.nut ----------------- -./tests/data/a-mpeg4-rc.avi -first.nut second.nut differ: char 34, line 1 -5d9315ec49c4122f6f23cf84cab5fc53 first.nut ----------------- -./tests/data/a-mpeg4-thread.avi -first.nut second.nut differ: char 34, line 1 -6aa94d589e9e7626e51575d8a2aec6e7 first.nut ----------------- -./tests/data/a-msmpeg4.avi -836d432509ff22fd363237ef1dced5f3 first.nut ----------------- -./tests/data/a-msmpeg4v2.avi -37f253da3666fb057edecb86ed2dba39 first.nut ----------------- -./tests/data/a-odivx.mp4 -e3bd9d8a3417abc749c489e64119dbf3 first.nut ----------------- -./tests/data/a-pcm_alaw.wav -first.nut second.nut differ: char 34, line 1 -22853e7806b0f0162fd5e2573e34b03c first.nut ----------------- -./tests/data/a-pcm_f32be.au -first.nut second.nut differ: char 34, line 1 -94cb60c3107ec509af79191e86099a0e first.nut ----------------- -./tests/data/a-pcm_f32le.wav -first.nut second.nut differ: char 34, line 1 -8d887b27a8531390af5b682557631986 first.nut ----------------- -./tests/data/a-pcm_f64be.au -first.nut second.nut differ: char 34, line 1 -e0c7b64e13bb9398a57dac60806515fb first.nut ----------------- -./tests/data/a-pcm_f64le.wav -first.nut second.nut differ: char 34, line 1 -9dbb9bda0c990502e910e082a008433f first.nut ----------------- -./tests/data/a-pcm_mulaw.wav -first.nut second.nut differ: char 34, line 1 -78c4aae32fdddaba4f9caa5683018c94 first.nut ----------------- -./tests/data/a-pcm_s16be.mkv -first.nut second.nut differ: char 34, line 1 -279810a0c30a06c4ab7de154e3de140d first.nut ----------------- -./tests/data/a-pcm_s16be.mov -first.nut second.nut differ: char 42, line 1 -0a8ede3d121f17a98e9038771eb98e1a first.nut ----------------- -./tests/data/a-pcm_s16le.mkv -47942f5188f8d081bcbe7fb82550b135 first.nut ----------------- -./tests/data/a-pcm_s16le.wav -first.nut second.nut differ: char 34, line 1 -9f868acb99ba107750f165431f95c382 first.nut ----------------- -./tests/data/a-pcm_s24be.mov -first.nut second.nut differ: char 34, line 1 -9c96762f631851014dec14b506091cc1 first.nut ----------------- -./tests/data/a-pcm_s24daud.302 -60ecb7037b205e2013490fdadab9697b first.nut ----------------- -./tests/data/a-pcm_s24le.wav -first.nut second.nut differ: char 34, line 1 -5805a2e6e2eddede4757fd488d0d6adb first.nut ----------------- -./tests/data/a-pcm_s32be.mov -first.nut second.nut differ: char 34, line 1 -d6c868a1130be573bbe0cfc88913a60c first.nut ----------------- -./tests/data/a-pcm_s32le.wav -first.nut second.nut differ: char 34, line 1 -3e0a81669647739c490f12521f897527 first.nut ----------------- -./tests/data/a-pcm_s8.mov -first.nut second.nut differ: char 34, line 1 -a6fe0827966ee4515f27c7053d579229 first.nut ----------------- -./tests/data/a-pcm_u8.wav -first.nut second.nut differ: char 34, line 1 -f0d398fd651cdedfd7b4c5433c08fd79 first.nut ----------------- -./tests/data/a-pcm_zork.wav -first.nut second.nut differ: char 34, line 1 -69e40cc9266836a7101000677ee14a87 first.nut ----------------- -./tests/data/a-roqav.roq -first.nut second.nut differ: char 34, line 1 -0e7a57bb28054b7e319eac2ba0a4be23 first.nut ----------------- -./tests/data/a-rv10.rm -first.nut second.nut differ: char 34, line 1 -80f982c6bffea91ff45a9b320cb93c14 first.nut ----------------- -./tests/data/a-rv20.rm -first.nut second.nut differ: char 34, line 1 -5b02113c0941578ca6918215eed8a728 first.nut ----------------- -./tests/data/a-snow.avi -e73b88690aa491491ede5970641134ad first.nut ----------------- -./tests/data/a-snow53.avi -18a6b061252c8c74bd22b42a7d5b2bae first.nut ----------------- -./tests/data/a-svq1.mov -first.nut second.nut differ: char 197, line 1 -6bbe90d47c1763654e8388ce51ab911e first.nut ----------------- -./tests/data/a-wmav1.asf -first.nut second.nut differ: char 34, line 1 -c3f7bc239ff166d738b29252b47bd437 first.nut ----------------- -./tests/data/a-wmav2.asf -first.nut second.nut differ: char 34, line 1 -930f1824b9677f0b6b714f1c6ddcf825 first.nut ----------------- -./tests/data/a-wmv1.avi -206bd9985b575f61a8a580656af39beb first.nut ----------------- -./tests/data/a-wmv2.avi -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf-bgr24.yuv -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf-gray.yuv -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf-monob.yuv -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf-monow.yuv -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf-rgb24.yuv -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf-rgb32.yuv -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf-rgb555.yuv -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf-rgb565.yuv -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf-yuv410p.yuv -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf-yuv411p.yuv -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf-yuv420p.yuv -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf-yuv422p.yuv -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf-yuv440p.yuv -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf-yuv444p.yuv -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf-yuvj420p.yuv -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf-yuvj422p.yuv -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf-yuvj440p.yuv -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf-yuvj444p.yuv -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf-yuyv422.yuv -09178a3c2b99d4f7ad1f7a761a2b803a first.nut ----------------- -./tests/data/b-lavf.aif -first.nut second.nut differ: char 34, line 1 -3f1d3faae1671f1cf862ddb66a5c59d1 first.nut ----------------- -./tests/data/b-lavf.al -e6d4b977e74a535b039a6a1dfed2dbc1 first.nut ----------------- -./tests/data/b-lavf.asf -first.nut second.nut differ: char 34, line 1 -57727c41b3974697c0a79cfd08515ddd first.nut ----------------- -./tests/data/b-lavf.au -first.nut second.nut differ: char 34, line 1 -1da12f41bc5ea1fd851e8a48b222c204 first.nut ----------------- -./tests/data/b-lavf.avi -a88edf9fb8e02e658ba3cae9313a3cdc first.nut ----------------- -./tests/data/b-lavf.dv -first.nut second.nut differ: char 34, line 1 -819018a5d91c55312ffe784e8712ac4b first.nut ----------------- -./tests/data/b-lavf.ffm -first.nut second.nut differ: char 34, line 1 -17f8894a05c71adb51c9a0ff1b9040bb first.nut ----------------- -./tests/data/b-lavf.flv -d74edb56e74e0eea748863f3aeeafa61 first.nut ----------------- -./tests/data/b-lavf.gif -first.nut second.nut differ: char 34, line 1 -ef9ba6bf88f44d9d326049ef2872a4d3 first.nut ----------------- -./tests/data/b-lavf.gxf -first.nut second.nut differ: char 44, line 1 -522957f46ba46051fd03a0868c905e54 first.nut ----------------- -./tests/data/b-lavf.mkv -8c9427bb75c96210d6580d9b881d9e4d first.nut ----------------- -./tests/data/b-lavf.mmf -first.nut second.nut differ: char 42, line 1 -298136aef02389fc5b0844995fe6ac72 first.nut ----------------- -./tests/data/b-lavf.mov -ce895b33ff206fafbae89fd5a8f959d2 first.nut ----------------- -./tests/data/b-lavf.mpg -d279e3343993267241c2fac4f4563cdb first.nut ----------------- -./tests/data/b-lavf.mxf -first.nut second.nut differ: char 34, line 1 -3e98a90d40986b8ea4305be06175927a first.nut ----------------- -./tests/data/b-lavf.mxf_d10 -1ee69644165344a096ddfaaac951a0e9 first.nut ----------------- -./tests/data/b-lavf.nut -1426bca4c65796516a3e94b6bebc5a58 first.nut ----------------- -./tests/data/b-lavf.ogg -c986ce79045f2068ae1bedc2b8702884 first.nut ----------------- -./tests/data/b-lavf.rm -first.nut second.nut differ: char 34, line 1 -a3b2c9d3ec2c86b6d4c3bf0ed91391c3 first.nut ----------------- -./tests/data/b-lavf.swf -first.nut second.nut differ: char 34, line 1 -d4a5c5e6343dc17bed49397d889e0799 first.nut ----------------- -./tests/data/b-lavf.ts -40fd2ece0c8386d3a250943eab023795 first.nut ----------------- -./tests/data/b-lavf.ul -1c4c747e2e9c0fd195656359341eef76 first.nut ----------------- -./tests/data/b-lavf.voc -first.nut second.nut differ: char 42, line 1 -500ef42830c5bc2af849dbdcc4380f1b first.nut ----------------- -./tests/data/b-lavf.wav -first.nut second.nut differ: char 42, line 1 -8d4c6a79af442610ad912625c9b85d02 first.nut ----------------- -./tests/data/b-lavf.y4m -f42a6ff4488de306925b057ecee75b0e first.nut ----------------- -./tests/data/b-lavf02.bmp -first.nut second.nut differ: char 113, line 1 -02e3c782ef3a0c96e820201d4d4b8268 first.nut ----------------- -./tests/data/b-lavf02.jpg -61a19c3012a5aa056d8e9a589e29de2e first.nut ----------------- -./tests/data/b-lavf02.pcx -first.nut second.nut differ: char 113, line 1 -3c4e1b9c8d5dd2bedb8eebd1edc7a2f5 first.nut ----------------- -./tests/data/b-lavf02.pgm -first.nut second.nut differ: char 113, line 1 -cc36bdadd7aef501a6d5d588dec2188b first.nut ----------------- -./tests/data/b-lavf02.ppm -first.nut second.nut differ: char 113, line 1 -453ec690bea6c3668e2b65e0b7ad14c8 first.nut ----------------- -./tests/data/b-lavf02.sgi -first.nut second.nut differ: char 113, line 1 -6cdadd58aaa5ad196697352e96723e52 first.nut ----------------- -./tests/data/b-lavf02.tga -4144d2b4ee2948c1a16f7fc31b381be3 first.nut ----------------- -./tests/data/b-lavf02.tiff -first.nut second.nut differ: char 113, line 1 -237fa2da2d5f4930dae9825c9cf928a6 first.nut ----------------- -./tests/data/b-pbmpipe.pbm -first.nut second.nut differ: char 113, line 1 -2c65ef7188398da8a5f107b9dd5fb998 first.nut ----------------- -./tests/data/b-pgmpipe.pgm -first.nut second.nut differ: char 113, line 1 -b7e98248ada1e6f7170bc7fedee3825c first.nut ----------------- -./tests/data/b-ppmpipe.ppm -first.nut second.nut differ: char 113, line 1 -869fcefe430c35a9a8e46fd5f040b62e first.nut diff --git a/tests/copycooker.sh b/tests/copycooker.sh deleted file mode 100755 index 3118e3f842..0000000000 --- a/tests/copycooker.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -LC_ALL=C -export LC_ALL - -datadir="tests/data" - -logfile="$datadir/copy.regression" -reffile="$1" - -list=$(grep -oh ' ./tests/data/.*' tests/ref/{acodec,lavf,vsynth1}/*| sort) -rm -f $logfile -for i in $list ; do - echo ---------------- >> $logfile - echo $i >> $logfile - ./ffmpeg -flags +bitexact -i $i -acodec copy -vcodec copy -y first.nut - ./ffmpeg -flags +bitexact -i first.nut -acodec copy -vcodec copy -y second.nut - cmp first.nut second.nut >> $logfile - md5sum first.nut >> $logfile -done - -if diff -u -w "$reffile" "$logfile" ; then - echo - echo copy regression test: success - exit 0 -else - echo - echo copy regression test: error - exit 1 -fi From f9853c1b9c4b4a0b8599e4dbce292586e87100cc Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 26 Apr 2011 14:28:45 +0200 Subject: [PATCH 02/28] libavdevice: Remove disabled code. --- libavdevice/oss_audio.c | 7 ------- libavdevice/x11grab.c | 15 --------------- 2 files changed, 22 deletions(-) diff --git a/libavdevice/oss_audio.c b/libavdevice/oss_audio.c index fcbe26ba93..6e25288dba 100644 --- a/libavdevice/oss_audio.c +++ b/libavdevice/oss_audio.c @@ -80,13 +80,6 @@ static int audio_open(AVFormatContext *s1, int is_output, const char *audio_devi fcntl(audio_fd, F_SETFL, O_NONBLOCK); s->frame_size = AUDIO_BLOCK_SIZE; -#if 0 - tmp = (NB_FRAGMENTS << 16) | FRAGMENT_BITS; - err = ioctl(audio_fd, SNDCTL_DSP_SETFRAGMENT, &tmp); - if (err < 0) { - perror("SNDCTL_DSP_SETFRAGMENT"); - } -#endif /* select format : favour native format */ err = ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &tmp); diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c index 6e77a5c52a..62cb4f1a4f 100644 --- a/libavdevice/x11grab.c +++ b/libavdevice/x11grab.c @@ -217,21 +217,6 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) } break; case 32: -#if 0 - GetColorInfo (image, &c_info); - if ( c_info.alpha_mask == 0xff000000 && image->green_mask == 0x0000ff00) { - /* byte order is relevant here, not endianness - * endianness is handled by avcodec, but atm no such thing - * as having ABGR, instead of ARGB in a word. Since we - * need this for Solaris/SPARC, but need to do the conversion - * for every frame we do it outside of this loop, cf. below - * this matches both ARGB32 and ABGR32 */ - input_pixfmt = PIX_FMT_ARGB32; - } else { - av_log(s1, AV_LOG_ERROR,"image depth %i not supported ... aborting\n", image->bits_per_pixel); - return AVERROR(EIO); - } -#endif input_pixfmt = PIX_FMT_RGB32; break; default: From 8886d752636ab7b7fbe374061dbe24946ea95d18 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Thu, 7 Jul 2011 01:30:59 +0200 Subject: [PATCH 03/28] libschroedingerdec: Remove write-only variable. libavcodec/libschroedingerdec.c:211:23: warning: variable 'format' set but not used --- libavcodec/libschroedingerdec.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/libschroedingerdec.c b/libavcodec/libschroedingerdec.c index ee29704d92..7e6846d5d1 100644 --- a/libavcodec/libschroedingerdec.c +++ b/libavcodec/libschroedingerdec.c @@ -208,7 +208,6 @@ static int libschroedinger_decode_frame(AVCodecContext *avccontext, FfmpegSchroDecoderParams *p_schro_params = avccontext->priv_data; SchroDecoder *decoder = p_schro_params->decoder; - SchroVideoFormat *format; AVPicture *picture = data; SchroBuffer *enc_buf; SchroFrame* frame; @@ -240,7 +239,6 @@ static int libschroedinger_decode_frame(AVCodecContext *avccontext, go = 1; } else outer = 0; - format = p_schro_params->format; while (go) { /* Parse data and process result. */ From 91fe776913d6525e2a7f582e4d5e21f517a09f0f Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Thu, 30 Jun 2011 01:00:10 +0200 Subject: [PATCH 04/28] flashsv: improve some variable names --- libavcodec/flashsv.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c index 578e713157..70c160ecd4 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -152,14 +152,13 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data, /* loop over all block columns */ for (j = 0; j < v_blocks + (v_part ? 1 : 0); j++) { - int hp = j * s->block_height; // vertical position in frame - int hs = (j < v_blocks) ? s->block_height : v_part; // block size - + int y_pos = j * s->block_height; // vertical position in frame + int cur_blk_height = (j < v_blocks) ? s->block_height : v_part; /* loop over all block rows */ for (i = 0; i < h_blocks + (h_part ? 1 : 0); i++) { - int wp = i * s->block_width; // horizontal position in frame - int ws = (i < h_blocks) ? s->block_width : h_part; // block size + int x_pos = i * s->block_width; // horizontal position in frame + int cur_blk_width = (i < h_blocks) ? s->block_width : h_part; /* get the size of the compressed zlib chunk */ int size = get_bits(&gb, 16); @@ -195,8 +194,9 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data, /* return -1; */ } copy_region(s->tmpblock, s->frame.data[0], - s->image_height - (hp + hs + 1), - wp, hs, ws, s->frame.linesize[0]); + s->image_height - (y_pos + cur_blk_height + 1), + x_pos, cur_blk_height, cur_blk_width, + s->frame.linesize[0]); skip_bits_long(&gb, 8 * size); /* skip the consumed bits */ } } From 4904995652dbbfc7cb37fef9656b9b86f53449f7 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Mon, 27 Jun 2011 00:46:29 +0200 Subject: [PATCH 05/28] avutil: Add missing test programs to Makefile. --- libavutil/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavutil/Makefile b/libavutil/Makefile index c07217b803..cfe7bae222 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -75,7 +75,8 @@ OBJS-$(ARCH_ARM) += arm/cpu.o OBJS-$(ARCH_PPC) += ppc/cpu.o OBJS-$(ARCH_X86) += x86/cpu.o -TESTPROGS = adler32 aes base64 cpu crc des eval lls md5 sha tree +TESTPROGS = adler32 aes avstring base64 cpu crc des eval file lfg lls \ + md5 opt parseutils rational sha tree TESTPROGS-$(HAVE_LZO1X_999_COMPRESS) += lzo DIRS = arm bfin sh4 x86 From 51915cfa47e3fba1778673a0772070eaf2a9b742 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Thu, 30 Jun 2011 00:59:13 +0200 Subject: [PATCH 06/28] flashsv: inline copy_region() into flashsv_decode_frame() --- libavcodec/flashsv.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c index 70c160ecd4..e1033a84cc 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -49,18 +49,6 @@ typedef struct FlashSVContext { } FlashSVContext; -static void copy_region(uint8_t *sptr, uint8_t *dptr, - int dx, int dy, int h, int w, int stride) -{ - int i; - - for (i = dx + h; i > dx; i--) { - memcpy(dptr + i * stride + dy * 3, sptr, w * 3); - sptr += w * 3; - } -} - - static av_cold int flashsv_decode_init(AVCodecContext *avctx) { FlashSVContext *s = avctx->priv_data; @@ -171,6 +159,8 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data, /* skip unchanged blocks, which have size 0 */ if (size) { /* decompress block */ + uint8_t *line = s->tmpblock; + int k; int ret = inflateReset(&s->zstream); if (ret != Z_OK) { av_log(avctx, AV_LOG_ERROR, @@ -193,10 +183,15 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data, "error in decompression of block %dx%d: %d\n", i, j, ret); /* return -1; */ } - copy_region(s->tmpblock, s->frame.data[0], - s->image_height - (y_pos + cur_blk_height + 1), - x_pos, cur_blk_height, cur_blk_width, - s->frame.linesize[0]); + /* Flash Screen Video stores the image upside down, so copy + * lines to destination in reverse order. */ + for (k = 1; k <= cur_blk_height; k++) { + memcpy(s->frame.data[0] + x_pos * 3 + + (s->image_height - y_pos - k) * s->frame.linesize[0], + line, cur_blk_width * 3); + /* advance source pointer to next line */ + line += cur_blk_width * 3; + } skip_bits_long(&gb, 8 * size); /* skip the consumed bits */ } } From ecf86e1a97b8cbb1ae6e0ed12825187c5cc00de0 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Fri, 8 Jul 2011 13:58:15 +0100 Subject: [PATCH 07/28] dnxhd: prettify tables Signed-off-by: Mans Rullgard --- libavcodec/dnxhddata.c | 610 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 574 insertions(+), 36 deletions(-) diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c index 82d083c1e2..642b22fb5d 100644 --- a/libavcodec/dnxhddata.c +++ b/libavcodec/dnxhddata.c @@ -108,7 +108,7 @@ static const uint8_t dnxhd_1242_chroma_weight[] = { 48, 49, 51, 51, 52, 52, 54, 54, 49, 49, 52, 53, 54, 54, 53, 53, 55, 59, 63, 62, 60, 60, 60, 60, - }; +}; static const uint8_t dnxhd_1243_luma_weight[] = { 0, 32, 32, 33, 33, 35, 35, 35, @@ -184,35 +184,144 @@ static const uint8_t dnxhd_1237_dc_bits[12] = { }; static const uint16_t dnxhd_1237_ac_codes[257] = { - 0, 1, 4, 5, 12, 26, 27, 56, 57, 58, 59, 120, 121, 244, 245, 246, 247, 248, 498, 499, 500, 501, 502, 1006, 1007, 1008, 1009, 1010, 1011, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 4073, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 8155, 8156, 8157, 8158, 16318, 16319, 16320, 16321, 16322, 16323, 16324, 16325, 16326, 16327, 16328, 16329, 16330, 16331, 16332, 16333, 32668, 32669, 32670, 32671, 32672, 32673, 32674, 32675, 32676, 32677, 32678, 32679, 32680, 32681, 32682, 32683, 32684, 65370, 65371, 65372, 65373, 65374, 65375, 65376, 65377, 65378, 65379, 65380, 65381, 65382, 65383, 65384, 65385, 65386, 65387, 65388, 65389, 65390, 65391, 65392, 65393, 65394, 65395, 65396, 65397, 65398, 65399, 65400, 65401, 65402, 65403, 65404, 65405, 65406, 65407, 65408, 65409, 65410, 65411, 65412, 65413, 65414, 65415, 65416, 65417, 65418, 65419, 65420, 65421, 65422, 65423, 65424, 65425, 65426, 65427, 65428, 65429, 65430, 65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438, 65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446, 65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454, 65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462, 65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470, 65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478, 65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486, 65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494, 65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502, 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510, 65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518, 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526, 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534, 65535, + 0, 1, 4, 5, 12, 26, 27, 56, + 57, 58, 59, 120, 121, 244, 245, 246, + 247, 248, 498, 499, 500, 501, 502, 1006, + 1007, 1008, 1009, 1010, 1011, 2024, 2025, 2026, + 2027, 2028, 2029, 2030, 2031, 4064, 4065, 4066, + 4067, 4068, 4069, 4070, 4071, 4072, 4073, 8148, + 8149, 8150, 8151, 8152, 8153, 8154, 8155, 8156, + 8157, 8158, 16318, 16319, 16320, 16321, 16322, 16323, + 16324, 16325, 16326, 16327, 16328, 16329, 16330, 16331, + 16332, 16333, 32668, 32669, 32670, 32671, 32672, 32673, + 32674, 32675, 32676, 32677, 32678, 32679, 32680, 32681, + 32682, 32683, 32684, 65370, 65371, 65372, 65373, 65374, + 65375, 65376, 65377, 65378, 65379, 65380, 65381, 65382, + 65383, 65384, 65385, 65386, 65387, 65388, 65389, 65390, + 65391, 65392, 65393, 65394, 65395, 65396, 65397, 65398, + 65399, 65400, 65401, 65402, 65403, 65404, 65405, 65406, + 65407, 65408, 65409, 65410, 65411, 65412, 65413, 65414, + 65415, 65416, 65417, 65418, 65419, 65420, 65421, 65422, + 65423, 65424, 65425, 65426, 65427, 65428, 65429, 65430, + 65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438, + 65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446, + 65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454, + 65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462, + 65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470, + 65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478, + 65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486, + 65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494, + 65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502, + 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510, + 65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518, + 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526, + 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534, + 65535, }; static const uint8_t dnxhd_1237_ac_bits[257] = { - 2, 2, 3, 3, 4, 5, 5, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 2, 2, 3, 3, 4, 5, 5, 6, 6, 6, 6, 7, 7, 8, 8, 8, + 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, + 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, }; static const uint8_t dnxhd_1237_ac_level[257] = { - 1, 1, 2, 0, 3, 4, 2, 5, 6, 7, 3, 8, 9, 10, 11, 12, 4, 5, 13, 14, 15, 16, 6, 17, 18, 19, 20, 21, 7, 22, 23, 24, 25, 26, 27, 8, 9, 28, 29, 30, 31, 32, 33, 34, 10, 11, 12, 35, 36, 37, 38, 39, 40, 41, 13, 14, 15, 16, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 17, 18, 19, 20, 21, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 1, 22, 23, 24, 25, 26, 27, 62, 63, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 1, 1, 2, 0, 3, 4, 2, 5, 6, 7, 3, 8, 9, 10, 11, 12, + 4, 5, 13, 14, 15, 16, 6, 17, 18, 19, 20, 21, 7, 22, 23, 24, + 25, 26, 27, 8, 9, 28, 29, 30, 31, 32, 33, 34, 10, 11, 12, 35, + 36, 37, 38, 39, 40, 41, 13, 14, 15, 16, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 17, 18, 19, 20, 21, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 64, 1, 22, 23, 24, 25, 26, 27, 62, 63, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, }; static const uint8_t dnxhd_1237_ac_run_flag[257] = { - 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1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, 489, 490, 491, 492, 493, 494, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, + 0, 4, 10, 11, 24, 25, 26, 54, + 55, 56, 57, 58, 118, 119, 240, 482, + 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 990, 991, 992, 993, + 994, 995, 996, 997, 998, 999, 1000, 1001, + 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, + 1018, 1019, 1020, 1021, 1022, 1023, }; static const uint8_t dnxhd_1237_run_bits[62] = { - 1, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 1, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 8, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, }; static const uint8_t dnxhd_1237_run[62] = { - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 53, 57, 58, 59, 60, 61, 62, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 53, 57, 58, 59, 60, 61, 62, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56, }; static const uint8_t dnxhd_1238_dc_codes[12] = { @@ -224,35 +333,144 @@ static const uint8_t dnxhd_1238_dc_bits[12] = { }; static const uint16_t dnxhd_1238_ac_codes[257] = { - 0, 1, 4, 10, 11, 24, 25, 26, 54, 55, 56, 57, 116, 117, 118, 119, 240, 241, 242, 243, 244, 245, 492, 493, 494, 495, 496, 497, 498, 499, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2027, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 4065, 4066, 4067, 4068, 4069, 8140, 8141, 8142, 8143, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 8155, 8156, 16314, 16315, 16316, 16317, 16318, 16319, 16320, 16321, 16322, 16323, 16324, 16325, 16326, 16327, 16328, 16329, 16330, 16331, 16332, 16333, 16334, 16335, 16336, 16337, 16338, 32678, 32679, 32680, 32681, 32682, 32683, 32684, 32685, 32686, 32687, 32688, 32689, 32690, 32691, 32692, 32693, 32694, 32695, 32696, 32697, 32698, 32699, 32700, 32701, 32702, 32703, 32704, 32705, 65412, 65413, 65414, 65415, 65416, 65417, 65418, 65419, 65420, 65421, 65422, 65423, 65424, 65425, 65426, 65427, 65428, 65429, 65430, 65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438, 65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446, 65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454, 65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462, 65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470, 65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478, 65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486, 65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494, 65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502, 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510, 65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518, 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526, 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534, 65535, + 0, 1, 4, 10, 11, 24, 25, 26, + 54, 55, 56, 57, 116, 117, 118, 119, + 240, 241, 242, 243, 244, 245, 492, 493, + 494, 495, 496, 497, 498, 499, 1000, 1001, + 1002, 1003, 1004, 1005, 1006, 1007, 1008, 2018, + 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, + 2027, 4056, 4057, 4058, 4059, 4060, 4061, 4062, + 4063, 4064, 4065, 4066, 4067, 4068, 4069, 8140, + 8141, 8142, 8143, 8144, 8145, 8146, 8147, 8148, + 8149, 8150, 8151, 8152, 8153, 8154, 8155, 8156, + 16314, 16315, 16316, 16317, 16318, 16319, 16320, 16321, + 16322, 16323, 16324, 16325, 16326, 16327, 16328, 16329, + 16330, 16331, 16332, 16333, 16334, 16335, 16336, 16337, + 16338, 32678, 32679, 32680, 32681, 32682, 32683, 32684, + 32685, 32686, 32687, 32688, 32689, 32690, 32691, 32692, + 32693, 32694, 32695, 32696, 32697, 32698, 32699, 32700, + 32701, 32702, 32703, 32704, 32705, 65412, 65413, 65414, + 65415, 65416, 65417, 65418, 65419, 65420, 65421, 65422, + 65423, 65424, 65425, 65426, 65427, 65428, 65429, 65430, + 65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438, + 65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446, + 65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454, + 65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462, + 65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470, + 65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478, + 65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486, + 65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494, + 65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502, + 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510, + 65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518, + 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526, + 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534, + 65535, }; static const uint8_t dnxhd_1238_ac_bits[257] = { - 2, 2, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 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, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 2, 2, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, + 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 14, 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, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, }; static const uint8_t dnxhd_1238_ac_level[257] = { - 1, 1, 2, 3, 0, 4, 5, 2, 6, 7, 8, 3, 9, 10, 11, 4, 12, 13, 14, 15, 16, 5, 17, 18, 19, 20, 21, 22, 6, 7, 23, 24, 25, 26, 27, 28, 29, 8, 9, 30, 31, 32, 33, 34, 35, 36, 37, 10, 11, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 12, 13, 14, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 15, 16, 17, 18, 62, 63, 64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 22, 23, 24, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 40, 25, 26, 27, 28, 29, 30, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 1, 1, 2, 3, 0, 4, 5, 2, 6, 7, 8, 3, 9, 10, 11, 4, + 12, 13, 14, 15, 16, 5, 17, 18, 19, 20, 21, 22, 6, 7, 23, 24, + 25, 26, 27, 28, 29, 8, 9, 30, 31, 32, 33, 34, 35, 36, 37, 10, + 11, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 12, 13, 14, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 15, 16, 17, 18, + 62, 63, 64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 19, 20, 21, 22, 23, 24, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 40, 25, + 26, 27, 28, 29, 30, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, }; /* 0 is EOB */ static const uint8_t dnxhd_1238_ac_run_flag[257] = { - 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, }; static const uint16_t dnxhd_1238_run_codes[62] = { - 0, 4, 10, 11, 24, 25, 26, 27, 56, 57, 58, 59, 120, 242, 486, 487, 488, 489, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, + 0, 4, 10, 11, 24, 25, 26, 27, + 56, 57, 58, 59, 120, 242, 486, 487, + 488, 489, 980, 981, 982, 983, 984, 985, + 986, 987, 988, 989, 990, 991, 992, 993, + 994, 995, 996, 997, 998, 999, 1000, 1001, + 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, + 1018, 1019, 1020, 1021, 1022, 1023, }; static const uint8_t dnxhd_1238_run_bits[62] = { - 1, 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 8, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 1, 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 8, 9, 9, + 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, }; static const uint8_t dnxhd_1238_run[62] = { - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20, 21, 17, 18, 19, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 20, 21, 17, 18, 19, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, }; static const uint8_t dnxhd_1241_dc_codes[14] = { @@ -262,81 +480,401 @@ static const uint8_t dnxhd_1241_dc_codes[14] = { static const uint8_t dnxhd_1241_dc_bits[14] = { 4, 6, 4, 4, 4, 3, 3, 3, 3, 3, 4, 5, 7, 7, }; + static const uint16_t dnxhd_1241_ac_codes[257] = { - 0, 1, 4, 10, 11, 24, 25, 26, 54, 55, 56, 57, 116, 117, 118, 119, 240, 241, 242, 243, 244, 245, 492, 493, 494, 495, 496, 497, 498, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 4065, 4066, 4067, 4068, 4069, 8140, 8141, 8142, 8143, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 8155, 8156, 8157, 16316, 16317, 16318, 16319, 16320, 16321, 16322, 16323, 16324, 16325, 16326, 16327, 16328, 16329, 16330, 16331, 16332, 16333, 16334, 16335, 16336, 16337, 32676, 32677, 32678, 32679, 32680, 32681, 32682, 32683, 32684, 32685, 32686, 32687, 32688, 32689, 32690, 32691, 32692, 32693, 32694, 32695, 32696, 32697, 32698, 32699, 32700, 32701, 32702, 32703, 32704, 32705, 32706, 32707, 32708, 65418, 65419, 65420, 65421, 65422, 65423, 65424, 65425, 65426, 65427, 65428, 65429, 65430, 65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438, 65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446, 65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454, 65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462, 65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470, 65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478, 65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486, 65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494, 65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502, 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510, 65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518, 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526, 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534, 65535, + 0, 1, 4, 10, 11, 24, 25, 26, + 54, 55, 56, 57, 116, 117, 118, 119, + 240, 241, 242, 243, 244, 245, 492, 493, + 494, 495, 496, 497, 498, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1007, 2016, + 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, + 2025, 2026, 4054, 4055, 4056, 4057, 4058, 4059, + 4060, 4061, 4062, 4063, 4064, 4065, 4066, 4067, + 4068, 4069, 8140, 8141, 8142, 8143, 8144, 8145, + 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, + 8154, 8155, 8156, 8157, 16316, 16317, 16318, 16319, + 16320, 16321, 16322, 16323, 16324, 16325, 16326, 16327, + 16328, 16329, 16330, 16331, 16332, 16333, 16334, 16335, + 16336, 16337, 32676, 32677, 32678, 32679, 32680, 32681, + 32682, 32683, 32684, 32685, 32686, 32687, 32688, 32689, + 32690, 32691, 32692, 32693, 32694, 32695, 32696, 32697, + 32698, 32699, 32700, 32701, 32702, 32703, 32704, 32705, + 32706, 32707, 32708, 65418, 65419, 65420, 65421, 65422, + 65423, 65424, 65425, 65426, 65427, 65428, 65429, 65430, + 65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438, + 65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446, + 65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454, + 65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462, + 65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470, + 65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478, + 65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486, + 65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494, + 65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502, + 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510, + 65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518, + 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526, + 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534, + 65535, }; static const uint8_t dnxhd_1241_ac_bits[257] = { - 2, 2, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 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, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 2, 2, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, + 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 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, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, }; static const uint8_t dnxhd_1241_ac_level[257] = { - 1, 1, 2, 3, 0, 4, 5, 2, 6, 7, 8, 3, 9, 10, 11, 4, 12, 13, 14, 15, 16, 5, 17, 18, 19, 20, 21, 6, 7, 22, 23, 24, 25, 26, 27, 28, 29, 8, 9, 30, 31, 32, 33, 34, 35, 36, 37, 38, 10, 11, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 12, 13, 14, 15, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 1, 16, 17, 18, 19, 64, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 20, 21, 22, 23, 24, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 25, 26, 27, 28, 29, 30, 31, 32, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 1, 1, 2, 3, 0, 4, 5, 2, 6, 7, 8, 3, 9, 10, 11, 4, + 12, 13, 14, 15, 16, 5, 17, 18, 19, 20, 21, 6, 7, 22, 23, 24, + 25, 26, 27, 28, 29, 8, 9, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 10, 11, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 12, 13, + 14, 15, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 1, + 16, 17, 18, 19, 64, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 20, 21, 22, 23, 24, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 25, 26, 27, 28, 29, 30, 31, 32, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, }; static const uint8_t dnxhd_1241_ac_run_flag[257] = { - 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0,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, 1, 1, 1, 1, + 1, }; static const uint8_t dnxhd_1241_run[62] = { - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 17, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 18, 20, 17, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, }; static const uint8_t dnxhd_1251_dc_codes[12] = { 0, 12, 13, 1, 2, 3, 4, 5, 14, 30, 62, 63, }; + static const uint8_t dnxhd_1251_dc_bits[12] = { 3, 4, 4, 3, 3, 3, 3, 3, 4, 5, 6, 6, }; + static const uint16_t dnxhd_1251_ac_codes[257] = { - 0, 1, 4, 10, 11, 24, 25, 26, 54, 55, 56, 57, 116, 117, 118, 119, 240, 241, 242, 243, 244, 245, 492, 493, 494, 495, 496, 497, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 4052, 4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 4065, 4066, 8134, 8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 8143, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 8155, 8156, 16314, 16315, 16316, 16317, 16318, 16319, 16320, 16321, 16322, 16323, 16324, 16325, 16326, 16327, 16328, 16329, 16330, 16331, 16332, 16333, 16334, 16335, 16336, 16337, 16338, 16339, 32680, 32681, 32682, 32683, 32684, 32685, 32686, 32687, 32688, 32689, 32690, 32691, 32692, 32693, 32694, 32695, 32696, 32697, 32698, 32699, 32700, 32701, 32702, 32703, 32704, 32705, 32706, 32707, 32708, 32709, 32710, 32711, 32712, 32713, 32714, 65430, 65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438, 65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446, 65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454, 65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462, 65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470, 65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478, 65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486, 65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494, 65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502, 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510, 65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518, 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526, 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534, 65535, + 0, 1, 4, 10, 11, 24, 25, 26, + 54, 55, 56, 57, 116, 117, 118, 119, + 240, 241, 242, 243, 244, 245, 492, 493, + 494, 495, 496, 497, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 2012, 2013, + 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, + 2022, 2023, 2024, 2025, 4052, 4053, 4054, 4055, + 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, + 4064, 4065, 4066, 8134, 8135, 8136, 8137, 8138, + 8139, 8140, 8141, 8142, 8143, 8144, 8145, 8146, + 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, + 8155, 8156, 16314, 16315, 16316, 16317, 16318, 16319, + 16320, 16321, 16322, 16323, 16324, 16325, 16326, 16327, + 16328, 16329, 16330, 16331, 16332, 16333, 16334, 16335, + 16336, 16337, 16338, 16339, 32680, 32681, 32682, 32683, + 32684, 32685, 32686, 32687, 32688, 32689, 32690, 32691, + 32692, 32693, 32694, 32695, 32696, 32697, 32698, 32699, + 32700, 32701, 32702, 32703, 32704, 32705, 32706, 32707, + 32708, 32709, 32710, 32711, 32712, 32713, 32714, 65430, + 65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438, + 65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446, + 65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454, + 65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462, + 65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470, + 65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478, + 65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486, + 65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494, + 65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502, + 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510, + 65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518, + 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526, + 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534, + 65535, }; + static const uint8_t dnxhd_1251_ac_bits[257] = { - 2, 2, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 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, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 2, 2, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, + 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 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, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, }; + static const uint8_t dnxhd_1251_ac_level[257] = { - 1, 1, 2, 3, 0, 4, 5, 2, 6, 7, 8, 3, 9, 10, 11, 4, 12, 13, 14, 15, 16, 5, 17, 18, 19, 20, 21, 6, 22, 23, 24, 25, 26, 27, 28, 29, 7, 8, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 9, 10, 11, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 12, 13, 14, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 1, 2, 3, 4, 5, 6, 7, 8, 15, 16, 17, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 18, 19, 20, 21, 22, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 23, 24, 25, 26, 27, 28, 59, 60, 61, 62, 63, 64, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 1, 1, 2, 3, 0, 4, 5, 2, 6, 7, 8, 3, 9, 10, 11, 4, + 12, 13, 14, 15, 16, 5, 17, 18, 19, 20, 21, 6, 22, 23, 24, 25, + 26, 27, 28, 29, 7, 8, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 9, 10, 11, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 12, 13, 14, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 1, + 2, 3, 4, 5, 6, 7, 8, 15, 16, 17, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 18, + 19, 20, 21, 22, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 23, 24, 25, 26, 27, 28, 59, 60, 61, 62, 63, 64, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, }; + static const uint8_t dnxhd_1251_ac_run_flag[257] = { - 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, }; + static const uint16_t dnxhd_1251_run_codes[62] = { - 0, 4, 5, 12, 26, 27, 28, 58, 118, 119, 120, 242, 486, 487, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, + 0, 4, 5, 12, 26, 27, 28, 58, + 118, 119, 120, 242, 486, 487, 976, 977, + 978, 979, 980, 981, 982, 983, 984, 985, + 986, 987, 988, 989, 990, 991, 992, 993, + 994, 995, 996, 997, 998, 999, 1000, 1001, + 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, + 1018, 1019, 1020, 1021, 1022, 1023, }; + static const uint8_t dnxhd_1251_run_bits[62] = { - 1, 3, 3, 4, 5, 5, 5, 6, 7, 7, 7, 8, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 1, 3, 3, 4, 5, 5, 5, 6, 7, 7, 7, 8, 9, 9, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, }; + static const uint8_t dnxhd_1251_run[62] = { - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, }; static const uint8_t dnxhd_1252_dc_codes[12] = { 0, 12, 13, 1, 2, 3, 4, 5, 14, 30, 62, 63, }; + static const uint8_t dnxhd_1252_dc_bits[12] = { 3, 4, 4, 3, 3, 3, 3, 3, 4, 5, 6, 6, }; + static const uint16_t dnxhd_1252_ac_codes[257] = { - 0, 1, 4, 10, 11, 12, 26, 27, 56, 57, 58, 118, 119, 120, 242, 243, 244, 245, 246, 247, 496, 497, 498, 499, 500, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2027, 2028, 2029, 4060, 4061, 4062, 4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 8155, 8156, 8157, 8158, 16318, 16319, 16320, 16321, 16322, 16323, 16324, 16325, 16326, 16327, 16328, 16329, 16330, 16331, 16332, 16333, 16334, 16335, 32672, 32673, 32674, 32675, 32676, 32677, 32678, 32679, 32680, 32681, 32682, 32683, 32684, 32685, 32686, 32687, 32688, 32689, 32690, 32691, 32692, 32693, 32694, 65390, 65391, 65392, 65393, 65394, 65395, 65396, 65397, 65398, 65399, 65400, 65401, 65402, 65403, 65404, 65405, 65406, 65407, 65408, 65409, 65410, 65411, 65412, 65413, 65414, 65415, 65416, 65417, 65418, 65419, 65420, 65421, 65422, 65423, 65424, 65425, 65426, 65427, 65428, 65429, 65430, 65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438, 65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446, 65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454, 65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462, 65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470, 65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478, 65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486, 65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494, 65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502, 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510, 65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518, 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526, 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534, 65535, + 0, 1, 4, 10, 11, 12, 26, 27, + 56, 57, 58, 118, 119, 120, 242, 243, + 244, 245, 246, 247, 496, 497, 498, 499, + 500, 1002, 1003, 1004, 1005, 1006, 1007, 1008, + 1009, 2020, 2021, 2022, 2023, 2024, 2025, 2026, + 2027, 2028, 2029, 4060, 4061, 4062, 4063, 4064, + 4065, 4066, 4067, 4068, 4069, 4070, 4071, 8144, + 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, + 8153, 8154, 8155, 8156, 8157, 8158, 16318, 16319, + 16320, 16321, 16322, 16323, 16324, 16325, 16326, 16327, + 16328, 16329, 16330, 16331, 16332, 16333, 16334, 16335, + 32672, 32673, 32674, 32675, 32676, 32677, 32678, 32679, + 32680, 32681, 32682, 32683, 32684, 32685, 32686, 32687, + 32688, 32689, 32690, 32691, 32692, 32693, 32694, 65390, + 65391, 65392, 65393, 65394, 65395, 65396, 65397, 65398, + 65399, 65400, 65401, 65402, 65403, 65404, 65405, 65406, + 65407, 65408, 65409, 65410, 65411, 65412, 65413, 65414, + 65415, 65416, 65417, 65418, 65419, 65420, 65421, 65422, + 65423, 65424, 65425, 65426, 65427, 65428, 65429, 65430, + 65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438, + 65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446, + 65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454, + 65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462, + 65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470, + 65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478, + 65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486, + 65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494, + 65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502, + 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510, + 65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518, + 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526, + 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534, + 65535, }; + static const uint8_t dnxhd_1252_ac_bits[257] = { - 2, 2, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 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, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 2, 2, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, + 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, + 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 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, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, }; + static const uint8_t dnxhd_1252_ac_level[257] = { - 1, 1, 2, 3, 2, 0, 4, 5, 6, 7, 3, 8, 9, 10, 11, 12, 13, 14, 4, 5, 15, 16, 17, 18, 6, 19, 20, 21, 22, 23, 24, 7, 8, 25, 26, 27, 28, 29, 30, 31, 32, 9, 10, 33, 34, 35, 36, 37, 38, 39, 40, 41, 11, 12, 13, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 14, 15, 16, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 1, 2, 3, 17, 18, 19, 20, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 1, 1, 2, 3, 2, 0, 4, 5, 6, 7, 3, 8, 9, 10, 11, 12, + 13, 14, 4, 5, 15, 16, 17, 18, 6, 19, 20, 21, 22, 23, 24, 7, + 8, 25, 26, 27, 28, 29, 30, 31, 32, 9, 10, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 11, 12, 13, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 14, 15, 16, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 1, 2, 3, 17, 18, 19, 20, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50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 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, }; const CIDEntry ff_dnxhd_cid_table[] = { From b369f327d5e6b01a4cae9e2726df7c73b2893eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 8 Jul 2011 11:00:01 +0300 Subject: [PATCH 08/28] docs: Mention the upstream bugzilla url about the dlltool vs MSVC issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- doc/general.texi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/general.texi b/doc/general.texi index 93f563e1bf..fbb36c9f6e 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -989,6 +989,8 @@ the linker optimization option to be set to "References: Keep Unreferenced Data (/OPT:NOREF)", otherwise the resulting binaries will fail during runtime. This isn't required when using import libraries generated by lib.exe. +This issue is reported upstream at +@url{http://sourceware.org/bugzilla/show_bug.cgi?id=12633}. @subsection Cross compilation for Windows with Linux From e4e3cdc6363b45213d79fd1467ff55dab3cd2bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 8 Jul 2011 11:14:14 +0300 Subject: [PATCH 09/28] docs: Remove old docs that mention setting up a build environment with lib.exe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The build system doesn't use lib.exe any longer, and therefore this can be simplified. Signed-off-by: Martin Storsjö --- doc/general.texi | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/doc/general.texi b/doc/general.texi index fbb36c9f6e..95af68e9a9 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -923,30 +923,7 @@ Libav, so you must add this line before @code{#include}ing libav*: This is how to create DLL and LIB files that are compatible with MSVC++: -@enumerate - -@item Add a call to @file{vcvars32.bat} (which sets up the environment -variables for the Visual C++ tools) as the first line of @file{msys.bat}. -The standard location for @file{vcvars32.bat} is -@file{C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat}, -and the standard location for @file{msys.bat} is @file{C:\msys\1.0\msys.bat}. -If this corresponds to your setup, add the following line as the first line -of @file{msys.bat}: - -@example -call "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat" -@end example - -Alternatively, you may start the @file{Visual Studio 2005 Command Prompt}, -and run @file{c:\msys\1.0\msys.bat} from there. - -@item Within the MSYS shell, run @code{lib.exe}. If you get a help message -from @file{Microsoft (R) Library Manager}, this means your environment -variables are set up correctly, the @file{Microsoft (R) Library Manager} -is on the path and will be used by Libav to create -MSVC++-compatible import libraries. - -@item Build Libav with +Within the MSYS shell, build Libav with @example ./configure --enable-shared @@ -957,8 +934,6 @@ make install Your install path (@file{/usr/local/} by default) should now have the necessary DLL and LIB files under the @file{bin} directory. -@end enumerate - To use those files with MSVC++, do the same as you would do with the static libraries, as described above. But in Step 4, you should only need to add the directory where the LIB files are installed From b8272cc2cff052c953a0727e9ffc6d55a8d3037f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 8 Jul 2011 11:15:00 +0300 Subject: [PATCH 10/28] docs: Mention that libraries for MSVC can be built with a cross compiler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- doc/general.texi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/general.texi b/doc/general.texi index 95af68e9a9..c950fcb131 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -934,6 +934,9 @@ make install Your install path (@file{/usr/local/} by default) should now have the necessary DLL and LIB files under the @file{bin} directory. +Alternatively, build the libraries with a cross compiler, according to +the instructions below in @ref{Cross compilation for Windows with Linux}. + To use those files with MSVC++, do the same as you would do with the static libraries, as described above. But in Step 4, you should only need to add the directory where the LIB files are installed @@ -967,6 +970,7 @@ required when using import libraries generated by lib.exe. This issue is reported upstream at @url{http://sourceware.org/bugzilla/show_bug.cgi?id=12633}. +@anchor{Cross compilation for Windows with Linux} @subsection Cross compilation for Windows with Linux You must use the MinGW cross compilation tools available at From 37e6e6d3130ad0f93d3f5d040e41998d56bbf012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 8 Jul 2011 11:16:32 +0300 Subject: [PATCH 11/28] docs: Explain how to regenerate import libraries with MSVC tools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- doc/general.texi | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/doc/general.texi b/doc/general.texi index c950fcb131..814dc5f619 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -970,6 +970,34 @@ required when using import libraries generated by lib.exe. This issue is reported upstream at @url{http://sourceware.org/bugzilla/show_bug.cgi?id=12633}. +To create import libraries that work with the @code{/OPT:REF} option +(which is enabled by default in Release mode), follow these steps: + +@enumerate + +@item Open @file{Visual Studio 2005 Command Prompt}. + +Alternatively, in a normal command line prompt, call @file{vcvars32.bat} +which sets up the environment variables for the Visual C++ tools +(the standard location for this file is +@file{C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat}). + +@item Enter the @file{bin} directory where the created LIB and DLL files +are stored. + +@item Generate new import libraries with @file{lib.exe}: + +@example +lib /machine:i386 /def:..\lib\avcodec-53.def /out:avcodec.lib +lib /machine:i386 /def:..\lib\avdevice-53.def /out:avdevice.lib +lib /machine:i386 /def:..\lib\avfilter-2.def /out:avfilter.lib +lib /machine:i386 /def:..\lib\avformat-53.def /out:avformat.lib +lib /machine:i386 /def:..\lib\avutil-51.def /out:avutil.lib +lib /machine:i386 /def:..\lib\swscale-2.def /out:swscale.lib +@end example + +@end enumerate + @anchor{Cross compilation for Windows with Linux} @subsection Cross compilation for Windows with Linux From a0db0b302c98b7a1fe821771371685a744c23502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 8 Jul 2011 11:18:13 +0300 Subject: [PATCH 12/28] docs: Remove a remark that isn't relevant any longer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now the bin directory only contains those DLLs that are actually used. Signed-off-by: Martin Storsjö --- doc/general.texi | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/doc/general.texi b/doc/general.texi index 814dc5f619..3459277dad 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -948,10 +948,7 @@ libraries (@file{libxxx.a} files) you should add the MSVC import libraries libraries (@file{libxxx.dll.a} files), as these will give you undefined reference errors. There should be no need for @file{libmingwex.a}, @file{libgcc.a}, and @file{wsock32.lib}, nor any other external library -statically linked into the DLLs. The @file{bin} directory contains a bunch -of DLL files, but the ones that are actually used to run your application -are the ones with a major version number in their filenames -(i.e. @file{avcodec-51.dll}). +statically linked into the DLLs. Libav headers do not declare global data for Windows DLLs through the usual dllexport/dllimport interface. Such data will be exported properly while From a3a94e1498685480800c22fc3ffa20d42ccfd527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 8 Jul 2011 13:37:54 +0300 Subject: [PATCH 13/28] docs: Use proper markup for a literal command line option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- doc/general.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/general.texi b/doc/general.texi index 3459277dad..c97a7575c8 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -961,7 +961,7 @@ extern __declspec(dllimport) const AVPixFmtDescriptor av_pix_fmt_descriptors[]; Note that using import libraries created by dlltool requires the linker optimization option to be set to -"References: Keep Unreferenced Data (/OPT:NOREF)", otherwise +"References: Keep Unreferenced Data (@code{/OPT:NOREF})", otherwise the resulting binaries will fail during runtime. This isn't required when using import libraries generated by lib.exe. This issue is reported upstream at From fdaf1d0640af0da11005a483de8533803a6ae42d Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Fri, 8 Jul 2011 12:52:12 +0100 Subject: [PATCH 14/28] lls: whitespace cosmetics Signed-off-by: Mans Rullgard --- libavutil/lls.c | 127 +++++++++++++++++++++++++++--------------------- 1 file changed, 71 insertions(+), 56 deletions(-) diff --git a/libavutil/lls.c b/libavutil/lls.c index 679738530d..eba7375854 100644 --- a/libavutil/lls.c +++ b/libavutil/lls.c @@ -30,76 +30,88 @@ #include "lls.h" -void av_init_lls(LLSModel *m, int indep_count){ +void av_init_lls(LLSModel *m, int indep_count) +{ memset(m, 0, sizeof(LLSModel)); - - m->indep_count= indep_count; + m->indep_count = indep_count; } -void av_update_lls(LLSModel *m, double *var, double decay){ - int i,j; +void av_update_lls(LLSModel *m, double *var, double decay) +{ + int i, j; - for(i=0; i<=m->indep_count; i++){ - for(j=i; j<=m->indep_count; j++){ + for (i = 0; i <= m->indep_count; i++) { + for (j = i; j <= m->indep_count; j++) { m->covariance[i][j] *= decay; - m->covariance[i][j] += var[i]*var[j]; + m->covariance[i][j] += var[i] * var[j]; } } } -void av_solve_lls(LLSModel *m, double threshold, int min_order){ - int i,j,k; - double (*factor)[MAX_VARS+1]= (void*)&m->covariance[1][0]; - double (*covar )[MAX_VARS+1]= (void*)&m->covariance[1][1]; - double *covar_y = m->covariance[0]; - int count= m->indep_count; +void av_solve_lls(LLSModel *m, double threshold, int min_order) +{ + int i, j, k; + double (*factor)[MAX_VARS + 1] = (void *) &m->covariance[1][0]; + double (*covar) [MAX_VARS + 1] = (void *) &m->covariance[1][1]; + double *covar_y = m->covariance[0]; + int count = m->indep_count; - for(i=0; i=0; k--) - sum -= factor[i][k]*factor[j][k]; + for (k = i - 1; k >= 0; k--) + sum -= factor[i][k] * factor[j][k]; - if(i==j){ - if(sum < threshold) - sum= 1.0; - factor[i][i]= sqrt(sum); - }else - factor[j][i]= sum / factor[i][i]; + if (i == j) { + if (sum < threshold) + sum = 1.0; + factor[i][i] = sqrt(sum); + } else { + factor[j][i] = sum / factor[i][i]; + } } } - for(i=0; i=0; k--) - sum -= factor[i][k]*m->coeff[0][k]; - m->coeff[0][i]= sum / factor[i][i]; + + for (i = 0; i < count; i++) { + double sum = covar_y[i + 1]; + + for (k = i - 1; k >= 0; k--) + sum -= factor[i][k] * m->coeff[0][k]; + + m->coeff[0][i] = sum / factor[i][i]; } - for(j=count-1; j>=min_order; j--){ - for(i=j; i>=0; i--){ - double sum= m->coeff[0][i]; - for(k=i+1; k<=j; k++) - sum -= factor[k][i]*m->coeff[j][k]; - m->coeff[j][i]= sum / factor[i][i]; + for (j = count - 1; j >= min_order; j--) { + for (i = j; i >= 0; i--) { + double sum = m->coeff[0][i]; + + for (k = i + 1; k <= j; k++) + sum -= factor[k][i] * m->coeff[j][k]; + + m->coeff[j][i] = sum / factor[i][i]; } - m->variance[j]= covar_y[0]; - for(i=0; i<=j; i++){ - double sum= m->coeff[j][i]*covar[i][i] - 2*covar_y[i+1]; - for(k=0; kcoeff[j][k]*covar[k][i]; - m->variance[j] += m->coeff[j][i]*sum; + m->variance[j] = covar_y[0]; + + for (i = 0; i <= j; i++) { + double sum = m->coeff[j][i] * covar[i][i] - 2 * covar_y[i + 1]; + + for (k = 0; k < i; k++) + sum += 2 * m->coeff[j][k] * covar[k][i]; + + m->variance[j] += m->coeff[j][i] * sum; } } } -double av_evaluate_lls(LLSModel *m, double *param, int order){ +double av_evaluate_lls(LLSModel *m, double *param, int order) +{ int i; - double out= 0; + double out = 0; - for(i=0; i<=order; i++) - out+= param[i]*m->coeff[order][i]; + for (i = 0; i <= order; i++) + out += param[i] * m->coeff[order][i]; return out; } @@ -109,26 +121,29 @@ double av_evaluate_lls(LLSModel *m, double *param, int order){ #include #include -int main(void){ +int main(void) +{ LLSModel m; int i, order; av_init_lls(&m, 3); - for(i=0; i<100; i++){ + for (i = 0; i < 100; i++) { double var[4]; double eval; - var[0] = (rand() / (double)RAND_MAX - 0.5)*2; - var[1] = var[0] + rand() / (double)RAND_MAX - 0.5; - var[2] = var[1] + rand() / (double)RAND_MAX - 0.5; - var[3] = var[2] + rand() / (double)RAND_MAX - 0.5; + + var[0] = (rand() / (double) RAND_MAX - 0.5) * 2; + var[1] = var[0] + rand() / (double) RAND_MAX - 0.5; + var[2] = var[1] + rand() / (double) RAND_MAX - 0.5; + var[3] = var[2] + rand() / (double) RAND_MAX - 0.5; av_update_lls(&m, var, 0.99); av_solve_lls(&m, 0.001, 0); - for(order=0; order<3; order++){ - eval= av_evaluate_lls(&m, var+1, order); + for (order = 0; order < 3; order++) { + eval = av_evaluate_lls(&m, var + 1, order); printf("real:%9f order:%d pred:%9f var:%f coeffs:%f %9f %9f\n", - var[0], order, eval, sqrt(m.variance[order] / (i+1)), - m.coeff[order][0], m.coeff[order][1], m.coeff[order][2]); + var[0], order, eval, sqrt(m.variance[order] / (i + 1)), + m.coeff[order][0], m.coeff[order][1], + m.coeff[order][2]); } } return 0; From 8c28e01d3153edefec4469f379dd99722a4609c2 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 8 Jul 2011 08:27:53 +0200 Subject: [PATCH 15/28] dict: extend documentation. --- libavutil/dict.h | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/libavutil/dict.h b/libavutil/dict.h index 397ce3852f..b0061c8475 100644 --- a/libavutil/dict.h +++ b/libavutil/dict.h @@ -25,10 +25,42 @@ #ifndef AVUTIL_DICT_H #define AVUTIL_DICT_H +/** + * @defgroup dict_api Public Dictionary API + * @{ + * Dictionaries are used for storing key:value pairs. To create + * an AVDictionary, simply pass an address of a NULL pointer to + * av_dict_set(). NULL can be used as an empty dictionary wherever + * a pointer to an AVDictionary is required. + * Use av_dict_get() to retrieve an entry or iterate over all + * entries and finally av_dict_free() to free the dictionary + * and all its contents. + * + * @code + * AVDictionary *d = NULL; // "create" an empty dictionary + * av_dict_set(&d, "foo", "bar", 0); // add an entry + * + * char *k = av_strdup("key"); // if your strings are already allocated, + * char *v = av_strdup("value"); // you can avoid copying them like this + * av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL); + * + * AVDictionaryEntry *t = NULL; + * while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) { + * <....> // iterate over all entries in d + * } + * + * av_dict_free(&d); + * @endcode + * + * @} + */ + #define AV_DICT_MATCH_CASE 1 #define AV_DICT_IGNORE_SUFFIX 2 -#define AV_DICT_DONT_STRDUP_KEY 4 -#define AV_DICT_DONT_STRDUP_VAL 8 +#define AV_DICT_DONT_STRDUP_KEY 4 /**< Take ownership of a key that's been + allocated with av_malloc() and children. */ +#define AV_DICT_DONT_STRDUP_VAL 8 /**< Take ownership of a value that's been + allocated with av_malloc() and chilren. */ #define AV_DICT_DONT_OVERWRITE 16 ///< Don't overwrite existing entries. #define AV_DICT_APPEND 32 /**< If the entry already exists, append to it. Note that no delimiter is added, the strings are simply concatenated. */ @@ -74,7 +106,8 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags void av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags); /** - * Free all the memory allocated for an AVDictionary struct. + * Free all the memory allocated for an AVDictionary struct + * and all keys and values. */ void av_dict_free(AVDictionary **m); From ce558c8f590610fc68596ef0b4ac2a9d299fbcb2 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 20 Jun 2011 12:42:36 +0200 Subject: [PATCH 16/28] x11grab: replace undocumented nomouse hackery with a private option. --- libavdevice/x11grab.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c index 62cb4f1a4f..80507abb05 100644 --- a/libavdevice/x11grab.c +++ b/libavdevice/x11grab.c @@ -70,7 +70,7 @@ struct x11_grab XImage *image; /**< X11 image holding the grab */ int use_shm; /**< !0 when using XShm extension */ XShmSegmentInfo shminfo; /**< When using XShm, keeps track of XShm infos */ - int nomouse; + int draw_mouse; /**< Set by a private option. */ char *framerate; /**< Set by a private option. */ }; @@ -104,7 +104,7 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) offset = strchr(param, '+'); if (offset) { sscanf(offset, "%d,%d", &x_off, &y_off); - x11grab->nomouse= strstr(offset, "nomouse"); + x11grab->draw_mouse = !strstr(offset, "nomouse"); *offset= 0; } @@ -410,7 +410,7 @@ x11grab_read_packet(AVFormatContext *s1, AVPacket *pkt) } } - if(!s->nomouse){ + if (s->draw_mouse) { paint_mouse_pointer(image, s); } @@ -451,6 +451,7 @@ x11grab_read_close(AVFormatContext *s1) static const AVOption options[] = { { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = "vga"}, 0, 0, DEC }, { "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "ntsc"}, 0, 0, DEC }, + { "draw_mouse", "Draw the mouse pointer.", OFFSET(draw_mouse), FF_OPT_TYPE_INT, { 1 }, 0, 1, DEC }, { NULL }, }; From a726d7fd4e0b112b276678ea9da9c9b3097e8b8f Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 6 Jul 2011 19:56:58 +0200 Subject: [PATCH 17/28] AVOptions: in av_opt_find() don't return named constants unless unit is specified. That is, unless the caller explicitly asks for them. Prevents conflict between e.g. the 'loop' option in img2 demuxer and 'loop' flag in AVCodecContext. --- libavutil/opt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavutil/opt.c b/libavutil/opt.c index 65e02135d5..9c601a2cbb 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -573,8 +573,9 @@ const AVOption *av_opt_find(void *obj, const char *name, const char *unit, return o; while (o = av_next_option(obj, o)) { - if (!strcmp(o->name, name) && (!unit || (o->unit && !strcmp(o->unit, unit))) && - (o->flags & opt_flags) == opt_flags) + if (!strcmp(o->name, name) && (o->flags & opt_flags) == opt_flags && + ((!unit && o->type != FF_OPT_TYPE_CONST) || + (unit && o->unit && !strcmp(o->unit, unit)))) return o; } return NULL; From 6002fdef5eba7ecc623092583d5bb051c8a27318 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 18 Jun 2011 09:28:49 +0200 Subject: [PATCH 18/28] img2: add loop private option. Deprecate AVFormatContext.loop_input. --- libavformat/avformat.h | 7 ++++++- libavformat/img2.c | 9 ++++++++- libavformat/version.h | 3 +++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 9011099a21..1be9f39646 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -742,7 +742,12 @@ typedef struct AVFormatContext { #endif #define AVFMT_FLAG_CUSTOM_IO 0x0080 ///< The caller has supplied a custom AVIOContext, don't avio_close() it. - int loop_input; +#if FF_API_LOOP_INPUT + /** + * @deprecated, use the 'loop' img2 demuxer private option. + */ + attribute_deprecated int loop_input; +#endif /** * decoding: size of data to probe; encoding: unused. diff --git a/libavformat/img2.c b/libavformat/img2.c index 4eef62371d..a4f39e7256 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -42,6 +42,7 @@ typedef struct { char *pixel_format; /**< Set by a private option. */ char *video_size; /**< Set by a private option. */ char *framerate; /**< Set by a private option. */ + int loop; } VideoData; typedef struct { @@ -243,6 +244,11 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap) framerate = (AVRational){ap->time_base.den, ap->time_base.num}; #endif +#if FF_API_LOOP_INPUT + if (s1->loop_input) + s->loop = s1->loop_input; +#endif + av_strlcpy(s->path, s1->filename, sizeof(s->path)); s->img_number = 0; s->img_count = 0; @@ -300,7 +306,7 @@ static int read_packet(AVFormatContext *s1, AVPacket *pkt) if (!s->is_pipe) { /* loop over input */ - if (s1->loop_input && s->img_number > s->img_last) { + if (s->loop && s->img_number > s->img_last) { s->img_number = s->img_first; } if (s->img_number > s->img_last) @@ -458,6 +464,7 @@ static const AVOption options[] = { { "pixel_format", "", OFFSET(pixel_format), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, { "video_size", "", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, { "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC }, + { "loop", "", OFFSET(loop), FF_OPT_TYPE_INT, {.dbl = 0}, 0, 1, DEC }, { NULL }, }; diff --git a/libavformat/version.h b/libavformat/version.h index 0cf383fcc1..957ce529dc 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -77,5 +77,8 @@ #ifndef FF_API_AVSTREAM_QUALITY #define FF_API_AVSTREAM_QUALITY (LIBAVFORMAT_VERSION_MAJOR < 54) #endif +#ifndef FF_API_LOOP_INPUT +#define FF_API_LOOP_INPUT (LIBAVFORMAT_VERSION_MAJOR < 54) +#endif #endif /* AVFORMAT_VERSION_H */ From d31e3f7ccc5d1e198b3a582f4413ce7342928d8c Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 18 Jun 2011 09:47:46 +0200 Subject: [PATCH 19/28] gif: add loop private option. Deprecate AVFormatContext.loop_output. --- libavformat/avformat.h | 6 +++++- libavformat/gif.c | 29 ++++++++++++++++++++++++++--- libavformat/version.h | 3 +++ 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 1be9f39646..2cdf11be12 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -723,12 +723,16 @@ typedef struct AVFormatContext { int preload; int max_delay; +#if FF_API_LOOP_OUTPUT #define AVFMT_NOOUTPUTLOOP -1 #define AVFMT_INFINITEOUTPUTLOOP 0 /** * number of times to loop output in formats that support it + * + * @deprecated use the 'loop' private option in the gif muxer. */ - int loop_output; + attribute_deprecated int loop_output; +#endif int flags; #define AVFMT_FLAG_GENPTS 0x0001 ///< Generate missing pts even if it requires parsing future frames. diff --git a/libavformat/gif.c b/libavformat/gif.c index 55deb4d207..cf8785736b 100644 --- a/libavformat/gif.c +++ b/libavformat/gif.c @@ -40,6 +40,8 @@ */ #include "avformat.h" +#include "libavutil/log.h" +#include "libavutil/opt.h" /* The GIF format uses reversed order for bitstreams... */ /* at least they don't use PDP_ENDIAN :) */ @@ -245,8 +247,10 @@ static int gif_image_write_image(AVIOContext *pb, } typedef struct { + AVClass *class; /** Class for private options. */ int64_t time, file_time; uint8_t buffer[100]; /* data chunks */ + int loop; } GIFContext; static int gif_write_header(AVFormatContext *s) @@ -254,7 +258,7 @@ static int gif_write_header(AVFormatContext *s) GIFContext *gif = s->priv_data; AVIOContext *pb = s->pb; AVCodecContext *enc, *video_enc; - int i, width, height, loop_count /*, rate*/; + int i, width, height /*, rate*/; /* XXX: do we reject audio streams or just ignore them ? if(s->nb_streams > 1) @@ -276,7 +280,6 @@ static int gif_write_header(AVFormatContext *s) } else { width = video_enc->width; height = video_enc->height; - loop_count = s->loop_output; // rate = video_enc->time_base.den; } @@ -285,7 +288,12 @@ static int gif_write_header(AVFormatContext *s) return AVERROR(EIO); } - gif_image_write_header(pb, width, height, loop_count, NULL); +#if FF_API_LOOP_OUTPUT + if (s->loop_output) + gif->loop = s->loop_output; +#endif + + gif_image_write_header(pb, width, height, gif->loop, NULL); avio_flush(s->pb); return 0; @@ -340,6 +348,20 @@ static int gif_write_trailer(AVFormatContext *s) return 0; } +#define OFFSET(x) offsetof(GIFContext, x) +#define ENC AV_OPT_FLAG_ENCODING_PARAM +static const AVOption options[] = { + { "loop", "Number of times to loop the output.", OFFSET(loop), FF_OPT_TYPE_INT, {0}, 0, 65535, ENC }, + { NULL }, +}; + +static const AVClass gif_muxer_class = { + .class_name = "GIF muxer", + .item_name = av_default_item_name, + .version = LIBAVUTIL_VERSION_INT, + .option = options, +}; + AVOutputFormat ff_gif_muxer = { "gif", NULL_IF_CONFIG_SMALL("GIF Animation"), @@ -351,4 +373,5 @@ AVOutputFormat ff_gif_muxer = { gif_write_header, gif_write_packet, gif_write_trailer, + .priv_class = &gif_muxer_class, }; diff --git a/libavformat/version.h b/libavformat/version.h index 957ce529dc..18331fc7d1 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -80,5 +80,8 @@ #ifndef FF_API_LOOP_INPUT #define FF_API_LOOP_INPUT (LIBAVFORMAT_VERSION_MAJOR < 54) #endif +#ifndef FF_API_LOOP_OUTPUT +#define FF_API_LOOP_OUTPUT (LIBAVFORMAT_VERSION_MAJOR < 54) +#endif #endif /* AVFORMAT_VERSION_H */ From f5302e5dcf6572e9424d51d152bffc570cd75ce6 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 18 Jun 2011 09:49:24 +0200 Subject: [PATCH 20/28] ffmpeg: deprecate loop_input and loop_output options They were replaced by (de)muxer private options. --- doc/ffmpeg.texi | 2 ++ ffmpeg.c | 14 ++++++++++---- tests/ref/lavf/gif | 4 ++-- tests/ref/seek/lavf_gif | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi index cabf395582..6e7fd1390d 100644 --- a/doc/ffmpeg.texi +++ b/doc/ffmpeg.texi @@ -731,9 +731,11 @@ Read input at native frame rate. Mainly used to simulate a grab device. @item -loop_input Loop over the input stream. Currently it works only for image streams. This option is used for automatic FFserver testing. +This option is deprecated, use -loop. @item -loop_output @var{number_of_times} Repeatedly loop output for formats that support looping such as animated GIF (0 will loop the output infinitely). +This option is deprecated, use -loop. @item -threads @var{count} Thread count. @item -vsync @var{parameter} diff --git a/ffmpeg.c b/ffmpeg.c index 29d9d17619..d55b0d854a 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -3247,7 +3247,10 @@ static int opt_input_file(const char *opt, const char *filename) opt_programid=0; } - ic->loop_input = loop_input; + if (loop_input) { + av_log(NULL, AV_LOG_WARNING, "-loop_input is deprecated, use -loop 1\n"); + ic->loop_input = loop_input; + } /* Set AVCodecContext options so they will be seen by av_find_stream_info() */ for (i = 0; i < ic->nb_streams; i++) { @@ -3897,7 +3900,10 @@ static void opt_output_file(const char *filename) oc->preload= (int)(mux_preload*AV_TIME_BASE); oc->max_delay= (int)(mux_max_delay*AV_TIME_BASE); - oc->loop_output = loop_output; + if (loop_output >= 0) { + av_log(NULL, AV_LOG_WARNING, "-loop_output is deprecated, use -loop\n"); + oc->loop_output = loop_output; + } oc->flags |= AVFMT_FLAG_NONBLOCK; frame_rate = (AVRational){0, 0}; @@ -4309,8 +4315,8 @@ static const OptionDef options[] = { { "hex", OPT_BOOL | OPT_EXPERT, {(void*)&do_hex_dump}, "when dumping packets, also dump the payload" }, { "re", OPT_BOOL | OPT_EXPERT, {(void*)&rate_emu}, "read input at native frame rate", "" }, - { "loop_input", OPT_BOOL | OPT_EXPERT, {(void*)&loop_input}, "loop (current only works with images)" }, - { "loop_output", HAS_ARG | OPT_INT | OPT_EXPERT, {(void*)&loop_output}, "number of times to loop output in formats that support looping (0 loops forever)", "" }, + { "loop_input", OPT_BOOL | OPT_EXPERT, {(void*)&loop_input}, "deprecated, use -loop" }, + { "loop_output", HAS_ARG | OPT_INT | OPT_EXPERT, {(void*)&loop_output}, "deprecated, use -loop", "" }, { "v", HAS_ARG, {(void*)opt_verbose}, "set ffmpeg verbosity level", "number" }, { "target", HAS_ARG, {(void*)opt_target}, "specify target file type (\"vcd\", \"svcd\", \"dvd\", \"dv\", \"dv50\", \"pal-vcd\", \"ntsc-svcd\", ...)", "type" }, { "threads", HAS_ARG | OPT_EXPERT, {(void*)opt_thread_count}, "thread count", "count" }, diff --git a/tests/ref/lavf/gif b/tests/ref/lavf/gif index fa55d0e66e..4a4ebfb9dc 100644 --- a/tests/ref/lavf/gif +++ b/tests/ref/lavf/gif @@ -1,3 +1,3 @@ -98968ceb210ab260a6a7af36767b94d3 *./tests/data/lavf/lavf.gif -2906382 ./tests/data/lavf/lavf.gif +e6089fd4ef3b9df44090ab3650bdd810 *./tests/data/lavf/lavf.gif +2906401 ./tests/data/lavf/lavf.gif ./tests/data/lavf/lavf.gif CRC=0xe5605ff6 diff --git a/tests/ref/seek/lavf_gif b/tests/ref/seek/lavf_gif index 5da803da42..883f18761e 100644 --- a/tests/ref/seek/lavf_gif +++ b/tests/ref/seek/lavf_gif @@ -1,4 +1,4 @@ -ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:2906382 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:2906401 ret:-EINVAL st:-1 flags:0 ts:-1.000000 ret:-EINVAL st:-1 flags:1 ts: 1.894167 ret:-EINVAL st: 0 flags:0 ts: 0.800000 From 17c8cc550d823e796c7153e43374ece2f4b31cb9 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 23 Jun 2011 19:14:08 +0200 Subject: [PATCH 21/28] ffmpeg: drop AV prefixes from struct names. Those are reserved for the libs. --- ffmpeg.c | 108 +++++++++++++++++++++++++++---------------------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index d55b0d854a..5d6fa1ea02 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -78,26 +78,26 @@ const char program_name[] = "ffmpeg"; const int program_birth_year = 2000; /* select an input stream for an output stream */ -typedef struct AVStreamMap { +typedef struct StreamMap { int file_index; int stream_index; int sync_file_index; int sync_stream_index; -} AVStreamMap; +} StreamMap; /** * select an input file for an output file */ -typedef struct AVMetaDataMap { +typedef struct MetadataMap { int file; //< file index char type; //< type of metadata to copy -- (g)lobal, (s)tream, (c)hapter or (p)rogram int index; //< stream/chapter/program number -} AVMetaDataMap; +} MetadataMap; -typedef struct AVChapterMap { +typedef struct ChapterMap { int in_file; int out_file; -} AVChapterMap; +} ChapterMap; static const OptionDef options[]; @@ -117,17 +117,17 @@ static AVFormatContext *output_files[MAX_FILES]; static AVDictionary *output_opts[MAX_FILES]; static int nb_output_files = 0; -static AVStreamMap *stream_maps = NULL; +static StreamMap *stream_maps = NULL; static int nb_stream_maps; /* first item specifies output metadata, second is input */ -static AVMetaDataMap (*meta_data_maps)[2] = NULL; +static MetadataMap (*meta_data_maps)[2] = NULL; static int nb_meta_data_maps; static int metadata_global_autocopy = 1; static int metadata_streams_autocopy = 1; static int metadata_chapters_autocopy = 1; -static AVChapterMap *chapter_maps = NULL; +static ChapterMap *chapter_maps = NULL; static int nb_chapter_maps; /* indexed by output file stream index */ @@ -246,19 +246,19 @@ static AVBitStreamFilterContext *subtitle_bitstream_filters=NULL; #define DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass" -struct AVInputStream; +struct InputStream; -typedef struct AVOutputStream { +typedef struct OutputStream { int file_index; /* file index */ int index; /* stream index in the output file */ - int source_index; /* AVInputStream index */ + int source_index; /* InputStream index */ AVStream *st; /* stream in the output file */ int encoding_needed; /* true if encoding needed for this stream */ int frame_number; /* input pts and corresponding output pts for A/V sync */ //double sync_ipts; /* dts from the AVPacket of the demuxer in second units */ - struct AVInputStream *sync_ist; /* input stream to sync against */ + struct InputStream *sync_ist; /* input stream to sync against */ int64_t sync_opts; /* output frame counter, could be changed to some true timestamp */ //FIXME look at frame_number AVBitStreamFilterContext *bitstream_filters; AVCodec *enc; @@ -299,12 +299,12 @@ typedef struct AVOutputStream { #endif int sws_flags; -} AVOutputStream; +} OutputStream; -static AVOutputStream **output_streams_for_file[MAX_FILES] = { NULL }; +static OutputStream **output_streams_for_file[MAX_FILES] = { NULL }; static int nb_output_streams_for_file[MAX_FILES] = { 0 }; -typedef struct AVInputStream { +typedef struct InputStream { int file_index; AVStream *st; int discard; /* true if stream data should be discarded */ @@ -323,23 +323,23 @@ typedef struct AVInputStream { AVFrame *filter_frame; int has_filter_frame; #endif -} AVInputStream; +} InputStream; -typedef struct AVInputFile { +typedef struct InputFile { AVFormatContext *ctx; int eof_reached; /* true if eof reached */ int ist_index; /* index of first stream in ist_table */ int buffer_size; /* current total buffer size */ -} AVInputFile; +} InputFile; -static AVInputStream *input_streams = NULL; +static InputStream *input_streams = NULL; static int nb_input_streams = 0; -static AVInputFile *input_files = NULL; +static InputFile *input_files = NULL; static int nb_input_files = 0; #if CONFIG_AVFILTER -static int configure_video_filters(AVInputStream *ist, AVOutputStream *ost) +static int configure_video_filters(InputStream *ist, OutputStream *ost) { AVFilterContext *last_filter, *filter; /** filter graph containing all filters including input & output */ @@ -647,10 +647,10 @@ static void choose_pixel_fmt(AVStream *st, AVCodec *codec) } } -static AVOutputStream *new_output_stream(AVFormatContext *oc, int file_idx) +static OutputStream *new_output_stream(AVFormatContext *oc, int file_idx) { int idx = oc->nb_streams - 1; - AVOutputStream *ost; + OutputStream *ost; output_streams_for_file[file_idx] = grow_array(output_streams_for_file[file_idx], @@ -658,7 +658,7 @@ static AVOutputStream *new_output_stream(AVFormatContext *oc, int file_idx) &nb_output_streams_for_file[file_idx], oc->nb_streams); ost = output_streams_for_file[file_idx][idx] = - av_mallocz(sizeof(AVOutputStream)); + av_mallocz(sizeof(OutputStream)); if (!ost) { fprintf(stderr, "Could not alloc output stream\n"); ffmpeg_exit(1); @@ -727,9 +727,9 @@ static int read_ffserver_streams(AVFormatContext *s, const char *filename) } static double -get_sync_ipts(const AVOutputStream *ost) +get_sync_ipts(const OutputStream *ost) { - const AVInputStream *ist = ost->sync_ist; + const InputStream *ist = ost->sync_ist; return (double)(ist->pts - start_time)/AV_TIME_BASE; } @@ -768,8 +768,8 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, AVCodecContext *avctx #define MAX_AUDIO_PACKET_SIZE (128 * 1024) static void do_audio_out(AVFormatContext *s, - AVOutputStream *ost, - AVInputStream *ist, + OutputStream *ost, + InputStream *ist, unsigned char *buf, int size) { uint8_t *buftmp; @@ -1011,7 +1011,7 @@ need_realloc: } } -static void pre_process_video_frame(AVInputStream *ist, AVPicture *picture, void **bufp) +static void pre_process_video_frame(InputStream *ist, AVPicture *picture, void **bufp) { AVCodecContext *dec; AVPicture *picture2; @@ -1054,8 +1054,8 @@ static void pre_process_video_frame(AVInputStream *ist, AVPicture *picture, void #define AV_DELAY_MAX 0.100 static void do_subtitle_out(AVFormatContext *s, - AVOutputStream *ost, - AVInputStream *ist, + OutputStream *ost, + InputStream *ist, AVSubtitle *sub, int64_t pts) { @@ -1120,8 +1120,8 @@ static int bit_buffer_size= 1024*256; static uint8_t *bit_buffer= NULL; static void do_video_out(AVFormatContext *s, - AVOutputStream *ost, - AVInputStream *ist, + OutputStream *ost, + InputStream *ist, AVFrame *in_picture, int *frame_size, float quality) { @@ -1296,7 +1296,7 @@ static double psnr(double d){ return -10.0*log(d)/log(10.0); } -static void do_video_stats(AVFormatContext *os, AVOutputStream *ost, +static void do_video_stats(AVFormatContext *os, OutputStream *ost, int frame_size) { AVCodecContext *enc; @@ -1334,11 +1334,11 @@ static void do_video_stats(AVFormatContext *os, AVOutputStream *ost, } static void print_report(AVFormatContext **output_files, - AVOutputStream **ost_table, int nb_ostreams, + OutputStream **ost_table, int nb_ostreams, int is_last_report) { char buf[1024]; - AVOutputStream *ost; + OutputStream *ost; AVFormatContext *oc; int64_t total_size; AVCodecContext *enc; @@ -1464,12 +1464,12 @@ static void generate_silence(uint8_t* buf, enum AVSampleFormat sample_fmt, size_ } /* pkt = NULL means EOF (needed to flush decoder buffers) */ -static int output_packet(AVInputStream *ist, int ist_index, - AVOutputStream **ost_table, int nb_ostreams, +static int output_packet(InputStream *ist, int ist_index, + OutputStream **ost_table, int nb_ostreams, const AVPacket *pkt) { AVFormatContext *os; - AVOutputStream *ost; + OutputStream *ost; int ret, i; int got_output; AVFrame picture; @@ -1916,7 +1916,7 @@ static int copy_chapters(int infile, int outfile) return 0; } -static void parse_forced_key_frames(char *kf, AVOutputStream *ost, +static void parse_forced_key_frames(char *kf, OutputStream *ost, AVCodecContext *avctx) { char *p; @@ -1944,15 +1944,15 @@ static void parse_forced_key_frames(char *kf, AVOutputStream *ost, */ static int transcode(AVFormatContext **output_files, int nb_output_files, - AVInputFile *input_files, + InputFile *input_files, int nb_input_files, - AVStreamMap *stream_maps, int nb_stream_maps) + StreamMap *stream_maps, int nb_stream_maps) { int ret = 0, i, j, k, n, nb_ostreams = 0; AVFormatContext *is, *os; AVCodecContext *codec, *icodec; - AVOutputStream *ost, **ost_table = NULL; - AVInputStream *ist; + OutputStream *ost, **ost_table = NULL; + InputStream *ist; char error[1024]; int want_sdp = 1; uint8_t no_packet[MAX_FILES]={0}; @@ -2001,7 +2001,7 @@ static int transcode(AVFormatContext **output_files, } } - ost_table = av_mallocz(sizeof(AVOutputStream *) * nb_ostreams); + ost_table = av_mallocz(sizeof(OutputStream *) * nb_ostreams); if (!ost_table) goto fail; n = 0; @@ -2412,7 +2412,7 @@ static int transcode(AVFormatContext **output_files, files[1] = input_files[in_file_index].ctx; for (j = 0; j < 2; j++) { - AVMetaDataMap *map = &meta_data_maps[i][j]; + MetadataMap *map = &meta_data_maps[i][j]; switch (map->type) { case 'g': @@ -2984,7 +2984,7 @@ static int opt_codec_tag(const char *opt, const char *arg) static int opt_map(const char *opt, const char *arg) { - AVStreamMap *m; + StreamMap *m; char *p; stream_maps = grow_array(stream_maps, sizeof(*stream_maps), &nb_stream_maps, nb_stream_maps + 1); @@ -3031,7 +3031,7 @@ static void parse_meta_type(char *arg, char *type, int *index, char **endptr) static int opt_map_metadata(const char *opt, const char *arg) { - AVMetaDataMap *m, *m1; + MetadataMap *m, *m1; char *p; meta_data_maps = grow_array(meta_data_maps, sizeof(*meta_data_maps), @@ -3066,7 +3066,7 @@ static int opt_map_meta_data(const char *opt, const char *arg) static int opt_map_chapters(const char *opt, const char *arg) { - AVChapterMap *c; + ChapterMap *c; char *p; chapter_maps = grow_array(chapter_maps, sizeof(*chapter_maps), &nb_chapter_maps, @@ -3298,7 +3298,7 @@ static int opt_input_file(const char *opt, const char *filename) for(i=0;inb_streams;i++) { AVStream *st = ic->streams[i]; AVCodecContext *dec = st->codec; - AVInputStream *ist; + InputStream *ist; dec->thread_count = thread_count; input_codecs = grow_array(input_codecs, sizeof(*input_codecs), &nb_input_codecs, nb_input_codecs + 1); @@ -3430,7 +3430,7 @@ static void check_inputs(int *has_video_ptr, static void new_video_stream(AVFormatContext *oc, int file_idx) { AVStream *st; - AVOutputStream *ost; + OutputStream *ost; AVCodecContext *video_enc; enum CodecID codec_id = CODEC_ID_NONE; AVCodec *codec= NULL; @@ -3569,7 +3569,7 @@ static void new_video_stream(AVFormatContext *oc, int file_idx) static void new_audio_stream(AVFormatContext *oc, int file_idx) { AVStream *st; - AVOutputStream *ost; + OutputStream *ost; AVCodec *codec= NULL; AVCodecContext *audio_enc; enum CodecID codec_id = CODEC_ID_NONE; @@ -3679,7 +3679,7 @@ static void new_data_stream(AVFormatContext *oc, int file_idx) static void new_subtitle_stream(AVFormatContext *oc, int file_idx) { AVStream *st; - AVOutputStream *ost; + OutputStream *ost; AVCodec *codec=NULL; AVCodecContext *subtitle_enc; enum CodecID codec_id = CODEC_ID_NONE; From 9e253c13d0f019359bdddc75aa5adba59e2a793d Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 23 Jun 2011 19:22:19 +0200 Subject: [PATCH 22/28] ffmpeg: merge input_codecs into input_streams. There's no point in keeping them separate. --- ffmpeg.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 5d6fa1ea02..980a2858c3 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -109,8 +109,6 @@ static const OptionDef options[]; static const char *last_asked_format = NULL; static int64_t input_files_ts_offset[MAX_FILES]; static double *input_files_ts_scale[MAX_FILES] = {NULL}; -static AVCodec **input_codecs = NULL; -static int nb_input_codecs = 0; static int nb_input_files_ts_scale[MAX_FILES] = {0}; static AVFormatContext *output_files[MAX_FILES]; @@ -310,6 +308,7 @@ typedef struct InputStream { int discard; /* true if stream data should be discarded */ int decoding_needed; /* true if the packets must be decoded in 'raw_fifo' */ int64_t sample_index; /* current sample */ + AVCodec *dec; int64_t start; /* time when read started */ int64_t next_pts; /* synthetic pts for cases where pkt.pts @@ -479,7 +478,6 @@ static int ffmpeg_exit(int ret) av_free(vstats_filename); av_free(streamid_map); - av_free(input_codecs); av_free(stream_maps); av_free(meta_data_maps); @@ -2345,7 +2343,7 @@ static int transcode(AVFormatContext **output_files, for (i = 0; i < nb_input_streams; i++) { ist = &input_streams[i]; if (ist->decoding_needed) { - AVCodec *codec = i < nb_input_codecs ? input_codecs[i] : NULL; + AVCodec *codec = ist->dec; if (!codec) codec = avcodec_find_decoder(ist->st->codec->codec_id); if (!codec) { @@ -3301,7 +3299,6 @@ static int opt_input_file(const char *opt, const char *filename) InputStream *ist; dec->thread_count = thread_count; - input_codecs = grow_array(input_codecs, sizeof(*input_codecs), &nb_input_codecs, nb_input_codecs + 1); input_streams = grow_array(input_streams, sizeof(*input_streams), &nb_input_streams, nb_input_streams + 1); ist = &input_streams[nb_input_streams - 1]; @@ -3311,16 +3308,16 @@ static int opt_input_file(const char *opt, const char *filename) switch (dec->codec_type) { case AVMEDIA_TYPE_AUDIO: - input_codecs[nb_input_codecs-1] = avcodec_find_decoder_by_name(audio_codec_name); - set_context_opts(dec, avcodec_opts[AVMEDIA_TYPE_AUDIO], AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM, input_codecs[nb_input_codecs-1]); + ist->dec = avcodec_find_decoder_by_name(audio_codec_name); + set_context_opts(dec, avcodec_opts[AVMEDIA_TYPE_AUDIO], AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM, ist->dec); channel_layout = dec->channel_layout; audio_sample_fmt = dec->sample_fmt; if(audio_disable) st->discard= AVDISCARD_ALL; break; case AVMEDIA_TYPE_VIDEO: - input_codecs[nb_input_codecs-1] = avcodec_find_decoder_by_name(video_codec_name); - set_context_opts(dec, avcodec_opts[AVMEDIA_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM, input_codecs[nb_input_codecs-1]); + ist->dec = avcodec_find_decoder_by_name(video_codec_name); + set_context_opts(dec, avcodec_opts[AVMEDIA_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM, ist->dec); rfps = ic->streams[i]->r_frame_rate.num; rfps_base = ic->streams[i]->r_frame_rate.den; if (dec->lowres) { @@ -3348,7 +3345,7 @@ static int opt_input_file(const char *opt, const char *filename) case AVMEDIA_TYPE_DATA: break; case AVMEDIA_TYPE_SUBTITLE: - input_codecs[nb_input_codecs-1] = avcodec_find_decoder_by_name(subtitle_codec_name); + ist->dec = avcodec_find_decoder_by_name(subtitle_codec_name); if(subtitle_disable) st->discard = AVDISCARD_ALL; break; From 27e91f37f58d122f94d9d9b30c6355d2dd2b0e49 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 23 Jun 2011 19:30:15 +0200 Subject: [PATCH 23/28] ffmpeg: merge input_files_ts_offset into input_files. --- ffmpeg.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 980a2858c3..390785555a 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -107,7 +107,6 @@ static const OptionDef options[]; #define FFM_PACKET_SIZE 4096 //XXX a duplicate of the line in ffm.h static const char *last_asked_format = NULL; -static int64_t input_files_ts_offset[MAX_FILES]; static double *input_files_ts_scale[MAX_FILES] = {NULL}; static int nb_input_files_ts_scale[MAX_FILES] = {0}; @@ -329,6 +328,7 @@ typedef struct InputFile { int eof_reached; /* true if eof reached */ int ist_index; /* index of first stream in ist_table */ int buffer_size; /* current total buffer size */ + int64_t ts_offset; } InputFile; static InputStream *input_streams = NULL; @@ -1671,7 +1671,7 @@ static int output_packet(InputStream *ist, int ist_index, os = output_files[ost->file_index]; /* set the input output pts pairs */ - //ost->sync_ipts = (double)(ist->pts + input_files_ts_offset[ist->file_index] - start_time)/ AV_TIME_BASE; + //ost->sync_ipts = (double)(ist->pts + input_files[ist->file_index].ts_offset - start_time)/ AV_TIME_BASE; if (ost->encoding_needed) { av_assert0(ist->decoding_needed); @@ -1882,7 +1882,7 @@ static int copy_chapters(int infile, int outfile) for (i = 0; i < is->nb_chapters; i++) { AVChapter *in_ch = is->chapters[i], *out_ch; - int64_t ts_off = av_rescale_q(start_time - input_files_ts_offset[infile], + int64_t ts_off = av_rescale_q(start_time - input_files[infile].ts_offset, AV_TIME_BASE_Q, in_ch->time_base); int64_t rt = (recording_time == INT64_MAX) ? INT64_MAX : av_rescale_q(recording_time, AV_TIME_BASE_Q, in_ch->time_base); @@ -2613,9 +2613,9 @@ static int transcode(AVFormatContext **output_files, goto discard_packet; if (pkt.dts != AV_NOPTS_VALUE) - pkt.dts += av_rescale_q(input_files_ts_offset[ist->file_index], AV_TIME_BASE_Q, ist->st->time_base); + pkt.dts += av_rescale_q(input_files[ist->file_index].ts_offset, AV_TIME_BASE_Q, ist->st->time_base); if (pkt.pts != AV_NOPTS_VALUE) - pkt.pts += av_rescale_q(input_files_ts_offset[ist->file_index], AV_TIME_BASE_Q, ist->st->time_base); + pkt.pts += av_rescale_q(input_files[ist->file_index].ts_offset, AV_TIME_BASE_Q, ist->st->time_base); if (pkt.stream_index < nb_input_files_ts_scale[file_index] && input_files_ts_scale[file_index][pkt.stream_index]){ @@ -2625,15 +2625,16 @@ static int transcode(AVFormatContext **output_files, pkt.dts *= input_files_ts_scale[file_index][pkt.stream_index]; } -// fprintf(stderr, "next:%"PRId64" dts:%"PRId64" off:%"PRId64" %d\n", ist->next_pts, pkt.dts, input_files_ts_offset[ist->file_index], ist->st->codec->codec_type); +// fprintf(stderr, "next:%"PRId64" dts:%"PRId64" off:%"PRId64" %d\n", ist->next_pts, pkt.dts, input_files[ist->file_index].ts_offset, ist->st->codec->codec_type); if (pkt.dts != AV_NOPTS_VALUE && ist->next_pts != AV_NOPTS_VALUE && (is->iformat->flags & AVFMT_TS_DISCONT)) { int64_t pkt_dts= av_rescale_q(pkt.dts, ist->st->time_base, AV_TIME_BASE_Q); int64_t delta= pkt_dts - ist->next_pts; if((FFABS(delta) > 1LL*dts_delta_threshold*AV_TIME_BASE || pkt_dts+1pts)&& !copy_ts){ - input_files_ts_offset[ist->file_index]-= delta; + input_files[ist->file_index].ts_offset -= delta; if (verbose > 2) - fprintf(stderr, "timestamp discontinuity %"PRId64", new offset= %"PRId64"\n", delta, input_files_ts_offset[ist->file_index]); + fprintf(stderr, "timestamp discontinuity %"PRId64", new offset= %"PRId64"\n", + delta, input_files[ist->file_index].ts_offset); pkt.dts-= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base); if(pkt.pts != AV_NOPTS_VALUE) pkt.pts-= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base); @@ -3357,7 +3358,6 @@ static int opt_input_file(const char *opt, const char *filename) } } - input_files_ts_offset[nb_input_files] = input_ts_offset - (copy_ts ? 0 : timestamp); /* dump the file content */ if (verbose >= 0) av_dump_format(ic, nb_input_files, filename, 0); @@ -3365,6 +3365,7 @@ static int opt_input_file(const char *opt, const char *filename) input_files = grow_array(input_files, sizeof(*input_files), &nb_input_files, nb_input_files + 1); input_files[nb_input_files - 1].ctx = ic; input_files[nb_input_files - 1].ist_index = nb_input_streams - ic->nb_streams; + input_files[nb_input_files - 1].ts_offset = input_ts_offset - (copy_ts ? 0 : timestamp); frame_rate = (AVRational){0, 0}; frame_pix_fmt = PIX_FMT_NONE; From 20f9f21fd49112c70c94dad015550f59ece5a0e9 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 24 Jun 2011 08:54:52 +0200 Subject: [PATCH 24/28] ffmpeg: remove pointless if (nb_input_files) It's required to be non-zero since cc58300e30e7aea6acfecd72a04a3886b285cfd8 --- ffmpeg.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 390785555a..9ae197acec 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -3821,23 +3821,20 @@ static void opt_output_file(const char *filename) use_subtitle = file_oformat->subtitle_codec != CODEC_ID_NONE || subtitle_stream_copy || subtitle_codec_name; use_data = data_stream_copy || data_codec_name; /* XXX once generic data codec will be available add a ->data_codec reference and use it here */ - /* disable if no corresponding type found and at least one - input file */ - if (nb_input_files > 0) { - check_inputs(&input_has_video, - &input_has_audio, - &input_has_subtitle, - &input_has_data); + /* disable if no corresponding type found */ + check_inputs(&input_has_video, + &input_has_audio, + &input_has_subtitle, + &input_has_data); - if (!input_has_video) - use_video = 0; - if (!input_has_audio) - use_audio = 0; - if (!input_has_subtitle) - use_subtitle = 0; - if (!input_has_data) - use_data = 0; - } + if (!input_has_video) + use_video = 0; + if (!input_has_audio) + use_audio = 0; + if (!input_has_subtitle) + use_subtitle = 0; + if (!input_has_data) + use_data = 0; /* manual disable */ if (audio_disable) use_audio = 0; From a58db9d283ced3eb443b3123e6e742dfd0614bc4 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 24 Jun 2011 11:22:15 +0200 Subject: [PATCH 25/28] doc: update ffmpeg -ar and -ac documentation to reflect reality. --- doc/ffmpeg.texi | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi index 6e7fd1390d..5246b18640 100644 --- a/doc/ffmpeg.texi +++ b/doc/ffmpeg.texi @@ -551,19 +551,19 @@ The timestamps must be specified in ascending order. @item -aframes @var{number} Set the number of audio frames to record. @item -ar @var{freq} -Set the audio sampling frequency. For input streams it is set by -default to 44100 Hz, for output streams it is set by default to the -frequency of the input stream. If the input file has audio streams -with different frequencies, the behaviour is undefined. +Set the audio sampling frequency. For output streams it is set by +default to the frequency of the corresponding input stream. For input +streams this option only makes sense for audio grabbing devices and raw +demuxers and is mapped to the corresponding demuxer options. @item -ab @var{bitrate} Set the audio bitrate in bit/s (default = 64k). @item -aq @var{q} Set the audio quality (codec-specific, VBR). @item -ac @var{channels} -Set the number of audio channels. For input streams it is set by -default to 1, for output streams it is set by default to the same -number of audio channels in input. If the input file has audio streams -with different channel count, the behaviour is undefined. +Set the number of audio channels. For output streams it is set by +default to the number of input audio channels. For input streams +this option only makes sense for audio grabbing devices and raw demuxers +and is mapped to the corresponding demuxer options. @item -an Disable audio recording. @item -acodec @var{codec} From e98bc78ca168bbb615752ed8e3b97bcacafdf0b7 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 6 Jul 2011 08:35:07 +0200 Subject: [PATCH 26/28] ffmpeg: remove unused variables from InputStream. --- ffmpeg.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 9ae197acec..fe8b3446b8 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -306,7 +306,6 @@ typedef struct InputStream { AVStream *st; int discard; /* true if stream data should be discarded */ int decoding_needed; /* true if the packets must be decoded in 'raw_fifo' */ - int64_t sample_index; /* current sample */ AVCodec *dec; int64_t start; /* time when read started */ @@ -317,10 +316,6 @@ typedef struct InputStream { int is_start; /* is 1 at the start and after a discontinuity */ int showed_multi_packet_warning; int is_past_recording_time; -#if CONFIG_AVFILTER - AVFrame *filter_frame; - int has_filter_frame; -#endif } InputStream; typedef struct InputFile { From 1c6d2b7df061de2a9205ed711f4344926237bb5f Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 16 Mar 2011 08:45:14 +0100 Subject: [PATCH 27/28] lavf: update AVStream.nb_frames when muxing. --- libavformat/matroskaenc.c | 2 +- libavformat/utils.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index d132b65f5b..169e8e44da 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -932,7 +932,7 @@ static int mkv_write_ass_blocks(AVFormatContext *s, AVIOContext *pb, AVPacket *p size -= start - data; sscanf(data, "Dialogue: %d,", &layer); i = snprintf(buffer, sizeof(buffer), "%"PRId64",%d,", - s->streams[pkt->stream_index]->nb_frames++, layer); + s->streams[pkt->stream_index]->nb_frames, layer); size = FFMIN(i+size, sizeof(buffer)); memcpy(buffer+i, start, size-i); diff --git a/libavformat/utils.c b/libavformat/utils.c index 060e58e9b2..e38d9efa60 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3023,6 +3023,9 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt) return ret; ret= s->oformat->write_packet(s, pkt); + + if (ret >= 0) + s->streams[pkt->stream_index]->nb_frames++; return ret; } @@ -3143,6 +3146,8 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt){ return ret; ret= s->oformat->write_packet(s, &opkt); + if (ret >= 0) + s->streams[opkt.stream_index]->nb_frames++; av_free_packet(&opkt); pkt= NULL; @@ -3165,6 +3170,8 @@ int av_write_trailer(AVFormatContext *s) break; ret= s->oformat->write_packet(s, &pkt); + if (ret >= 0) + s->streams[pkt.stream_index]->nb_frames++; av_free_packet(&pkt); From bda168d2b0210dda84f1a9d32c8aa4653d1674d5 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 21 Mar 2011 21:02:50 +0100 Subject: [PATCH 28/28] mp3enc: write a xing frame containing number of frames in the file --- libavcodec/Makefile | 1 + libavformat/mp3enc.c | 75 +++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 71 insertions(+), 5 deletions(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index b781ed7ef3..fb603f864d 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -536,6 +536,7 @@ OBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio.o mpegaudiodata.o OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o mpeg4audio.o \ flacdec.o flacdata.o flac.o \ mpegaudiodata.o +OBJS-$(CONFIG_MP3_MUXER) += mpegaudiodata.o mpegaudiodecheader.o OBJS-$(CONFIG_MOV_DEMUXER) += mpeg4audio.o mpegaudiodata.o OBJS-$(CONFIG_MOV_MUXER) += mpeg4audio.o mpegaudiodata.o OBJS-$(CONFIG_MPEGTS_MUXER) += mpegvideo.o mpeg4audio.o diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c index 092d16ecc1..9d0ec5d929 100644 --- a/libavformat/mp3enc.c +++ b/libavformat/mp3enc.c @@ -21,10 +21,14 @@ #include #include "avformat.h" +#include "avio_internal.h" #include "id3v1.h" #include "id3v2.h" #include "rawenc.h" #include "libavutil/avstring.h" +#include "libavcodec/mpegaudio.h" +#include "libavcodec/mpegaudiodata.h" +#include "libavcodec/mpegaudiodecheader.h" #include "libavutil/intreadwrite.h" #include "libavutil/opt.h" #include "libavutil/dict.h" @@ -128,15 +132,31 @@ static int id3v2_put_ttag(AVFormatContext *s, const char *str1, const char *str2 return len + ID3v2_HEADER_SIZE; } +typedef struct MP3Context { + const AVClass *class; + int id3v2_version; + int64_t nb_frames_offset; +} MP3Context; + static int mp3_write_trailer(struct AVFormatContext *s) { uint8_t buf[ID3v1_TAG_SIZE]; + MP3Context *mp3 = s->priv_data; /* write the id3v1 tag */ if (id3v1_create_tag(s, buf) > 0) { avio_write(s->pb, buf, ID3v1_TAG_SIZE); - avio_flush(s->pb); } + + /* write number of frames */ + if (mp3 && mp3->nb_frames_offset) { + avio_seek(s->pb, mp3->nb_frames_offset, SEEK_SET); + avio_wb32(s->pb, s->streams[0]->nb_frames); + avio_seek(s->pb, 0, SEEK_END); + } + + avio_flush(s->pb); + return 0; } @@ -156,10 +176,6 @@ AVOutputFormat ff_mp2_muxer = { #endif #if CONFIG_MP3_MUXER -typedef struct MP3Context { - const AVClass *class; - int id3v2_version; -} MP3Context; static const AVOption options[] = { { "id3v2_version", "Select ID3v2 version to write. Currently 3 and 4 are supported.", @@ -189,6 +205,52 @@ static int id3v2_check_write_tag(AVFormatContext *s, AVDictionaryEntry *t, const return -1; } +/* insert a dummy frame containing number of frames */ +static void mp3_write_xing(AVFormatContext *s) +{ + AVCodecContext *codec = s->streams[0]->codec; + MP3Context *mp3 = s->priv_data; + int bitrate_idx = 1; // 32 kbps + int64_t xing_offset = (codec->channels == 2) ? 32 : 17; + int32_t header; + MPADecodeHeader mpah; + int srate_idx, i, channels; + + for (i = 0; i < FF_ARRAY_ELEMS(ff_mpa_freq_tab); i++) + if (ff_mpa_freq_tab[i] == codec->sample_rate) { + srate_idx = i; + break; + } + if (i == FF_ARRAY_ELEMS(ff_mpa_freq_tab)) { + av_log(s, AV_LOG_ERROR, "Unsupported sample rate.\n"); + return; + } + + switch (codec->channels) { + case 1: channels = MPA_MONO; break; + case 2: channels = MPA_STEREO; break; + default: av_log(s, AV_LOG_ERROR, "Unsupported number of channels.\n"); return; + } + + /* dummy MPEG audio header */ + header = 0xff << 24; // sync + header |= (0x7 << 5 | 0x3 << 3 | 0x1 << 1 | 0x1) << 16; // sync/mpeg-1/layer 3/no crc*/ + header |= (bitrate_idx << 4 | srate_idx << 2) << 8; + header |= channels << 6; + avio_wb32(s->pb, header); + + ff_mpegaudio_decode_header(&mpah, header); + + ffio_fill(s->pb, 0, xing_offset); + ffio_wfourcc(s->pb, "Xing"); + avio_wb32(s->pb, 0x1); // only number of frames + mp3->nb_frames_offset = avio_tell(s->pb); + avio_wb32(s->pb, 0); + + mpah.frame_size -= 4 + xing_offset + 4 + 4 + 4; + ffio_fill(s->pb, 0, mpah.frame_size); +} + /** * Write an ID3v2 header at beginning of stream */ @@ -237,6 +299,9 @@ static int mp3_write_header(struct AVFormatContext *s) id3v2_put_size(s, totlen); avio_seek(s->pb, cur_pos, SEEK_SET); + if (s->pb->seekable) + mp3_write_xing(s); + return 0; }