From f7de52354fe15ba7cae141b44ffdd01e560f0e47 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Thu, 15 Dec 2011 00:29:49 +0000 Subject: [PATCH 01/15] ARM: dca: disable optimised decode_blockcodes() for old gcc Old gcc versions have trouble compiling this function, and no simple, targeted test is possible. Signed-off-by: Mans Rullgard --- libavcodec/arm/dca.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/arm/dca.h b/libavcodec/arm/dca.h index 9ff7f7c75e..9b0efc0e64 100644 --- a/libavcodec/arm/dca.h +++ b/libavcodec/arm/dca.h @@ -25,7 +25,7 @@ #include "config.h" #include "libavutil/intmath.h" -#if HAVE_ARMV6 && HAVE_INLINE_ASM +#if HAVE_ARMV6 && HAVE_INLINE_ASM && AV_GCC_VERSION_AT_LEAST(4,4) #define decode_blockcodes decode_blockcodes static inline int decode_blockcodes(int code1, int code2, int levels, From 8637af8d2499e72ad6662627dae9f245e3e961df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 14 Dec 2011 22:14:28 +0200 Subject: [PATCH 02/15] libgsm: Set options on the right object MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes regressions in decoding using the libgsm_ms decoder, broken since 0eea21294354. Signed-off-by: Martin Storsjö --- libavcodec/libgsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libgsm.c b/libavcodec/libgsm.c index 22629c657c..7623d35e81 100644 --- a/libavcodec/libgsm.c +++ b/libavcodec/libgsm.c @@ -155,7 +155,7 @@ static av_cold int libgsm_decode_init(AVCodecContext *avctx) { break; case CODEC_ID_GSM_MS: { int one = 1; - gsm_option(avctx->priv_data, GSM_OPT_WAV49, &one); + gsm_option(s->state, GSM_OPT_WAV49, &one); avctx->frame_size = 2 * GSM_FRAME_SIZE; avctx->block_align = GSM_MS_BLOCK_SIZE; } From 1b35af3225392a5328f6534c53e96a56cd5eb305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 14 Dec 2011 22:32:29 +0200 Subject: [PATCH 03/15] libgsm: Reset the MS mode of GSM in the flush function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mode is set in libgsm_decode_init, but the decoder object is simply destroyed and recreated in the flush function - therefore the mode has to be set again. This fixes playback using the libgsm_ms decoder in avplay. Signed-off-by: Martin Storsjö --- libavcodec/libgsm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/libgsm.c b/libavcodec/libgsm.c index 7623d35e81..16d9972f2c 100644 --- a/libavcodec/libgsm.c +++ b/libavcodec/libgsm.c @@ -212,9 +212,12 @@ static int libgsm_decode_frame(AVCodecContext *avctx, void *data, static void libgsm_flush(AVCodecContext *avctx) { LibGSMDecodeContext *s = avctx->priv_data; + int one = 1; gsm_destroy(s->state); s->state = gsm_create(); + if (avctx->codec_id == CODEC_ID_GSM_MS) + gsm_option(s->state, GSM_OPT_WAV49, &one); } AVCodec ff_libgsm_decoder = { From 566ee0eaf1543101f7a441cc42e3ddad097363bf Mon Sep 17 00:00:00 2001 From: Shitiz Garg Date: Thu, 15 Dec 2011 14:32:59 +0530 Subject: [PATCH 04/15] westwood: Make sure audio header info is present when parsing audio packets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Audio header information might get scrambled and would not parse, yet wsqva_read_packet would try to parse audio packets causing segfaults such as floating point exception. Fixes bugzilla #141. Signed-off-by: Martin Storsjö --- libavformat/westwood.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavformat/westwood.c b/libavformat/westwood.c index 67a00c9c33..82b7e94840 100644 --- a/libavformat/westwood.c +++ b/libavformat/westwood.c @@ -326,6 +326,11 @@ static int wsvqa_read_packet(AVFormatContext *s, chunk_size = AV_RB32(&preamble[4]); skip_byte = chunk_size & 0x01; + if ((chunk_type == SND2_TAG || chunk_type == SND1_TAG) && wsvqa->audio_channels == 0) { + av_log(s, AV_LOG_ERROR, "audio chunk without any audio header information found\n"); + return AVERROR_INVALIDDATA; + } + if ((chunk_type == SND1_TAG) || (chunk_type == SND2_TAG) || (chunk_type == VQFR_TAG)) { if (av_new_packet(pkt, chunk_size)) From b536c7a3e1399b67c8bfbdcefa69d5f0be944a80 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Thu, 15 Dec 2011 11:02:46 +0000 Subject: [PATCH 05/15] ARM: fix external symbol refs in rv40 asm External symbol references need prefixes on some systems. This should fix build errors on Darwin. Signed-off-by: Mans Rullgard --- libavcodec/arm/rv40dsp_neon.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/arm/rv40dsp_neon.S b/libavcodec/arm/rv40dsp_neon.S index a4313d89f9..d9e1b7c959 100644 --- a/libavcodec/arm/rv40dsp_neon.S +++ b/libavcodec/arm/rv40dsp_neon.S @@ -372,7 +372,7 @@ endfunc function ff_\type\()_rv40_qpel8_mc33_neon, export=1 mov r3, #8 - b ff_\type\()_pixels8_xy2_neon + b X(ff_\type\()_pixels8_xy2_neon) endfunc function ff_\type\()_rv40_qpel8_mc13_neon, export=1 @@ -652,7 +652,7 @@ endfunc function ff_\type\()_rv40_qpel16_mc33_neon, export=1 mov r3, #16 - b ff_\type\()_pixels16_xy2_neon + b X(ff_\type\()_pixels16_xy2_neon) endfunc .endm From 6c3abd70fd719e3bcdd2361fce36ff71e7d2015f Mon Sep 17 00:00:00 2001 From: Derek Buitenhuis Date: Tue, 13 Dec 2011 15:07:12 -0500 Subject: [PATCH 06/15] fate: Add FATE tests for v410 encoder and decoder Signed-off-by: Derek Buitenhuis Signed-off-by: Diego Biurrun --- tests/fate2.mak | 7 +++++++ tests/ref/fate/v410dec | 1 + tests/ref/fate/v410enc | 1 + 3 files changed, 9 insertions(+) create mode 100644 tests/ref/fate/v410dec create mode 100644 tests/ref/fate/v410enc diff --git a/tests/fate2.mak b/tests/fate2.mak index 521357c3cd..b0591a3314 100644 --- a/tests/fate2.mak +++ b/tests/fate2.mak @@ -125,3 +125,10 @@ fate-musepack7: FUZZ = 1 FATE_TESTS += fate-iirfilter fate-iirfilter: libavcodec/iirfilter-test$(EXESUF) fate-iirfilter: CMD = run libavcodec/iirfilter-test + +FATE_TESTS += fate-v410dec +fate-v410dec: CMD = framecrc -i $(SAMPLES)/v410/lenav410.mov -pix_fmt yuv444p10le + +FATE_TESTS += fate-v410enc +fate-v410enc: tests/vsynth1/00.pgm +fate-v410enc: CMD = md5 -f image2 -vcodec pgmyuv -i $(TARGET_PATH)/tests/vsynth1/%02d.pgm -flags +bitexact -vcodec v410 -f avi diff --git a/tests/ref/fate/v410dec b/tests/ref/fate/v410dec new file mode 100644 index 0000000000..f72d74fc38 --- /dev/null +++ b/tests/ref/fate/v410dec @@ -0,0 +1 @@ +0, 0, 393216, 0xfe11a6b0 diff --git a/tests/ref/fate/v410enc b/tests/ref/fate/v410enc new file mode 100644 index 0000000000..e5332dedd4 --- /dev/null +++ b/tests/ref/fate/v410enc @@ -0,0 +1 @@ +979c9a9a09e8eaaf6467b8c22c0ac8bb From 44b7e1b94298f55564eed65daa054fdbf7bff972 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Wed, 14 Dec 2011 22:35:14 +0100 Subject: [PATCH 07/15] fate: split off ATRAC FATE tests into their own file --- tests/Makefile | 1 + tests/fate/atrac.mak | 19 +++++++++++++++++++ tests/fate2.mak | 20 -------------------- 3 files changed, 20 insertions(+), 20 deletions(-) create mode 100644 tests/fate/atrac.mak diff --git a/tests/Makefile b/tests/Makefile index 3d3812f344..d1376c53f6 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -31,6 +31,7 @@ include $(SRC_PATH)/tests/fate/ac3.mak include $(SRC_PATH)/tests/fate/als.mak include $(SRC_PATH)/tests/fate/amrnb.mak include $(SRC_PATH)/tests/fate/amrwb.mak +include $(SRC_PATH)/tests/fate/atrac.mak include $(SRC_PATH)/tests/fate/dct.mak include $(SRC_PATH)/tests/fate/fft.mak include $(SRC_PATH)/tests/fate/h264.mak diff --git a/tests/fate/atrac.mak b/tests/fate/atrac.mak new file mode 100644 index 0000000000..1d586c6e79 --- /dev/null +++ b/tests/fate/atrac.mak @@ -0,0 +1,19 @@ +FATE_TESTS += fate-atrac1 +fate-atrac1: CMD = pcm -i $(SAMPLES)/atrac1/test_tones_small.aea +fate-atrac1: CMP = oneoff +fate-atrac1: REF = $(SAMPLES)/atrac1/test_tones_small.pcm + +FATE_TESTS += fate-atrac3-1 +fate-atrac3-1: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_066_small.wav +fate-atrac3-1: CMP = oneoff +fate-atrac3-1: REF = $(SAMPLES)/atrac3/mc_sich_at3_066_small.pcm + +FATE_TESTS += fate-atrac3-2 +fate-atrac3-2: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_105_small.wav +fate-atrac3-2: CMP = oneoff +fate-atrac3-2: REF = $(SAMPLES)/atrac3/mc_sich_at3_105_small.pcm + +FATE_TESTS += fate-atrac3-3 +fate-atrac3-3: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_132_small.wav +fate-atrac3-3: CMP = oneoff +fate-atrac3-3: REF = $(SAMPLES)/atrac3/mc_sich_at3_132_small.pcm diff --git a/tests/fate2.mak b/tests/fate2.mak index b0591a3314..6ab9cb3c62 100644 --- a/tests/fate2.mak +++ b/tests/fate2.mak @@ -40,26 +40,6 @@ fate-truespeech: CMD = pcm -i $(SAMPLES)/truespeech/a6.wav fate-truespeech: CMP = oneoff fate-truespeech: REF = $(SAMPLES)/truespeech/a6.pcm -FATE_TESTS += fate-atrac1 -fate-atrac1: CMD = pcm -i $(SAMPLES)/atrac1/test_tones_small.aea -fate-atrac1: CMP = oneoff -fate-atrac1: REF = $(SAMPLES)/atrac1/test_tones_small.pcm - -FATE_TESTS += fate-atrac3-1 -fate-atrac3-1: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_066_small.wav -fate-atrac3-1: CMP = oneoff -fate-atrac3-1: REF = $(SAMPLES)/atrac3/mc_sich_at3_066_small.pcm - -FATE_TESTS += fate-atrac3-2 -fate-atrac3-2: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_105_small.wav -fate-atrac3-2: CMP = oneoff -fate-atrac3-2: REF = $(SAMPLES)/atrac3/mc_sich_at3_105_small.pcm - -FATE_TESTS += fate-atrac3-3 -fate-atrac3-3: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_132_small.wav -fate-atrac3-3: CMP = oneoff -fate-atrac3-3: REF = $(SAMPLES)/atrac3/mc_sich_at3_132_small.pcm - FATE_TESTS += fate-gsm fate-gsm: CMD = framecrc -i $(SAMPLES)/gsm/sample-gsm-8000.mov -t 10 From 6146d78d35eb57bb304eaf33d8605e0e730a5c88 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Wed, 14 Dec 2011 22:48:20 +0100 Subject: [PATCH 08/15] fate: split off Indeo FATE tests into their own file --- tests/Makefile | 1 + tests/fate.mak | 6 ------ tests/fate/indeo.mak | 8 ++++++++ 3 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 tests/fate/indeo.mak diff --git a/tests/Makefile b/tests/Makefile index d1376c53f6..6b08619e4b 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -36,6 +36,7 @@ include $(SRC_PATH)/tests/fate/dct.mak include $(SRC_PATH)/tests/fate/fft.mak include $(SRC_PATH)/tests/fate/h264.mak include $(SRC_PATH)/tests/fate/image.mak +include $(SRC_PATH)/tests/fate/indeo.mak include $(SRC_PATH)/tests/fate/libavutil.mak include $(SRC_PATH)/tests/fate/lossless-audio.mak include $(SRC_PATH)/tests/fate/lossless-video.mak diff --git a/tests/fate.mak b/tests/fate.mak index 22787d57ca..c31b30414a 100644 --- a/tests/fate.mak +++ b/tests/fate.mak @@ -122,12 +122,6 @@ FATE_TESTS += fate-iff-ilbm fate-iff-ilbm: CMD = framecrc -i $(SAMPLES)/iff/lms-matriks.ilbm -pix_fmt rgb24 FATE_TESTS += fate-iff-pcm fate-iff-pcm: CMD = md5 -i $(SAMPLES)/iff/Bells -f s16le -FATE_TESTS += fate-indeo2 -fate-indeo2: CMD = framecrc -i $(SAMPLES)/rt21/VPAR0026.AVI -FATE_TESTS += fate-indeo3 -fate-indeo3: CMD = framecrc -i $(SAMPLES)/iv32/cubes.mov -FATE_TESTS += fate-indeo5 -fate-indeo5: CMD = framecrc -i $(SAMPLES)/iv50/Educ_Movie_DeadlyForce.avi -an FATE_TESTS += fate-interplay-mve-16bit fate-interplay-mve-16bit: CMD = framecrc -i $(SAMPLES)/interplay-mve/descent3-level5-16bit-partial.mve -pix_fmt rgb24 FATE_TESTS += fate-interplay-mve-8bit diff --git a/tests/fate/indeo.mak b/tests/fate/indeo.mak new file mode 100644 index 0000000000..df07392790 --- /dev/null +++ b/tests/fate/indeo.mak @@ -0,0 +1,8 @@ +FATE_TESTS += fate-indeo2 +fate-indeo2: CMD = framecrc -i $(SAMPLES)/rt21/VPAR0026.AVI + +FATE_TESTS += fate-indeo3 +fate-indeo3: CMD = framecrc -i $(SAMPLES)/iv32/cubes.mov + +FATE_TESTS += fate-indeo5 +fate-indeo5: CMD = framecrc -i $(SAMPLES)/iv50/Educ_Movie_DeadlyForce.avi -an From beaf4012d25373f94aab25a7288701e5be9a603a Mon Sep 17 00:00:00 2001 From: Aneesh Dogra Date: Sun, 11 Dec 2011 04:45:38 +0000 Subject: [PATCH 09/15] fate: add r210 decoder test Signed-off-by: Janne Grunau --- tests/fate2.mak | 3 +++ tests/ref/fate/r210 | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 tests/ref/fate/r210 diff --git a/tests/fate2.mak b/tests/fate2.mak index 6ab9cb3c62..24097b0e86 100644 --- a/tests/fate2.mak +++ b/tests/fate2.mak @@ -112,3 +112,6 @@ fate-v410dec: CMD = framecrc -i $(SAMPLES)/v410/lenav410.mov -pix_fmt yuv444p10l FATE_TESTS += fate-v410enc fate-v410enc: tests/vsynth1/00.pgm fate-v410enc: CMD = md5 -f image2 -vcodec pgmyuv -i $(TARGET_PATH)/tests/vsynth1/%02d.pgm -flags +bitexact -vcodec v410 -f avi + +FATE_TESTS += fate-r210 +fate-r210: CMD = framecrc -i $(SAMPLES)/r210/r210.avi diff --git a/tests/ref/fate/r210 b/tests/ref/fate/r210 new file mode 100644 index 0000000000..238a1364e5 --- /dev/null +++ b/tests/ref/fate/r210 @@ -0,0 +1,3 @@ +0, 0, 1843200, 0xbd414b93 +0, 3003, 1843200, 0x23298f1f +0, 6006, 1843200, 0x5a56df19 From 055c61b857eef8174fa71789d43c65b311b8d659 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Thu, 15 Dec 2011 12:17:13 +0100 Subject: [PATCH 10/15] configure: refactor list of programs into a variable --- configure | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/configure b/configure index a73924a8f1..b3af2e9c6b 100755 --- a/configure +++ b/configure @@ -903,8 +903,17 @@ COMPONENT_LIST=" protocols " +PROGRAM_LIST=" + avconv + avplay + avprobe + avserver + ffmpeg +" + CONFIG_LIST=" $COMPONENT_LIST + $PROGRAM_LIST aandct ac3dsp avcodec @@ -918,11 +927,6 @@ CONFIG_LIST=" dwt dxva2 fastdiv - ffmpeg - avconv - avplay - avprobe - avserver fft frei0r gnutls @@ -1659,6 +1663,8 @@ target_os_default=$(tolower $(uname -s)) host_os=$target_os_default # configurable options +enable $PROGRAM_LIST + enable avcodec enable avdevice enable avfilter @@ -1667,12 +1673,6 @@ enable avutil enable postproc enable swscale -enable avconv -enable avplay -enable avprobe -enable avserver -enable ffmpeg - enable asm enable debug enable doc From bd2ff1a8bc01668b66314c20494c839f774de38e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 15 Dec 2011 15:10:57 +0200 Subject: [PATCH 11/15] flvenc: Support muxing 16 kHz nellymoser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavformat/flvenc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index dfa17e0374..623bea701e 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -90,6 +90,7 @@ static int get_audio_flags(AVCodecContext *enc){ case 11025: flags |= FLV_SAMPLERATE_11025HZ; break; + case 16000: //nellymoser only case 8000: //nellymoser only case 5512: //not mp3 if(enc->codec_id != CODEC_ID_MP3){ @@ -125,6 +126,8 @@ static int get_audio_flags(AVCodecContext *enc){ case CODEC_ID_NELLYMOSER: if (enc->sample_rate == 8000) { flags |= FLV_CODECID_NELLYMOSER_8KHZ_MONO | FLV_SAMPLESSIZE_16BIT; + } else if (enc->sample_rate == 16000) { + flags |= FLV_CODECID_NELLYMOSER_16KHZ_MONO | FLV_SAMPLESSIZE_16BIT; } else { flags |= FLV_CODECID_NELLYMOSER | FLV_SAMPLESSIZE_16BIT; } From ef5756aee0daeff2f212c86428d45d39bb54e289 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Thu, 15 Dec 2011 15:44:38 +0100 Subject: [PATCH 12/15] fate: add -pix_fmt rgb48le to r210 test Fixes checksum on big endian systems. --- tests/fate2.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fate2.mak b/tests/fate2.mak index 24097b0e86..e78a8a3231 100644 --- a/tests/fate2.mak +++ b/tests/fate2.mak @@ -114,4 +114,4 @@ fate-v410enc: tests/vsynth1/00.pgm fate-v410enc: CMD = md5 -f image2 -vcodec pgmyuv -i $(TARGET_PATH)/tests/vsynth1/%02d.pgm -flags +bitexact -vcodec v410 -f avi FATE_TESTS += fate-r210 -fate-r210: CMD = framecrc -i $(SAMPLES)/r210/r210.avi +fate-r210: CMD = framecrc -i $(SAMPLES)/r210/r210.avi -pix_fmt rgb48le From 0249144a1c5ca6054e4b7374b5dd24bcbe435239 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Thu, 15 Dec 2011 16:06:12 +0000 Subject: [PATCH 13/15] v410enc: include correct headers This file does not use anything from put_bits.h but needs intreadwrite.h. Signed-off-by: Mans Rullgard --- libavcodec/v410enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/v410enc.c b/libavcodec/v410enc.c index 1e600c35b6..d15fb7ab97 100644 --- a/libavcodec/v410enc.c +++ b/libavcodec/v410enc.c @@ -20,8 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/intreadwrite.h" #include "avcodec.h" -#include "put_bits.h" static av_cold int v410_encode_init(AVCodecContext *avctx) { From dabba0c676389b73c7b324fc999da7076fae149e Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Thu, 15 Dec 2011 16:31:07 +0000 Subject: [PATCH 14/15] v410enc: fix output buffer size check The encoder clearly needs width * height * 4 bytes. Signed-off-by: Mans Rullgard --- libavcodec/v410enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/v410enc.c b/libavcodec/v410enc.c index d15fb7ab97..95b36c138e 100644 --- a/libavcodec/v410enc.c +++ b/libavcodec/v410enc.c @@ -50,7 +50,7 @@ static int v410_encode_frame(AVCodecContext *avctx, uint8_t *buf, int i, j; int output_size = 0; - if (buf_size < avctx->width * avctx->height * 3) { + if (buf_size < avctx->width * avctx->height * 4) { av_log(avctx, AV_LOG_ERROR, "Out buffer is too small.\n"); return AVERROR(ENOMEM); } From d3b8bde2f14f78109a892e57f544bf840cf6d4fc Mon Sep 17 00:00:00 2001 From: Alex Converse Date: Tue, 4 Oct 2011 11:44:25 -0700 Subject: [PATCH 15/15] movenc: Rudimentary IODs support. --- libavformat/movenc.c | 39 ++++++++++++++++++++++++++++----------- libavformat/movenc.h | 3 +++ tests/ref/acodec/alac | 4 ++-- tests/ref/vsynth1/mpeg4 | 4 ++-- tests/ref/vsynth2/mpeg4 | 4 ++-- 5 files changed, 37 insertions(+), 17 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index d1076c34c4..0463528362 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -46,6 +46,9 @@ static const AVOption options[] = { { "movflags", "MOV muxer flags", offsetof(MOVMuxContext, flags), AV_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, { "rtphint", "Add RTP hint tracks", 0, AV_OPT_TYPE_CONST, {.dbl = FF_MOV_FLAG_RTP_HINT}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, FF_RTP_FLAG_OPTS(MOVMuxContext, rtp_flags), + { "skip_iods", "Skip writing iods atom.", offsetof(MOVMuxContext, iods_skip), AV_OPT_TYPE_INT, {.dbl = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM}, + { "iods_audio_profile", "iods audio profile atom.", offsetof(MOVMuxContext, iods_audio_profile), AV_OPT_TYPE_INT, {.dbl = -1}, -1, 255, AV_OPT_FLAG_ENCODING_PARAM}, + { "iods_video_profile", "iods video profile atom.", offsetof(MOVMuxContext, iods_video_profile), AV_OPT_TYPE_INT, {.dbl = -1}, -1, 255, AV_OPT_FLAG_ENCODING_PARAM}, { NULL }, }; @@ -1407,21 +1410,34 @@ static int mov_write_trak_tag(AVIOContext *pb, MOVTrack *track, AVStream *st) return updateSize(pb, pos); } -#if 0 -/* TODO: Not sorted out, but not necessary either */ static int mov_write_iods_tag(AVIOContext *pb, MOVMuxContext *mov) { - avio_wb32(pb, 0x15); /* size */ + int i, has_audio = 0, has_video = 0; + int64_t pos = avio_tell(pb); + int audio_profile = mov->iods_audio_profile; + int video_profile = mov->iods_video_profile; + for (i = 0; i < mov->nb_streams; i++) { + if(mov->tracks[i].entry > 0) { + has_audio |= mov->tracks[i].enc->codec_type == AVMEDIA_TYPE_AUDIO; + has_video |= mov->tracks[i].enc->codec_type == AVMEDIA_TYPE_VIDEO; + } + } + if (audio_profile < 0) + audio_profile = 0xFF - has_audio; + if (video_profile < 0) + video_profile = 0xFF - has_video; + avio_wb32(pb, 0x0); /* size */ ffio_wfourcc(pb, "iods"); avio_wb32(pb, 0); /* version & flags */ - avio_wb16(pb, 0x1007); - avio_w8(pb, 0); - avio_wb16(pb, 0x4fff); - avio_wb16(pb, 0xfffe); - avio_wb16(pb, 0x01ff); - return 0x15; + putDescr(pb, 0x10, 7); + avio_wb16(pb, 0x004f); + avio_w8(pb, 0xff); + avio_w8(pb, 0xff); + avio_w8(pb, audio_profile); + avio_w8(pb, video_profile); + avio_w8(pb, 0xff); + return updateSize(pb, pos); } -#endif static int mov_write_mvhd_tag(AVIOContext *pb, MOVMuxContext *mov) { @@ -1829,7 +1845,8 @@ static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov, } mov_write_mvhd_tag(pb, mov); - //mov_write_iods_tag(pb, mov); + if (mov->mode != MODE_MOV && !mov->iods_skip) + mov_write_iods_tag(pb, mov); for (i=0; inb_streams; i++) { if(mov->tracks[i].entry > 0) { mov_write_trak_tag(pb, &(mov->tracks[i]), i < s->nb_streams ? s->streams[i] : NULL); diff --git a/libavformat/movenc.h b/libavformat/movenc.h index 9b14f24b7a..5ca5631c5a 100644 --- a/libavformat/movenc.h +++ b/libavformat/movenc.h @@ -112,6 +112,9 @@ typedef struct MOVMuxContext { int flags; int rtp_flags; + int iods_skip; + int iods_video_profile; + int iods_audio_profile; } MOVMuxContext; #define FF_MOV_FLAG_RTP_HINT 1 diff --git a/tests/ref/acodec/alac b/tests/ref/acodec/alac index f03ce893d8..15d1a1fa41 100644 --- a/tests/ref/acodec/alac +++ b/tests/ref/acodec/alac @@ -1,4 +1,4 @@ -b25bcc7ec3f5c19cdfc01a6bbd32edb8 *./tests/data/acodec/alac.m4a -389386 ./tests/data/acodec/alac.m4a +8d9cb7f65c5b17c74e5f9bdc36f32b7d *./tests/data/acodec/alac.m4a +389410 ./tests/data/acodec/alac.m4a 64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/alac.acodec.out.wav stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 diff --git a/tests/ref/vsynth1/mpeg4 b/tests/ref/vsynth1/mpeg4 index ebe2f5a613..133e228ff4 100644 --- a/tests/ref/vsynth1/mpeg4 +++ b/tests/ref/vsynth1/mpeg4 @@ -1,4 +1,4 @@ -080e75117f8142001b096cd977ba287e *./tests/data/vsynth1/odivx.mp4 -540156 ./tests/data/vsynth1/odivx.mp4 +9251145d12150cb639098016d61fc75e *./tests/data/vsynth1/odivx.mp4 +540180 ./tests/data/vsynth1/odivx.mp4 8828a375448dc5c2215163ba70656f89 *./tests/data/mpeg4.vsynth1.out.yuv stddev: 7.97 PSNR: 30.10 MAXDIFF: 105 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth2/mpeg4 b/tests/ref/vsynth2/mpeg4 index fe436e88f3..b89a3ec60a 100644 --- a/tests/ref/vsynth2/mpeg4 +++ b/tests/ref/vsynth2/mpeg4 @@ -1,4 +1,4 @@ -8ffbe8ce43fe126b12cf9621717d641b *./tests/data/vsynth2/odivx.mp4 -119809 ./tests/data/vsynth2/odivx.mp4 +c2ca709a0ed64833fd38f703b19e5e85 *./tests/data/vsynth2/odivx.mp4 +119833 ./tests/data/vsynth2/odivx.mp4 90a3577850239083a9042bef33c50e85 *./tests/data/mpeg4.vsynth2.out.yuv stddev: 5.34 PSNR: 33.57 MAXDIFF: 83 bytes: 7603200/ 7603200