[FFmpeg-devel] [PATCH] libavformat/mov: fix multiple stsd handling of MOV files with edit list
From: Jiejun ZhangWhen an edit list exists in a MOV file, counting by stscs no longer works because stscs' order is different from the actual timeline. This commit adds stsd-change markers to the actual timeline and changes stsd according to these markers. Test sample: https://www.dropbox.com/s/qz0ort4znqq9jdy/attachment_video.mov?dl=0 Run `ffmpeg -i attachment_video.mov -f image2 frames%03d.png`. The git-master version cannot decode frame 327 to 330 because a wrong stsd is used. After applying this patch they are decoded correctly. Signed-off-by: Jiejun Zhang --- libavformat/isom.h | 13 +- libavformat/mov.c | 125 + 2 files changed, 109 insertions(+), 29 deletions(-) diff --git a/libavformat/isom.h b/libavformat/isom.h index 02bfedd..141237a 100644 --- a/libavformat/isom.h +++ b/libavformat/isom.h @@ -115,6 +115,14 @@ typedef struct MOVFragmentIndex { MOVFragmentIndexItem *items; } MOVFragmentIndex; +/** + * An entry for: stsd changes to `stsd_id` at sample `sample_index` (inclusive) + */ +typedef struct MOVStsdChangeEntry { +int64_t sample_index; +int stsd_id; +} MOVStsdChangeEntry; + typedef struct MOVStreamContext { AVIOContext *pb; int pb_is_copied; @@ -128,12 +136,13 @@ typedef struct MOVStreamContext { MOVStts *ctts_data; unsigned int stsc_count; MOVStsc *stsc_data; -int stsc_index; -int stsc_sample; unsigned int stps_count; unsigned *stps_data; ///< partial sync sample for mpeg-2 open gop MOVElst *elst_data; unsigned int elst_count; +MOVStsdChangeEntry *stsd_change_data; +int stsd_change_count; +int stsd_change_index; int ctts_index; int ctts_sample; unsigned int sample_size; ///< may contain value calculated from stsd or value from stsz atom diff --git a/libavformat/mov.c b/libavformat/mov.c index 88a79da..e5f7f72 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2901,6 +2901,35 @@ static int64_t add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, return index; } +static int add_stsd_change_entry(MOVStreamContext *msc, int64_t sample_index, int stsd_id, +unsigned int* allocated_size) +{ +MOVStsdChangeEntry *entries; +const size_t min_size_needed = (msc->stsd_change_count + 1) * sizeof(MOVStsdChangeEntry); + +const size_t requested_size = +min_size_needed > *allocated_size ? +FFMAX(min_size_needed, 2 * (*allocated_size)) : +min_size_needed; + +if ((unsigned)msc->stsd_change_count + 1 >= UINT_MAX / sizeof(MOVStsdChangeEntry)) +return -1; + +entries = av_fast_realloc(msc->stsd_change_data, + allocated_size, + requested_size); + +if (!entries) +return -1; + +msc->stsd_change_data = entries; +entries[msc->stsd_change_count].sample_index = sample_index; +entries[msc->stsd_change_count].stsd_id = stsd_id; +msc->stsd_change_count++; + +return 0; +} + /** * Rewrite timestamps of index entries in the range [end_index - frame_duration_buffer_size, end_index) * by subtracting end_ts successively by the amounts given in frame_duration_buffer. @@ -2984,6 +3013,8 @@ static void mov_fix_index(MOVContext *mov, AVStream *st) int num_discarded_begin = 0; int first_non_zero_audio_edit = -1; int packet_skip_samples = 0; +int stsc_index = 0; +int stsc_sample = 0; if (!msc->elst_data || msc->elst_count <= 0 || nb_old <= 0) { return; @@ -3012,6 +3043,11 @@ static void mov_fix_index(MOVContext *mov, AVStream *st) start_dts = edit_list_dts_entry_end; +msc->last_stsd_index = -1; +unsigned int stsd_change_data_allocated_size = 0; +msc->stsd_change_data = NULL; +msc->stsd_change_count = 0; + while (get_edit_list_entry(mov, msc, edit_list_index, _list_media_time, _list_duration, mov->time_scale)) { av_log(mov->fc, AV_LOG_DEBUG, "Processing st: %d, edit list %"PRId64" - media time: %"PRId64", duration: %"PRId64"\n", @@ -3073,6 +3109,20 @@ static void mov_fix_index(MOVContext *mov, AVStream *st) } current = e_old + index; +// adjust stsd index +int time_sample = 0; +for (int i = 0; i < msc->stsc_count; i++) { +int next = time_sample + mov_get_stsc_samples(msc, i); +if (next > index) { +stsc_index = i; +stsc_sample = index - time_sample; +break; +} +time_sample = next; +} + +av_log(mov->fc, AV_LOG_INFO, "stream %d, adjusted stsc_index: %d, stsc_sample: %d\n", st->index, stsc_index, stsc_sample); + ctts_index_old = 0; ctts_sample_old = 0; @@ -3176,12 +3226,36 @@ static void mov_fix_index(MOVContext *mov, AVStream *st) }
Re: [FFmpeg-devel] [PATCH] Save FFmpeg colorspace info in openh264 video files.
Hi, On Thu, Dec 1, 2016 at 6:35 PM, Carl Eugen Hoyoswrote: > 2016-12-01 22:26 GMT+01:00 Gregory J. Wolfe >: > > > +switch (avctx->color_primaries) { > > +case AVCOL_PRI_BT709:param.sSpatialLayers[0].uiColorPrimaries > = CP_BT709; break; > > +case AVCOL_PRI_UNSPECIFIED: param.sSpatialLayers[0].uiColorPrimaries > = CP_UNDEF; break; > > [ignore] > Please align vertically. > [/ignore] > Is it possible to convince gmail to always use a fixed-width font? > The patch looks ugly here on gmail but I suspect it was aligned nicely... In settings, change "Default text style:" to "Fixed Width". I don't believe there is a way to do this only for inline patches. I agree it would be useful. Ronald ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/6] tests/ffserver.regression.ref: Update ffserver checksums
On Fri, Dec 02, 2016 at 12:59:41AM +0100, Andreas Cadhalpun wrote: > On 01.12.2016 17:37, Michael Niedermayer wrote: > > They have changed due to 122190392b297b7cd9783641d880df887fd80d07 > > > > Signed-off-by: Michael Niedermayer> > --- > > tests/ffserver.regression.ref | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/tests/ffserver.regression.ref b/tests/ffserver.regression.ref > > index 3106f85..398c285 100644 > > --- a/tests/ffserver.regression.ref > > +++ b/tests/ffserver.regression.ref > > @@ -1,5 +1,5 @@ > > -233020d119085ba47535d5f2faf73cc0 *ff-test_h.avi > > -431b75d1f12cb039acebad61a3d39225 *ff-test_l.avi > > +0c9639f09decbc54c9f091dcf1ca0e8f *ff-test_h.avi > > +e28ba75853caf975e06d92955c9f7f73 *ff-test_l.avi > > a767dbdf5d1bded3450279f812f97b37 *ff-test.swf > > dc16f607e13328a832e73801cd21ec98 *ff-test_h.asf > > 69337d6c8cd7ac7e626338decdbf41d3 *ff-test_l.asf > > The test is unfortunately not very reproducible. > Right now I'm getting varying values like on one run: > -0c9639f09decbc54c9f091dcf1ca0e8f *ff-test_h.avi > -e28ba75853caf975e06d92955c9f7f73 *ff-test_l.avi > -a767dbdf5d1bded3450279f812f97b37 *ff-test.swf > +81c49d1bfcd43bcc43aa6aeed081126f *ff-test_h.avi > +2d642fbb77276ed1d12bf235a6a6bd57 *ff-test_l.avi > +daeee6c1418c5b2dcddded9b659e9fc2 *ff-test.swf > > And on the next: > -0c9639f09decbc54c9f091dcf1ca0e8f *ff-test_h.avi > -e28ba75853caf975e06d92955c9f7f73 *ff-test_l.avi > +5e7fc3d0b2f4866866ae4f268dc431ca *ff-test_h.avi > +6cc80ab0caec9499d1b82cd01fe7a861 *ff-test_l.avi > > I've no idea what the underlying problem is. it works here almost always i remember just one failure but you could try to use diff the ffprobe output showing as much as ffprobe supports to see what differs. binary compare (if they match in size) or ffmpeg -c copy -f framecrc - also please upload some different files somewhere it also could be some timeout issue if you have a slow box and maybe run this under valgrind otherwise printing checksums on packets at various points might help (that is if previous stuff points at that changing) ... [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Observe your enemies, for they first find out your faults. -- Antisthenes signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] travis: setup for automated coverity builds
On Thu, Dec 1, 2016 at 1:23 PM Timo Rothenpielerwrote: > Travis can only run scheduled builds daily, weekly or monthly. So we run them daily, and use a bit of logic in the .travis.yml to > cancel out early on 3 days per week. > Nice! Didn't know Travis CI could do this. > --- > .travis.yml | 32 +++- > 1 file changed, 7 insertions(+), 25 deletions(-) > > diff --git a/.travis.yml b/.travis.yml > index e541ee1..abc264a 100644 > --- a/.travis.yml > +++ b/.travis.yml > @@ -1,26 +1,8 @@ > -language: c > -sudo: false > -os: > - - linux > - - osx > -addons: > - apt: > -packages: > - - yasm > - - diffutils > -compiler: > - - clang > - - gcc > -cache: > - directories: > -- ffmpeg-samples > -before_install: > - - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update --all; fi > -install: > - - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install yasm; fi > +sudo: required > +services: > + - docker > script: > - - mkdir -p ffmpeg-samples > - - ./configure --samples=ffmpeg-samples --cc=$CC > - - make -j 8 > - - make fate-rsync > - - make check -j 8 > +- DOW="$(date "+%u")" > +- for d in 2 4 6; do [[ "$d" == "$DOW" ]] && exit 0; done > +- docker pull ffmpeg/coverity > +- docker run --env COV_EMAIL --env COV_TOKEN ffmpeg/coverity > A few nits: indent the array, just as you did for `services`; the official Travis CI-Coverity bridge uses COVERITY_SCAN_NOTIFICATION_EMAIL and COVERITY_SCAN_TOKEN, so for consistency you might want to change that. Another thing is that currently https://github.com/BtbN/FFmpeg-Coverity (the source of "ffmpeg/coverity" image) belongs to your GitHub account. Maybe we should think of transferring that to github.com/FFmpeg? I also have a few comments on your current build scripts, but we can change those once this patch is in. Timothy ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [DECISION] Revoke the decision of dropping ffserver
On 28.11.2016 19:53, Lou Logan wrote: On Mon, Nov 28, 2016, at 09:15 AM, Nicolas George wrote: ffserver has users I don't know of any. Do you have an estimation of how many users there may be? How much feedback has there been from these alleged users regarding the removal plans? I don't have an estimation, but some time ago I got emails from users directly into my email regarding some issues or asking for help. It was the time when I worked on config stuff of ffserver. I am not albe to tell you if it was 2, 3 or more, but there are some users for sure. Regarding voting I will not vote, but arguing ffserver must be deleted, because it was decided basing on facts that may change soon is funny. Of course it is an important rule of the universe that in regular periods of time very determined person to delete something is spawned (or to block something), but being reasonable is also good rule of thumb :P ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] doc/examples: add fuzz target for individual ffmpeg APIs for in-process fuzzing with libFuzzer, AFL, and similar fuzzing engines.
On Fri, 4 Nov 2016 at 21:41 Michael Niedermayerwrote: > On Fri, Oct 28, 2016 at 11:02:21PM +0200, Michael Niedermayer wrote: > > From: Thomas Garnier > > > > Signed-off-by: Michael Niedermayer > > --- > > doc/examples/decoder_targeted.c | 183 > > > 1 file changed, 183 insertions(+) > > create mode 100644 doc/examples/decoder_targeted.c > > applied > Can this patch cover sliced threads as well? I appreciate a niche feature but we found lots of sliced threads crashes in the past since everyone was fuzzing frame threads. Kieran ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/3] configure: enable autodetected libraries after option parsing
On 02.12.2016 01:05, Hendrik Leppkes wrote: > On Fri, Dec 2, 2016 at 12:27 AM, Andreas Cadhalpun >wrote: >> On 01.12.2016 11:01, Hendrik Leppkes wrote: >>> If those are enabled after option parsing, doesn't this then prevent >>> me from turning them off? >> >> Good catch, they should only be enabled, if they haven't been disabled. >> Updated patch is attached. >> > > I'm not 100% sure, but maybe enable_weak might work? It should only > affect the value if its still entirely unset, which should be what we > want? I tested with --disable-vaapi and enable_weak indeed works. > Would look nicer then the manual loopery. I don't really mind either way, so attached is a patch with enable_weak. Best regards, Andreas >From ab69118d3fe4dc2ee1c0011593ee635739b888a3 Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun Date: Wed, 30 Nov 2016 23:49:35 +0100 Subject: [PATCH 2/3] configure: enable autodetected libraries after option parsing And only enable them, if they haven't been disabled. This is needed for the following patch. Signed-off-by: Andreas Cadhalpun --- configure | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 2ce7555..7c425e8 100755 --- a/configure +++ b/configure @@ -3237,15 +3237,6 @@ enable valgrind_backtrace sws_max_filter_size_default=256 set_default sws_max_filter_size -# Enable platform codecs by default. -enable audiotoolbox - -# Enable hwaccels by default. -enable d3d11va dxva2 vaapi vda vdpau videotoolbox_hwaccel xvmc -enable xlib - -enable cuda cuvid nvenc vda_framework videotoolbox videotoolbox_encoder - # build settings SHFLAGS='-shared -Wl,-soname,$$(@F)' LIBPREF="lib" @@ -3491,6 +3482,15 @@ for e in $env; do eval "export $e" done +# Enable platform codecs by default. +enable_weak audiotoolbox + +# Enable hwaccels by default. +enable_weak d3d11va dxva2 vaapi vda vdpau videotoolbox_hwaccel xvmc +enable_weak xlib + +enable_weak cuda cuvid nvenc vda_framework videotoolbox videotoolbox_encoder + disabled logging && logfile=/dev/null # Disable all the library-specific components if the library itself -- 2.10.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/3] configure: enable autodetected libraries after option parsing
On Fri, Dec 2, 2016 at 12:27 AM, Andreas Cadhalpunwrote: > On 01.12.2016 11:01, Hendrik Leppkes wrote: >> If those are enabled after option parsing, doesn't this then prevent >> me from turning them off? > > Good catch, they should only be enabled, if they haven't been disabled. > Updated patch is attached. > I'm not 100% sure, but maybe enable_weak might work? It should only affect the value if its still entirely unset, which should be what we want? Would look nicer then the manual loopery. - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavf/mov: Accept multiple fourcc for AVID 1:1
On Fri, 2 Dec 2016 00:40:02 +0100 Carl Eugen Hoyoswrote: > 2016-12-01 19:58 GMT+01:00 compn : > > > if (codec_tag && > > (codec_tag != format && > > + (codec_tag != AV_RL32("AV1x") || format != > > AV_RL32("AVup")) && // prores is allowed to have differing data > > format and codec tag codec_tag != AV_RL32("apcn") && codec_tag != > > AV_RL32("apch") && // so is dv (sigh) > > > > what about adding a comment like the prores/dv comments? > > How should the comment look like? // Avid codecs create different format and codec tags no idea. -compn ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/6] tests/ffserver.regression.ref: Update ffserver checksums
On 01.12.2016 17:37, Michael Niedermayer wrote: > They have changed due to 122190392b297b7cd9783641d880df887fd80d07 > > Signed-off-by: Michael Niedermayer> --- > tests/ffserver.regression.ref | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tests/ffserver.regression.ref b/tests/ffserver.regression.ref > index 3106f85..398c285 100644 > --- a/tests/ffserver.regression.ref > +++ b/tests/ffserver.regression.ref > @@ -1,5 +1,5 @@ > -233020d119085ba47535d5f2faf73cc0 *ff-test_h.avi > -431b75d1f12cb039acebad61a3d39225 *ff-test_l.avi > +0c9639f09decbc54c9f091dcf1ca0e8f *ff-test_h.avi > +e28ba75853caf975e06d92955c9f7f73 *ff-test_l.avi > a767dbdf5d1bded3450279f812f97b37 *ff-test.swf > dc16f607e13328a832e73801cd21ec98 *ff-test_h.asf > 69337d6c8cd7ac7e626338decdbf41d3 *ff-test_l.asf The test is unfortunately not very reproducible. Right now I'm getting varying values like on one run: -0c9639f09decbc54c9f091dcf1ca0e8f *ff-test_h.avi -e28ba75853caf975e06d92955c9f7f73 *ff-test_l.avi -a767dbdf5d1bded3450279f812f97b37 *ff-test.swf +81c49d1bfcd43bcc43aa6aeed081126f *ff-test_h.avi +2d642fbb77276ed1d12bf235a6a6bd57 *ff-test_l.avi +daeee6c1418c5b2dcddded9b659e9fc2 *ff-test.swf And on the next: -0c9639f09decbc54c9f091dcf1ca0e8f *ff-test_h.avi -e28ba75853caf975e06d92955c9f7f73 *ff-test_l.avi +5e7fc3d0b2f4866866ae4f268dc431ca *ff-test_h.avi +6cc80ab0caec9499d1b82cd01fe7a861 *ff-test_l.avi I've no idea what the underlying problem is. Best regards, Andreas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/6] avcodec/h264: mmx2, sse2, avx 10-bit h chroma deblock/loop filter
On 2016-12-02 00:31, Carl Eugen Hoyos wrote: > 2016-12-01 17:57 GMT+01:00 James Darnley: >> Yorkfield: >> - mmx2: 2.44x faster (278 vs. 114 cycles) >> - sse2: 3.35x faster (278 vs. 83 cycles) >> >> Skylake: >> - mmx2: 1.69x faster (169 vs. 100 cycles) >> - sse2: 2.34x faster (169 vs. 72 cycles) > > Is it expected (or possible) that the speed impact is so > different for different Intel hardware? Yes. Intel's Core branded processors introduced a much better micro-architecture (the generation after the Yorkfield) which will cause the scalar C code to be quite a bit faster. The SIMD on the other hand was already so quick it didn't gain much. (At least I think I remember this being the story.) >> - avx: 2.32x faster (169 vs. 73 cycles) > > Don't you agree that if this is true (I don't know if it is) > the patch should not be applied as is? I do agree and I wouldn't (deliberately) apply anything that made the decoder slower, or not as fast as it could be. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/6] avcodec/h264: mmx2, sse2, avx 10-bit h chroma deblock/loop filter
On 2016-12-01 23:16, Michael Niedermayer wrote: > On Thu, Dec 01, 2016 at 05:57:44PM +0100, James Darnley wrote: >> Yorkfield: >> - mmx2: 2.44x faster (278 vs. 114 cycles) >> - sse2: 3.35x faster (278 vs. 83 cycles) >> >> Skylake: >> - mmx2: 1.69x faster (169 vs. 100 cycles) >> - sse2: 2.34x faster (169 vs. 72 cycles) >> - avx: 2.32x faster (169 vs. 73 cycles) >> --- >> libavcodec/x86/h264_deblock_10bit.asm | 118 >> ++ >> libavcodec/x86/h264dsp_init.c | 9 +++ >> 2 files changed, 127 insertions(+) > > breaks build on linux x86-32 > > YASMlibavcodec/x86/h264_deblock_10bit.o > src/libavcodec/x86/h264_deblock_10bit.asm:1039: warning: `bpl' is a register > in 64-bit mode > src/libavcodec/x86/h264_deblock_10bit.asm:1039: error: undefined symbol `bpl' > (first use) > src/libavcodec/x86/h264_deblock_10bit.asm:1039: error: (Each undefined > symbol is reported only once.) > src/libavcodec/x86/h264_deblock_10bit.asm:1039: warning: `bpl' is a register > in 64-bit mode Ah. I shouldn't do clever things like trying to use the byte-sized registers. It isn't needed and causes problems like this. Changed locally. Also changed in the 4:2:0 chroma intra patch. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/3] configure: fail if autodetect-libraries are requested but not found
On 01.12.2016 01:34, Michael Niedermayer wrote: > On Thu, Dec 01, 2016 at 12:22:50AM +0100, Andreas Cadhalpun wrote: >> @@ -6381,6 +6410,11 @@ for thread in $THREADS_LIST; do >> fi >> done >> >> +# Check if requested libraries were found. >> +for lib in $AUTODETECT_LIBS; do >> +requested $lib && ! enabled $lib && die "ERROR: $lib requested but not >> found"; >> +done > > This must be after check_deps as that can disable vaapi I agree, but... > unless i miss something ...it is already after check_deps. ;) > also in the same light i think things like: > > enabled vaapi && > check_lib va/va.h vaInitialize -lva || > disable vaapi > > should disable vaapi through having a entry in vaapi_deps= ... There is already va_va_h in vaapi_deps and I'm not sure, what else you'd like to have there. However, it seems independent of this patch. > And then check_deps should check for requested when disabling things > that way it should be possible to print why something is being disabled > If that works that extra information should be quite usefull More information never hurts, so I added some specific error messages in check_deps. > also off topic but this can eventually be extended to cover more > things than just these libs Possibly. > actually i wanted to cleanup configure and that stuff but > its one of these things that kept sliding down on my todo .. That's probably because as long as configure works a cleanup isn't really important... On 01.12.2016 09:48, Carl Eugen Hoyos wrote: > Needs a Changelog Added, updated patch is attached. > and a NEWS entry. As in "put the Changelog entry on the website"? Fine for me if you think that'd be useful. > Have you tested the patch? Of course, and I made sure that the newly added functionality actually works, however I can't possibly test all combinations of configure options in all sorts of environments for regressions, so help in testing e.g. the more exotic ones would be welcome. > It was tried before and the result were different regressions iirc. Can you provide links to previous attempts and their regressions so that I can make sure they don't happen with my patch? Best regards, Andreas >From 68a5545becacd8c3c9d26b16e2ce9aa236e66d6b Mon Sep 17 00:00:00 2001 From: Andreas CadhalpunDate: Wed, 30 Nov 2016 23:50:17 +0100 Subject: [PATCH 3/3] configure: fail if autodetect-libraries are requested but not found Signed-off-by: Andreas Cadhalpun --- Changelog | 1 + configure | 78 +-- 2 files changed, 57 insertions(+), 22 deletions(-) diff --git a/Changelog b/Changelog index 71c9273..21d7ed4 100644 --- a/Changelog +++ b/Changelog @@ -6,6 +6,7 @@ version : - add internal ebur128 library, remove external libebur128 dependency - Pro-MPEG CoP #3-R2 FEC protocol - premultiply video filter +- configure now fails if autodetect-libraries are requested but not found version 3.2: - libopenmpt demuxer diff --git a/configure b/configure index c0f31a7..2747694 100755 --- a/configure +++ b/configure @@ -597,6 +597,13 @@ popvar(){ done } +request(){ +for var in $*; do +eval ${var}_requested=yes +eval $var= +done +} + enable(){ set_all yes $* } @@ -653,6 +660,11 @@ enable_deep_weak(){ done } +requested(){ +test "${1#!}" = "$1" && op='=' || op=!= +eval test "x\$${1#!}_requested" $op "xyes" +} + enabled(){ test "${1#!}" = "$1" && op='=' || op=!= eval test "x\$${1#!}" $op "xyes" @@ -724,9 +736,9 @@ do_check_deps(){ [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; } [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; } -enabled_all $dep_all || disable $cfg -enabled_any $dep_any || disable $cfg -disabled_any $dep_sel && disable $cfg +enabled_all $dep_all || { disable $cfg && requested $cfg && die "ERROR: $cfg requested, but not all dependencies are satisfied: $dep_all"; } +enabled_any $dep_any || { disable $cfg && requested $cfg && die "ERROR: $cfg requested, but not any dependency is satisfied: $dep_any"; } +disabled_any $dep_sel && { disable $cfg && requested $cfg && die "ERROR: $cfg requested, but some selected dependency is unsatisfied: $dep_sel"; } if enabled $cfg; then enable_deep $dep_sel @@ -1481,10 +1493,25 @@ EXAMPLE_LIST=" transcode_aac_example transcoding_example " +EXTERNAL_AUTODETECT_LIBRARY_LIST=" +bzlib +iconv +libxcb +libxcb_shm +libxcb_shape +libxcb_xfixes +lzma +schannel +sdl +sdl2 +securetransport +xlib +zlib +" EXTERNAL_LIBRARY_LIST=" +$EXTERNAL_AUTODETECT_LIBRARY_LIST avisynth -bzlib chromaprint crystalhd decklink @@ -1492,7 +1519,6 @@ EXTERNAL_LIBRARY_LIST=" gcrypt gmp gnutls -iconv jni
Re: [FFmpeg-devel] [PATCH 2/3] configure: enable autodetected libraries after option parsing
On 01.12.2016 11:01, Hendrik Leppkes wrote: > If those are enabled after option parsing, doesn't this then prevent > me from turning them off? Good catch, they should only be enabled, if they haven't been disabled. Updated patch is attached. Best regards, Andreas >From 88b3c4ffc2b02ca7dad1febda7cd6e3e02b8cf5f Mon Sep 17 00:00:00 2001 From: Andreas CadhalpunDate: Wed, 30 Nov 2016 23:49:35 +0100 Subject: [PATCH 2/3] configure: enable autodetected libraries after option parsing And only enable them, if they haven't been disabled. This is needed for the following patch. Signed-off-by: Andreas Cadhalpun --- configure | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 2ce7555..c0f31a7 100755 --- a/configure +++ b/configure @@ -3237,15 +3237,6 @@ enable valgrind_backtrace sws_max_filter_size_default=256 set_default sws_max_filter_size -# Enable platform codecs by default. -enable audiotoolbox - -# Enable hwaccels by default. -enable d3d11va dxva2 vaapi vda vdpau videotoolbox_hwaccel xvmc -enable xlib - -enable cuda cuvid nvenc vda_framework videotoolbox videotoolbox_encoder - # build settings SHFLAGS='-shared -Wl,-soname,$$(@F)' LIBPREF="lib" @@ -3491,6 +3482,13 @@ for e in $env; do eval "export $e" done +# Enable platform codecs by default. +# Enable hwaccels by default. +for lib in audiotoolbox d3d11va dxva2 vaapi vda vdpau videotoolbox_hwaccel xvmc xlib \ + cuda cuvid nvenc vda_framework videotoolbox videotoolbox_encoder; do +! disabled $lib && enable $lib +done + disabled logging && logfile=/dev/null # Disable all the library-specific components if the library itself -- 2.10.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavf/mov: Accept multiple fourcc for AVID 1:1
2016-12-01 19:58 GMT+01:00 compn: > if (codec_tag && > (codec_tag != format && > + (codec_tag != AV_RL32("AV1x") || format != AV_RL32("AVup")) && >// prores is allowed to have differing data format and codec tag >codec_tag != AV_RL32("apcn") && codec_tag != AV_RL32("apch") && >// so is dv (sigh) > > what about adding a comment like the prores/dv comments? How should the comment look like? Thank you, Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/6] avcodec/h264: mmx2, sse2, avx 10-bit h chroma deblock/loop filter
2016-12-01 17:57 GMT+01:00 James Darnley: > Yorkfield: > - mmx2: 2.44x faster (278 vs. 114 cycles) > - sse2: 3.35x faster (278 vs. 83 cycles) > > Skylake: > - mmx2: 1.69x faster (169 vs. 100 cycles) > - sse2: 2.34x faster (169 vs. 72 cycles) Is it expected (or possible) that the speed impact is so different for different Intel hardware? > - avx: 2.32x faster (169 vs. 73 cycles) Don't you agree that if this is true (I don't know if it is) the patch should not be applied as is? Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Save FFmpeg colorspace info in openh264 video files.
2016-12-01 22:26 GMT+01:00 Gregory J. Wolfe: > +switch (avctx->color_primaries) { > +case AVCOL_PRI_BT709:param.sSpatialLayers[0].uiColorPrimaries > = CP_BT709; break; > +case AVCOL_PRI_UNSPECIFIED: param.sSpatialLayers[0].uiColorPrimaries > = CP_UNDEF; break; [ignore] Please align vertically. [/ignore] Is it possible to convince gmail to always use a fixed-width font? The patch looks ugly here on gmail but I suspect it was aligned nicely... Thank you, Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/6] tests/ffserver.regression.ref: Update ffserver checksums
On Thu, Dec 01, 2016 at 01:41:40PM -0800, Reynaldo H. Verdejo Pinochet wrote: > Good to go patch applied thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB It is what and why we do it that matters, not just one of them. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Define ETIMEDOUT in fifo_muxer.c for MinGW/Windows fate build.
On Thu, Dec 01, 2016 at 01:35:02PM -0500, Gregory J. Wolfe wrote: > Now includes libavformat/network.h to define ETIMEDOUT. > > Signed-off-by: Gregory J. Wolfe> --- > libavformat/tests/fifo_muxer.c | 1 + > 1 file changed, 1 insertion(+) applied thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Many things microsoft did are stupid, but not doing something just because microsoft did it is even more stupid. If everything ms did were stupid they would be bankrupt already. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/6] avcodec/h264: mmx2, sse2, avx 10-bit h chroma deblock/loop filter
On Thu, Dec 01, 2016 at 05:57:44PM +0100, James Darnley wrote: > Yorkfield: > - mmx2: 2.44x faster (278 vs. 114 cycles) > - sse2: 3.35x faster (278 vs. 83 cycles) > > Skylake: > - mmx2: 1.69x faster (169 vs. 100 cycles) > - sse2: 2.34x faster (169 vs. 72 cycles) > - avx: 2.32x faster (169 vs. 73 cycles) > --- > libavcodec/x86/h264_deblock_10bit.asm | 118 > ++ > libavcodec/x86/h264dsp_init.c | 9 +++ > 2 files changed, 127 insertions(+) breaks build on linux x86-32 YASMlibavcodec/x86/h264_deblock_10bit.o src/libavcodec/x86/h264_deblock_10bit.asm:1039: warning: `bpl' is a register in 64-bit mode src/libavcodec/x86/h264_deblock_10bit.asm:1039: error: undefined symbol `bpl' (first use) src/libavcodec/x86/h264_deblock_10bit.asm:1039: error: (Each undefined symbol is reported only once.) src/libavcodec/x86/h264_deblock_10bit.asm:1039: warning: `bpl' is a register in 64-bit mode [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB In a rich man's house there is no place to spit but his face. -- Diogenes of Sinope signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/6] tests/ffserver.regression.ref: Update ffserver checksums
Good to go On 12/01/2016 08:37 AM, Michael Niedermayer wrote: They have changed due to 122190392b297b7cd9783641d880df887fd80d07 Signed-off-by: Michael Niedermayer--- tests/ffserver.regression.ref | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ffserver.regression.ref b/tests/ffserver.regression.ref index 3106f85..398c285 100644 --- a/tests/ffserver.regression.ref +++ b/tests/ffserver.regression.ref @@ -1,5 +1,5 @@ -233020d119085ba47535d5f2faf73cc0 *ff-test_h.avi -431b75d1f12cb039acebad61a3d39225 *ff-test_l.avi +0c9639f09decbc54c9f091dcf1ca0e8f *ff-test_h.avi +e28ba75853caf975e06d92955c9f7f73 *ff-test_l.avi a767dbdf5d1bded3450279f812f97b37 *ff-test.swf dc16f607e13328a832e73801cd21ec98 *ff-test_h.asf 69337d6c8cd7ac7e626338decdbf41d3 *ff-test_l.asf -- Reynaldo H. Verdejo Pinochet Open Source Group - Samsung Research America ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avfilter: add premultiply filter
On Mon, 28 Nov 2016 19:19:48 +0100 Paul B Maholwrote: > Hi, > > patch attached. This could have documented what operation it actually performs. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avfilter/vf_w3fdif: add >8 but <16 bit support
On 9/11/16, Paul B Maholwrote: > Signed-off-by: Paul B Mahol > --- > libavfilter/vf_w3fdif.c | 134 > --- > libavfilter/w3fdif.h | 5 +- > libavfilter/x86/vf_w3fdif_init.c | 9 +-- > 3 files changed, 133 insertions(+), 15 deletions(-) > ping ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] Save FFmpeg colorspace info in openh264 video files.
As of version 1.6, libopenh264 saves (in the output video file) information about the color primaries, transfer characteristics, and color matrix used when the video pixel data was created. This patch sets the required libopenh264 data structures using the FFmpeg colorspace information so that video players will know how to properly decode video files created using FFmpeg and libopenh264. Signed-off-by: Gregory J. Wolfe--- libavcodec/libopenh264enc.c | 49 + 1 file changed, 49 insertions(+) diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c index e84de27..3b019b8 100644 --- a/libavcodec/libopenh264enc.c +++ b/libavcodec/libopenh264enc.c @@ -205,6 +205,55 @@ FF_ENABLE_DEPRECATION_WARNINGS } } +#if OPENH264_VER_AT_LEAST(1, 6) +// set video signal type information +param.sSpatialLayers[0].bVideoSignalTypePresent = true; +param.sSpatialLayers[0].uiVideoFormat = VF_UNDEF; // default; choices are VF_: COMPONENT, PAL, NTSC, SECAM, MAC, UNDEF +param.sSpatialLayers[0].bFullRange = avctx->color_range == AVCOL_RANGE_JPEG; +param.sSpatialLayers[0].bColorDescriptionPresent = true; +switch (avctx->color_primaries) { +case AVCOL_PRI_BT709:param.sSpatialLayers[0].uiColorPrimaries = CP_BT709; break; +case AVCOL_PRI_UNSPECIFIED: param.sSpatialLayers[0].uiColorPrimaries = CP_UNDEF; break; +case AVCOL_PRI_BT470M: param.sSpatialLayers[0].uiColorPrimaries = CP_BT470M;break; +case AVCOL_PRI_BT470BG: param.sSpatialLayers[0].uiColorPrimaries = CP_BT470BG; break; +case AVCOL_PRI_SMPTE170M:param.sSpatialLayers[0].uiColorPrimaries = CP_SMPTE170M; break; +case AVCOL_PRI_SMPTE240M:param.sSpatialLayers[0].uiColorPrimaries = CP_SMPTE240M; break; +case AVCOL_PRI_FILM: param.sSpatialLayers[0].uiColorPrimaries = CP_FILM; break; +case AVCOL_PRI_BT2020: param.sSpatialLayers[0].uiColorPrimaries = CP_BT2020;break; +default: param.sSpatialLayers[0].uiColorPrimaries = CP_UNDEF; break; +} +switch (avctx->color_trc) { +case AVCOL_TRC_BT709: param.sSpatialLayers[0].uiTransferCharacteristics = TRC_BT709;break; +case AVCOL_TRC_UNSPECIFIED: param.sSpatialLayers[0].uiTransferCharacteristics = TRC_UNDEF;break; +case AVCOL_TRC_GAMMA22: param.sSpatialLayers[0].uiTransferCharacteristics = TRC_BT470M; break; +case AVCOL_TRC_GAMMA28: param.sSpatialLayers[0].uiTransferCharacteristics = TRC_BT470BG; break; +case AVCOL_TRC_SMPTE170M: param.sSpatialLayers[0].uiTransferCharacteristics = TRC_SMPTE170M;break; +case AVCOL_TRC_SMPTE240M: param.sSpatialLayers[0].uiTransferCharacteristics = TRC_SMPTE240M;break; +case AVCOL_TRC_LINEAR: param.sSpatialLayers[0].uiTransferCharacteristics = TRC_LINEAR; break; +case AVCOL_TRC_LOG: param.sSpatialLayers[0].uiTransferCharacteristics = TRC_LOG100; break; +case AVCOL_TRC_LOG_SQRT: param.sSpatialLayers[0].uiTransferCharacteristics = TRC_LOG316; break; +case AVCOL_TRC_IEC61966_2_4: param.sSpatialLayers[0].uiTransferCharacteristics = TRC_IEC61966_2_4; break; +case AVCOL_TRC_BT1361_ECG: param.sSpatialLayers[0].uiTransferCharacteristics = TRC_BT1361E; break; +case AVCOL_TRC_IEC61966_2_1: param.sSpatialLayers[0].uiTransferCharacteristics = TRC_IEC61966_2_1; break; +case AVCOL_TRC_BT2020_10: param.sSpatialLayers[0].uiTransferCharacteristics = TRC_BT2020_10;break; +case AVCOL_TRC_BT2020_12: param.sSpatialLayers[0].uiTransferCharacteristics = TRC_BT2020_12;break; +default: param.sSpatialLayers[0].uiTransferCharacteristics = TRC_UNDEF;break; +} +switch (avctx->colorspace) { +case AVCOL_SPC_RGB: param.sSpatialLayers[0].uiColorMatrix = CM_GBR; break; +case AVCOL_SPC_BT709:param.sSpatialLayers[0].uiColorMatrix = CM_BT709; break; +case AVCOL_SPC_UNSPECIFIED: param.sSpatialLayers[0].uiColorMatrix = CM_UNDEF; break; +case AVCOL_SPC_FCC: param.sSpatialLayers[0].uiColorMatrix = CM_FCC; break; +case AVCOL_SPC_BT470BG: param.sSpatialLayers[0].uiColorMatrix = CM_BT470BG; break; +case AVCOL_SPC_SMPTE170M:param.sSpatialLayers[0].uiColorMatrix = CM_SMPTE170M; break; +case AVCOL_SPC_SMPTE240M:param.sSpatialLayers[0].uiColorMatrix = CM_SMPTE240M; break; +case AVCOL_SPC_YCOCG:param.sSpatialLayers[0].uiColorMatrix = CM_YCGCO; break; +case AVCOL_SPC_BT2020_NCL: param.sSpatialLayers[0].uiColorMatrix
[FFmpeg-devel] [PATCH] travis: setup for automated coverity builds
Travis can only run scheduled builds daily, weekly or monthly. So we run them daily, and use a bit of logic in the .travis.yml to cancel out early on 3 days per week. --- .travis.yml | 32 +++- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index e541ee1..abc264a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,8 @@ -language: c -sudo: false -os: - - linux - - osx -addons: - apt: -packages: - - yasm - - diffutils -compiler: - - clang - - gcc -cache: - directories: -- ffmpeg-samples -before_install: - - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update --all; fi -install: - - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install yasm; fi +sudo: required +services: + - docker script: - - mkdir -p ffmpeg-samples - - ./configure --samples=ffmpeg-samples --cc=$CC - - make -j 8 - - make fate-rsync - - make check -j 8 +- DOW="$(date "+%u")" +- for d in 2 4 6; do [[ "$d" == "$DOW" ]] && exit 0; done +- docker pull ffmpeg/coverity +- docker run --env COV_EMAIL --env COV_TOKEN ffmpeg/coverity -- 2.8.3 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] ffprobe: Support adding av_log output to frames
On Tue, Jun 14, 2016 at 05:55:47PM +0200, Stefano Sabatini wrote: > On date Wednesday 2016-06-08 18:20:39 +0200, Michael Niedermayer encoded: > > On Sun, Jun 05, 2016 at 12:56:08PM +0200, Stefano Sabatini wrote: > > > On date Tuesday 2016-05-31 21:23:27 +0200, Michael Niedermayer encoded: > > > > adding demuxer and other logs should be easy > > > > This forces single threaded decoding for simplicity > > > > It also requires pthreads, this could be avoided either with > > > > some lockless tricks or simply by assuming av_log would never be called > > > > from > > > > another thread. > > > > > > > > doc/ffprobe.xsd update missing (TODO & help welcome) > > > > > > > > Fixes Ticket5521 [...] > > > I'm not really sure about storing the log in frame, since they could > > > come from any context, not necessarily related to decoding. > > > > > > OTOH, I'm not really sure how such feature could be implemented in a > > > really clean way. > > > > > > About frame decoding errors, we could store an error in the decoded > > > frame itself. > > > > > I dont know what exactly is wanted ? > > > > I mean, we already have the AVFrame.decode_error_flags we could expose > to the user. > > > What i found interresting was to partition all av_log into > > closest related sections like decoder/demuxer/filter/... > > and add them there > > so that detailed information, not limited to errors about frame and > > packet related information can be associated with them > > this patch was just a step toward that > > if that feature isnt wanted we can drop the patch > > I think this patch is interesting, but I don't want to clutter the > code too much, especially if we found a more general design which > could deprecate this one. has anyone found a more general design ? > > The problem with this approach is that the log is contained in the > frame element, when it could come from other parts of the code as > well. when decoding a frame triggers a log message then its caused by the frame. It may come ultimately from the experssion evaluator for example but knowig that the message comes from the experssion evaluator is of little use, a grep would tell one that already. Knowing which frame triggers it seems more usefull to me > > One option could be to define a -show_logs options, and optionally add > a filter specifying the contexts. Just storing the log in the frame > elements sounds a bit weird to me. its certainly possible to extend this patch to also cover demuxer and other areas and then add a -show_logs to select what should be enabled is that what you meant ? it seems thats not a argument against the patch as it is, just something that can be done as additional work afterwards but quite possibly i misunderstand [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Everything should be made as simple as possible, but not simpler. -- Albert Einstein signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] Allow client to enable/disable openh264 load balancing.
The libopenh264 library allows the client to enable or disable load balancing when running multi-threaded. When enabled, the slice sizes are dynamically adjusted in order to use the multiple threads more efficiently. However, this can also lead to valid but slightly different results from run to run. Disabling load balancing prevents dynamic slice adjustment and yields repeatable results when running multi-threaded, which can be important when running test cases. Signed-off-by: Gregory J. Wolfe--- libavcodec/libopenh264enc.c | 8 1 file changed, 8 insertions(+) diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c index 648f59b..e84de27 100644 --- a/libavcodec/libopenh264enc.c +++ b/libavcodec/libopenh264enc.c @@ -47,6 +47,7 @@ typedef struct SVCContext { int skip_frames; int skipped; int cabac; +int load_balancing; } SVCContext; #define OFFSET(x) offsetof(SVCContext, x) @@ -71,6 +72,7 @@ static const AVOption options[] = { { "max_nal_size", "set maximum NAL size in bytes", OFFSET(max_nal_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, { "allow_skip_frames", "allow skipping frames to hit the target bitrate", OFFSET(skip_frames), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { "cabac", "Enable cabac", OFFSET(cabac), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, +{ "load_balancing", "enable/disable dynamic slice adjustment for efficient use of multiple threads; if enabled, can produce valid but slightly different results from run to run", OFFSET(load_balancing), AV_OPT_TYPE_BOOL, { .i64 = -1 }, 0, 1, VE }, { NULL } }; @@ -150,6 +152,12 @@ FF_ENABLE_DEPRECATION_WARNINGS param.iLoopFilterDisableIdc = !s->loopfilter; param.iEntropyCodingModeFlag = 0; param.iMultipleThreadIdc = avctx->thread_count; +#if OPENH264_VER_AT_LEAST(1, 6) +param.bUseLoadBalancing = s->load_balancing; // default is enabled; -1 means not specified by client +#else +if ( s->load_balancing != -1 ) +av_log(avctx, AV_LOG_WARNING, "load_balancing = %d specified, but not supported prior to libopenh264 v1.6\n", s->load_balancing); +#endif if (s->profile && !strcmp(s->profile, "main")) param.iEntropyCodingModeFlag = 1; else if (!s->profile && s->cabac) -- 2.5.1.windows.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] lavu: Add JEDEC P22 color primaries
On Thu, Dec 1, 2016 at 3:01 PM, Nicolas Georgewrote: > Le primidi 11 frimaire, an CCXXV, Vittorio Giovara a écrit : >> Actually we already do, theora, vp8, vp9 and a few others have >> completely different values for most color properties, and we just >> check before initializing the context or frame fields. Since iso/itu >> codecs are the ones that more consistently use all the properties >> everywhere it makes sense that the enum values and field values match >> and imho it's simpler to use. > > It made sense until now, but now they have added a gap, and it becomes > obvious it was not a very good idea to begin with. > > Fortunately, since the architecture is already there for the other > codecs, fixing it should not be much work. Probably about the same > amount as fixing the issues with the gap. I'm not sure about that, right now a gap would just require adding bound checks in exactly 5 different places, whereas restructuring this well-established system will need careful modification for each of the codecs involved, which are quite a few. The real problem to me seems the fact that _NB elements are used outside the library, despite being documented against, so I think it would be more productive to fix those occurrences (especially since this is a user-facing API). -- Vittorio ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] lavu: Add JEDEC P22 color primaries
On Thu, Dec 1, 2016 at 2:22 PM, Nicolas Georgewrote: > Le primidi 11 frimaire, an CCXXV, Rostislav Pehlivanov a écrit : >> Why do you insist on having a hole in the first place? > > Apparently, the values of the enum are used encode and decode > standardized values in standardized formats like MPEG. > > I think this is a terrible design decision, and I would like to suggest > to change it before it is too late. > > It will lead to all kinds of trouble if we want to support primaries > from other standards with conflicting values, or if the standards > introduce huge gaps in their allocated values. Actually we already do, theora, vp8, vp9 and a few others have completely different values for most color properties, and we just check before initializing the context or frame fields. Since iso/itu codecs are the ones that more consistently use all the properties everywhere it makes sense that the enum values and field values match and imho it's simpler to use. -- Vittorio ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] lavu: Add JEDEC P22 color primaries
Le primidi 11 frimaire, an CCXXV, Vittorio Giovara a écrit : > Actually we already do, theora, vp8, vp9 and a few others have > completely different values for most color properties, and we just > check before initializing the context or frame fields. Since iso/itu > codecs are the ones that more consistently use all the properties > everywhere it makes sense that the enum values and field values match > and imho it's simpler to use. It made sense until now, but now they have added a gap, and it becomes obvious it was not a very good idea to begin with. Fortunately, since the architecture is already there for the other codecs, fixing it should not be much work. Probably about the same amount as fixing the issues with the gap. Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] lavu: Add JEDEC P22 color primaries
Le primidi 11 frimaire, an CCXXV, Rostislav Pehlivanov a écrit : > Why do you insist on having a hole in the first place? Apparently, the values of the enum are used encode and decode standardized values in standardized formats like MPEG. I think this is a terrible design decision, and I would like to suggest to change it before it is too late. It will lead to all kinds of trouble if we want to support primaries from other standards with conflicting values, or if the standards introduce huge gaps in their allocated values. The correct way of dealing with that kind of situation is the same as what we have always done for 4CCs: have tables (or other kinds of conversion functions) matching the value of the enum in our API with the value for a corresponding standard. The name of the table must include the name of the standard. Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] lavu: Add JEDEC P22 color primaries
On 1 December 2016 at 17:25, Vittorio Giovarawrote: > On Wed, Nov 30, 2016 at 5:48 PM, Ronald S. Bultje > wrote: > > Hi, > > > > On Wed, Nov 30, 2016 at 5:26 PM, Andreas Cadhalpun > > wrote: > >> > >> On 30.11.2016 22:55, Ronald S. Bultje wrote: > >> > On Wed, Nov 30, 2016 at 4:51 PM, Andreas Cadhalpun < > >> > andreas.cadhal...@googlemail.com> wrote: > >> > > >> >> On 30.11.2016 19:16, Vittorio Giovara wrote: > >> >> You can't just add a gap like that. > >> >> The current code assumes that the numbers are consecutive, like e.g. > >> >> the > >> >> naming of AVCOL_PRI_NB suggests. > >> > > >> > > >> > No, we've had gaps in these before. > >> > >> In AVColorPrimaries? > > > > > > I seemed to remember, looked it up and appeared to be wrong, so scrap > that > > :) > > Ok, so I can take care of the "holes" this patch would bring for lavc, > would anybody help me with the remaining occurrences (namely in lavf > and lavfi)? > -- Why do you insist on having a hole in the first place? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] ffserver: set format bitexact flag, eliminate warnings about it not being set
On Thu, Dec 01, 2016 at 09:43:34AM -0800, Reynaldo H. Verdejo Pinochet wrote: > Looks good & works correctly Michael. Please feel free to push. Thank you. applied thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Old school: Use the lowest level language in which you can solve the problem conveniently. New school: Use the highest level language in which the latest supercomputer can solve the problem without the user falling asleep waiting. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavf/mov: Accept multiple fourcc for AVID 1:1
On Tue, 29 Nov 2016 22:10:47 +0100 Carl Eugen Hoyoswrote: > From add7f5d51491152af6d0431331543212c2c21ca4 Mon Sep 17 00:00:00 2001 > From: Carl Eugen Hoyos > Date: Tue, 29 Nov 2016 22:09:21 +0100 > Subject: [PATCH] lavf/mov: Accept multiple fourcc for AVID 1:1. > > Fixes ticket #5982. > --- > libavformat/mov.c |1 + > 1 file changed, 1 insertion(+) if (codec_tag && (codec_tag != format && + (codec_tag != AV_RL32("AV1x") || format != AV_RL32("AVup")) && // prores is allowed to have differing data format and codec tag codec_tag != AV_RL32("apcn") && codec_tag != AV_RL32("apch") && // so is dv (sigh) what about adding a comment like the prores/dv comments? (or in a separate patch, make a nicer comment for prores,avid and dv?) there are more than just these two AVID isoms. a quick search reveals... 'AV1X': 'Avid 1:1x (Quick Time)', 'AVD1': 'Avid DV (Quick Time)', 'AVDN': 'Avid DNxHD (Quick Time)', 'AVMP': 'Avid IMX (Quick Time)', 'AVUP': 'Avid 10bit Packed (Quick Time)', possibly AVin sample here : http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket524/AVCI50.mov do any of these isoms need to be added to the list in mov.c ? otherwise, looks ok if tested with our av1x/avup samples. thanks, -compn ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Please tell me if following scenario is possible while using FFmpeg
On Thu, Dec 1, 2016, at 01:56 AM, Adeel Nazir wrote: > I'm opencv image processing developer. i'm developing c++ application in > which i'm recieving rtsp stream and then i want to create another Public > rtsp url that stream audio and video through ffmpeg c++ code. > what i'm doing: i recieve AVStream and i convert avframe to opencv Mat > and > do some process on image and convert image back to AVFrame but > issue is, now what to do next i could not write avframe over rtsp. > > please tell me if there exist any help. > > also tell me how to create rtsp public URL > > waiting for your reply :) Wrong mailing list. ffmpeg-devel is only for patch submissions and discussions related to the development of FFmpeg. Questions involving the FFmpeg command-line interface tools should be asked at the ffmpeg-user mailing list. Questions involving the FFmpeg libraries should be asked at the libav-user mailing list. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] Define ETIMEDOUT in fifo_muxer.c for MinGW/Windows fate build.
Now includes libavformat/network.h to define ETIMEDOUT. Signed-off-by: Gregory J. Wolfe--- libavformat/tests/fifo_muxer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/tests/fifo_muxer.c b/libavformat/tests/fifo_muxer.c index 9659198..dc62965 100644 --- a/libavformat/tests/fifo_muxer.c +++ b/libavformat/tests/fifo_muxer.c @@ -25,6 +25,7 @@ #include "libavutil/avassert.h" #include "libavformat/avformat.h" #include "libavformat/url.h" +#include "libavformat/network.h" #define MAX_TST_PACKETS 128 #define SLEEPTIME_50_MS 5 -- 2.5.1.windows.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] Please tell me if following scenario is possible while using FFmpeg
I'm opencv image processing developer. i'm developing c++ application in which i'm recieving rtsp stream and then i want to create another Public rtsp url that stream audio and video through ffmpeg c++ code. what i'm doing: i recieve AVStream and i convert avframe to opencv Mat and do some process on image and convert image back to AVFrame but issue is, now what to do next i could not write avframe over rtsp. please tell me if there exist any help. also tell me how to create rtsp public URL waiting for your reply :) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] ffserver: set format bitexact flag, eliminate warnings about it not being set
Michael Niedermayer wrote: >+ >+if (src->codec->flags & AV_CODEC_FLAG_BITEXACT) >+c->pfmt_ctx->flags |= AVFMT_FLAG_BITEXACT; Works fine here. Best regards, Reto ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] ffserver: set format bitexact flag, eliminate warnings about it not being set
Looks good & works correctly Michael. Please feel free to push. Thank you. On 12/01/2016 09:02 AM, Michael Niedermayer wrote: if (src->codec->flags & AV_CODEC_FLAG_BITEXACT) +c->pfmt_ctx->flags |= AVFMT_FLAG_BITEXACT; -- Reynaldo H. Verdejo Pinochet Open Source Group - Samsung Research America ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] lavu: Add JEDEC P22 color primaries
On Wed, Nov 30, 2016 at 5:48 PM, Ronald S. Bultjewrote: > Hi, > > On Wed, Nov 30, 2016 at 5:26 PM, Andreas Cadhalpun > wrote: >> >> On 30.11.2016 22:55, Ronald S. Bultje wrote: >> > On Wed, Nov 30, 2016 at 4:51 PM, Andreas Cadhalpun < >> > andreas.cadhal...@googlemail.com> wrote: >> > >> >> On 30.11.2016 19:16, Vittorio Giovara wrote: >> >> You can't just add a gap like that. >> >> The current code assumes that the numbers are consecutive, like e.g. >> >> the >> >> naming of AVCOL_PRI_NB suggests. >> > >> > >> > No, we've had gaps in these before. >> >> In AVColorPrimaries? > > > I seemed to remember, looked it up and appeared to be wrong, so scrap that > :) Ok, so I can take care of the "holes" this patch would bring for lavc, would anybody help me with the remaining occurrences (namely in lavf and lavfi)? -- Vittorio ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 3/6] whitespace changes after last commit
--- libavcodec/x86/h264dsp_init.c | 44 +-- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c index 3d35f59..ab270da 100644 --- a/libavcodec/x86/h264dsp_init.c +++ b/libavcodec/x86/h264dsp_init.c @@ -108,34 +108,34 @@ void ff_deblock_ ## DIR ## _ ## TYPE ## _ ## DEPTH ## _ ## OPT(uint8_t *pix, \ int beta); #define LF_FUNCS(type, depth) \ -LF_FUNC(h, chroma, depth, mmxext)\ -LF_IFUNC(h, chroma_intra, depth, mmxext)\ +LF_FUNC(h, chroma, depth, mmxext) \ +LF_IFUNC(h, chroma_intra,depth, mmxext) \ LF_FUNC(h, chroma422, depth, mmxext) \ LF_IFUNC(h, chroma422_intra, depth, mmxext) \ -LF_FUNC(v, chroma, depth, mmxext)\ -LF_IFUNC(v, chroma_intra, depth, mmxext)\ -LF_FUNC(h, luma, depth, mmxext)\ -LF_IFUNC(h, luma_intra, depth, mmxext)\ -LF_FUNC(h, luma, depth, sse2) \ -LF_IFUNC(h, luma_intra, depth, sse2) \ -LF_FUNC(v, luma, depth, sse2) \ -LF_IFUNC(v, luma_intra, depth, sse2) \ -LF_FUNC(h, chroma, depth, sse2) \ -LF_IFUNC(h, chroma_intra, depth, sse2) \ +LF_FUNC(v, chroma, depth, mmxext) \ +LF_IFUNC(v, chroma_intra,depth, mmxext) \ +LF_FUNC(h, luma,depth, mmxext) \ +LF_IFUNC(h, luma_intra, depth, mmxext) \ +LF_FUNC(h, luma,depth, sse2) \ +LF_IFUNC(h, luma_intra, depth, sse2) \ +LF_FUNC(v, luma,depth, sse2) \ +LF_IFUNC(v, luma_intra, depth, sse2) \ +LF_FUNC(h, chroma, depth, sse2) \ +LF_IFUNC(h, chroma_intra,depth, sse2) \ LF_FUNC(h, chroma422, depth, sse2) \ LF_IFUNC(h, chroma422_intra, depth, sse2) \ -LF_FUNC(v, chroma, depth, sse2) \ -LF_IFUNC(v, chroma_intra, depth, sse2) \ -LF_FUNC(h, luma, depth, avx) \ -LF_IFUNC(h, luma_intra, depth, avx) \ -LF_FUNC(v, luma, depth, avx) \ -LF_IFUNC(v, luma_intra, depth, avx) \ -LF_FUNC(h, chroma, depth, avx) \ -LF_IFUNC(h, chroma_intra, depth, avx) \ +LF_FUNC(v, chroma, depth, sse2) \ +LF_IFUNC(v, chroma_intra,depth, sse2) \ +LF_FUNC(h, luma,depth, avx)\ +LF_IFUNC(h, luma_intra, depth, avx)\ +LF_FUNC(v, luma,depth, avx)\ +LF_IFUNC(v, luma_intra, depth, avx)\ +LF_FUNC(h, chroma, depth, avx)\ +LF_IFUNC(h, chroma_intra,depth, avx)\ LF_FUNC(h, chroma422, depth, avx)\ LF_IFUNC(h, chroma422_intra, depth, avx)\ -LF_FUNC(v, chroma, depth, avx) \ -LF_IFUNC(v, chroma_intra, depth, avx) +LF_FUNC(v, chroma, depth, avx)\ +LF_IFUNC(v, chroma_intra,depth, avx) LF_FUNCS(uint8_t, 8) LF_FUNCS(uint16_t, 10) -- 2.10.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 5/6] avcodec/h264: mmx2, sse2, avx 10-bit h chroma intra deblock/loop filter
Yorkfield: - mmx2: 0.99x faster (180 vs. 181 cycles) - sse2: 1.05x faster (180 vs. 170 cycles) Skylake: - mmx2: 1.21x faster (125 vs. 103 cycles) - sse2: 1.54x faster (125 vs. 81 cycles) - avx: 1.29x faster (125 vs. 97 cycles) --- libavcodec/x86/h264_deblock_10bit.asm | 29 + libavcodec/x86/h264dsp_init.c | 3 +++ 2 files changed, 32 insertions(+) diff --git a/libavcodec/x86/h264_deblock_10bit.asm b/libavcodec/x86/h264_deblock_10bit.asm index 4c1dc6a..fb10bfb 100644 --- a/libavcodec/x86/h264_deblock_10bit.asm +++ b/libavcodec/x86/h264_deblock_10bit.asm @@ -1071,6 +1071,35 @@ cglobal deblock_h_chroma422_10, 5, 7, 8, 3*mmsize, pix_, stride_, alpha_, beta_, jl .loop RET +;- +; void ff_deblock_h_chroma_intra_10(uint16_t *pix, int stride, int alpha, +; int beta) +;- +cglobal deblock_h_chroma_intra_10, 4, 6, 8, 2*mmsize, pix_, stride_, alpha_, beta_ +shl alpha_d, 2 +shl beta_d, 2 +mov r4, pix_q +lea r5, [3*stride_q] +add r4, r5 +%if mmsize == 8 +mov r5b, 2 +.loop: +%endif + +CHROMA_H_LOAD r4, r5, [rsp], [rsp + mmsize] +LOAD_AB m4, m5, alpha_d, beta_d +LOAD_MASK m0, m1, m2, m3, m4, m5, m7, m6, m4 +CHROMA_DEBLOCK_P0_Q0_INTRA m1, m2, m0, m3, m7, m5, m6 +CHROMA_H_STORE r4, r5, [rsp], [rsp + mmsize] + +%if mmsize == 8 +lea pix_q, [pix_q + 4*stride_q] +lea r4,[r4 + 4*stride_q] +dec r5b +jg .loop +%endif +RET + %endmacro %if ARCH_X86_64 == 0 diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c index 7b3d17f..395b8c3 100644 --- a/libavcodec/x86/h264dsp_init.c +++ b/libavcodec/x86/h264dsp_init.c @@ -315,6 +315,7 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_mmxext; if (chroma_format_idc <= 1) { c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_10_mmxext; +c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma_intra_10_mmxext; } else { c->h264_h_loop_filter_chroma = ff_deblock_h_chroma422_10_mmxext; } @@ -353,6 +354,7 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_sse2; if (chroma_format_idc <= 1) { c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_10_sse2; +c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma_intra_10_sse2; } else { c->h264_h_loop_filter_chroma = ff_deblock_h_chroma422_10_sse2; } @@ -393,6 +395,7 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_avx; if (chroma_format_idc <= 1) { c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_10_avx; +c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma_intra_10_avx; } else { c->h264_h_loop_filter_chroma = ff_deblock_h_chroma422_10_avx; } -- 2.10.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 4/6] avcodec/h264: mmx2, sse2, avx 10-bit 4:2:2 h chroma deblock/loop filter
Yorkfield: - mmx2: 2.54x faster (500 vs. 197 cycles) - sse2: 3.82x faster (500 vs. 131 cycles) Skylake: - mmx2: 1.80x faster (317 vs. 176 cycles) - sse2: 2.81x faster (317 vs. 113 cycles) - avx: 2.85x faster (317 vs. 111 cycles) --- libavcodec/x86/h264_deblock_10bit.asm | 39 +++ libavcodec/x86/h264dsp_init.c | 6 ++ 2 files changed, 45 insertions(+) diff --git a/libavcodec/x86/h264_deblock_10bit.asm b/libavcodec/x86/h264_deblock_10bit.asm index e91b1c6..4c1dc6a 100644 --- a/libavcodec/x86/h264_deblock_10bit.asm +++ b/libavcodec/x86/h264_deblock_10bit.asm @@ -1032,6 +1032,45 @@ cglobal deblock_h_chroma_10, 5, 7, 8, 2*mmsize, pix_, stride_, alpha_, beta_, tc %endif RET +;- +; void ff_deblock_h_chroma422_10(uint16_t *pix, int stride, int alpha, int beta, +;int8_t *tc0) +;- +cglobal deblock_h_chroma422_10, 5, 7, 8, 3*mmsize, pix_, stride_, alpha_, beta_, tc0_ +shl alpha_d, 2 +shl beta_d, 2 + +movd m0, [tc0_q] +punpcklbw m0, m0 +psraw m0, 6 +movq [rsp], m0 + +mov r5, pix_q +lea r6, [3*stride_q] +add r5, r6 + +mov r4, -8 +.loop: + +CHROMA_H_LOAD r5, r6, [rsp + 1*mmsize], [rsp + 2*mmsize] +LOAD_AB m4, m5, alpha_d, beta_d +LOAD_MASKm0, m1, m2, m3, m4, m5, m7, m6, m4 +pxor m4, m4 +movd m6, [rsp + r4 + 8] +punpcklwdm6, m6 +punpcklwdm6, m6 +psubwm6, [pw_3] +pmaxsw m6, m4 +pand m7, m6 +DEBLOCK_P0_Q0m1, m2, m0, m3, m7, m5, m6 +CHROMA_H_STORE r5, r6, [rsp + 1*mmsize], [rsp + 2*mmsize] + +lea pix_q, [pix_q + (mmsize/2)*stride_q] +lea r5,[r5 +(mmsize/2)*stride_q] +add r4, (mmsize/4) +jl .loop +RET + %endmacro %if ARCH_X86_64 == 0 diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c index ab270da..7b3d17f 100644 --- a/libavcodec/x86/h264dsp_init.c +++ b/libavcodec/x86/h264dsp_init.c @@ -315,6 +315,8 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_mmxext; if (chroma_format_idc <= 1) { c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_10_mmxext; +} else { +c->h264_h_loop_filter_chroma = ff_deblock_h_chroma422_10_mmxext; } c->h264_v_loop_filter_luma = ff_deblock_v_luma_10_mmxext; c->h264_h_loop_filter_luma = ff_deblock_h_luma_10_mmxext; @@ -351,6 +353,8 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_sse2; if (chroma_format_idc <= 1) { c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_10_sse2; +} else { +c->h264_h_loop_filter_chroma = ff_deblock_h_chroma422_10_sse2; } #if HAVE_ALIGNED_STACK c->h264_v_loop_filter_luma = ff_deblock_v_luma_10_sse2; @@ -389,6 +393,8 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_avx; if (chroma_format_idc <= 1) { c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_10_avx; +} else { +c->h264_h_loop_filter_chroma = ff_deblock_h_chroma422_10_avx; } #if HAVE_ALIGNED_STACK c->h264_v_loop_filter_luma = ff_deblock_v_luma_10_avx; -- 2.10.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] ffserver: set format bitexact flag, eliminate warnings about it not being set
Signed-off-by: Michael Niedermayer--- ffserver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ffserver.c b/ffserver.c index 4e5ce1f..19c3ced 100644 --- a/ffserver.c +++ b/ffserver.c @@ -2323,6 +2323,9 @@ static int http_prepare_data(HTTPContext *c) unlayer_stream(c->pfmt_ctx->streams[i], src); //TODO we no longer copy st->internal, does this matter? av_assert0(!c->pfmt_ctx->streams[i]->priv_data); + +if (src->codec->flags & AV_CODEC_FLAG_BITEXACT) +c->pfmt_ctx->flags |= AVFMT_FLAG_BITEXACT; } /* set output format parameters */ c->pfmt_ctx->oformat = c->stream->fmt; -- 2.10.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/6] avcodec/h264: clean up and expand x86 function definitions
--- libavcodec/x86/h264dsp_init.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c index c568762..3d35f59 100644 --- a/libavcodec/x86/h264dsp_init.c +++ b/libavcodec/x86/h264dsp_init.c @@ -110,6 +110,8 @@ void ff_deblock_ ## DIR ## _ ## TYPE ## _ ## DEPTH ## _ ## OPT(uint8_t *pix, \ #define LF_FUNCS(type, depth) \ LF_FUNC(h, chroma, depth, mmxext)\ LF_IFUNC(h, chroma_intra, depth, mmxext)\ +LF_FUNC(h, chroma422, depth, mmxext) \ +LF_IFUNC(h, chroma422_intra, depth, mmxext) \ LF_FUNC(v, chroma, depth, mmxext)\ LF_IFUNC(v, chroma_intra, depth, mmxext)\ LF_FUNC(h, luma, depth, mmxext)\ @@ -120,6 +122,8 @@ LF_FUNC(v, luma, depth, sse2) \ LF_IFUNC(v, luma_intra, depth, sse2) \ LF_FUNC(h, chroma, depth, sse2) \ LF_IFUNC(h, chroma_intra, depth, sse2) \ +LF_FUNC(h, chroma422, depth, sse2) \ +LF_IFUNC(h, chroma422_intra, depth, sse2) \ LF_FUNC(v, chroma, depth, sse2) \ LF_IFUNC(v, chroma_intra, depth, sse2) \ LF_FUNC(h, luma, depth, avx) \ @@ -128,15 +132,14 @@ LF_FUNC(v, luma, depth, avx) \ LF_IFUNC(v, luma_intra, depth, avx) \ LF_FUNC(h, chroma, depth, avx) \ LF_IFUNC(h, chroma_intra, depth, avx) \ +LF_FUNC(h, chroma422, depth, avx)\ +LF_IFUNC(h, chroma422_intra, depth, avx)\ LF_FUNC(v, chroma, depth, avx) \ LF_IFUNC(v, chroma_intra, depth, avx) LF_FUNCS(uint8_t, 8) LF_FUNCS(uint16_t, 10) -void ff_deblock_h_chroma422_8_mmxext(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0); -LF_IFUNC(h, chroma422_intra, 8, mmxext) - #if ARCH_X86_32 && HAVE_MMXEXT_EXTERNAL LF_FUNC(v8, luma, 8, mmxext) static void deblock_v_luma_8_mmxext(uint8_t *pix, int stride, int alpha, -- 2.10.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 0/6] More H.264 assembly (the sequel)
Some more assembly for review. This time we have 10-bit h chroma functions. The intra ones have some strange benchmark results. Overall the improvement isn't that large, particularly for the 4:2:0 intra. And for the avx version of that function it is slower than the sse2, by quite a margin. I will definitely try benchmarking it on my Nehalem after sending these emails. Suggestions greatly appreciated. James Darnley (6): avcodec/h264: mmx2, sse2, avx 10-bit h chroma deblock/loop filter avcodec/h264: clean up and expand x86 function definitions whitespace changes after last commit avcodec/h264: mmx2, sse2, avx 10-bit 4:2:2 h chroma deblock/loop filter avcodec/h264: mmx2, sse2, avx 10-bit h chroma intra deblock/loop filter avcodec/h264: mmx2, sse2, avx 10-bit 4:2:2 h chroma intra deblock/loop filter libavcodec/x86/h264_deblock_10bit.asm | 213 ++ libavcodec/x86/h264dsp_init.c | 74 2 files changed, 262 insertions(+), 25 deletions(-) -- 2.10.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/6] avcodec/h264: mmx2, sse2, avx 10-bit h chroma deblock/loop filter
Yorkfield: - mmx2: 2.44x faster (278 vs. 114 cycles) - sse2: 3.35x faster (278 vs. 83 cycles) Skylake: - mmx2: 1.69x faster (169 vs. 100 cycles) - sse2: 2.34x faster (169 vs. 72 cycles) - avx: 2.32x faster (169 vs. 73 cycles) --- libavcodec/x86/h264_deblock_10bit.asm | 118 ++ libavcodec/x86/h264dsp_init.c | 9 +++ 2 files changed, 127 insertions(+) diff --git a/libavcodec/x86/h264_deblock_10bit.asm b/libavcodec/x86/h264_deblock_10bit.asm index ebf8a3f..e91b1c6 100644 --- a/libavcodec/x86/h264_deblock_10bit.asm +++ b/libavcodec/x86/h264_deblock_10bit.asm @@ -843,6 +843,88 @@ DEBLOCK_LUMA_INTRA mova [r0+2*r1], m2 %endmacro +; expands to [base],...,[base+7*stride] +%define PASS8ROWS(base, base3, stride, stride3) \ +[base], [base+stride], [base+stride*2], [base3], \ +[base3+stride], [base3+stride*2], [base3+stride3], [base3+stride*4] + +; in: 8 rows of 4 words in %4..%11 +; out: 4 rows of 8 words in m0..m3 +%macro TRANSPOSE4x8W_LOAD 8 +movq m0, %1 +movq m2, %2 +movq m1, %3 +movq m3, %4 + +punpcklwdm0, m2 +punpcklwdm1, m3 +punpckhdqm2, m0, m1 +punpckldqm0, m1 + +movq m4, %5 +movq m6, %6 +movq m5, %7 +movq m3, %8 + +punpcklwdm4, m6 +punpcklwdm5, m3 +punpckhdqm6, m4, m5 +punpckldqm4, m5 + +punpckhqdq m1, m0, m4 +punpcklqdq m0, m4 +punpckhqdq m3, m2, m6 +punpcklqdq m2, m6 +%endmacro + +; in: 4 rows of 8 words in m0..m3 +; out: 8 rows of 4 words in %1..%8 +%macro TRANSPOSE8x4W_STORE 8 +TRANSPOSE4x4W 0, 1, 2, 3, 4 +movq %1, m0 +movhps %2, m0 +movq %3, m1 +movhps %4, m1 +movq %5, m2 +movhps %6, m2 +movq %7, m3 +movhps %8, m3 +%endmacro + +; %1 = base + 3*stride +; %2 = 3*stride (unused on mmx) +; %3, %4 = place to store p1 and q1 values +%macro CHROMA_H_LOAD 4 +%if mmsize == 8 +movq m0, [pix_q - 4] +movq m1, [pix_q + stride_q - 4] +movq m2, [pix_q + 2*stride_q - 4] +movq m3, [%1 - 4] +TRANSPOSE4x4W 0, 1, 2, 3, 4 +%else +TRANSPOSE4x8W_LOAD PASS8ROWS(pix_q-4, %1-4, stride_q, %2) +%endif +mova %3, m0 +mova %4, m3 +%endmacro + +; %1 = base + 3*stride +; %2 = 3*stride (unused on mmx) +; %3, %4 = place to load p1 and q1 values +%macro CHROMA_H_STORE 4 +mova m0, %3 +mova m3, %4 +%if mmsize == 8 +TRANSPOSE4x4W 0, 1, 2, 3, 4 +movq [pix_q - 4], m0 +movq [pix_q + stride_q - 4], m1 +movq [pix_q + 2*stride_q - 4], m2 +movq [%1 - 4], m3 +%else +TRANSPOSE8x4W_STORE PASS8ROWS(pix_q-4, %1-4, stride_q, %2) +%endif +%endmacro + %macro CHROMA_V_LOAD_TC 2 movd%1, [%2] punpcklbw %1, %1 @@ -914,6 +996,42 @@ cglobal deblock_v_chroma_intra_10, 4,6-(mmsize/16),8*(mmsize/16) %else RET %endif + +;- +; void ff_deblock_h_chroma_10(uint16_t *pix, int stride, int alpha, int beta, +; int8_t *tc0) +;- +cglobal deblock_h_chroma_10, 5, 7, 8, 2*mmsize, pix_, stride_, alpha_, beta_, tc0_ +shl alpha_d, 2 +shl beta_d, 2 +mov r5, pix_q +lea r6, [3*stride_q] +add r5, r6 +%if mmsize == 8 +mov r6b, 2 +.loop: +%endif + +CHROMA_H_LOAD r5, r6, [rsp], [rsp + mmsize] +LOAD_AB m4, m5, alpha_d, beta_d +LOAD_MASKm0, m1, m2, m3, m4, m5, m7, m6, m4 +pxor m4, m4 +CHROMA_V_LOAD_TC m6, tc0_q +psubwm6, [pw_3] +pmaxsw m6, m4 +pand m7, m6 +DEBLOCK_P0_Q0m1, m2, m0, m3, m7, m5, m6 +CHROMA_H_STORE r5, r6, [rsp], [rsp + mmsize] + +%if mmsize == 8 +lea pix_q, [pix_q + 4*stride_q] +lea r5,[r5 + 4*stride_q] +add tc0_q, 2 +dec r6b +jg .loop +%endif +RET + %endmacro %if ARCH_X86_64 == 0 diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c index c6c643a..c568762 100644 --- a/libavcodec/x86/h264dsp_init.c +++ b/libavcodec/x86/h264dsp_init.c @@ -310,6 +310,9 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, #if ARCH_X86_32 c->h264_v_loop_filter_chroma = ff_deblock_v_chroma_10_mmxext; c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_mmxext; +if (chroma_format_idc <= 1) { +c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_10_mmxext; +} c->h264_v_loop_filter_luma
[FFmpeg-devel] [PATCH 4/4] dxva2: allow an empty array of ID3D11VideoDecoderOutputView
From: Steve LhommeWe can pick the correct slice index directly from the ID3D11VideoDecoderOutputView casted from data[3]. --- libavcodec/dxva2_internal.h | 4 ++-- libavcodec/version.h| 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/dxva2_internal.h b/libavcodec/dxva2_internal.h index e5322ef..dfff4d6 100644 --- a/libavcodec/dxva2_internal.h +++ b/libavcodec/dxva2_internal.h @@ -78,7 +78,7 @@ typedef union { #define DXVA_CONTEXT_CFG_RESIDACCEL(avctx, ctx) (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD ? ctx->d3d11va.cfg->ConfigResidDiffAccelerator : ctx->dxva2.cfg->ConfigResidDiffAccelerator) #define DXVA_CONTEXT_VALID(avctx, ctx) (DXVA_CONTEXT_DECODER(avctx, ctx) && \ DXVA_CONTEXT_CFG(avctx, ctx) && \ - DXVA_CONTEXT_COUNT(avctx, ctx)) + (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD || ctx->dxva2.surface_count)) #elif CONFIG_DXVA2 #define DXVA_CONTEXT_WORKAROUND(avctx, ctx) (ctx->dxva2.workaround) #define DXVA_CONTEXT_COUNT(avctx, ctx) (ctx->dxva2.surface_count) @@ -98,7 +98,7 @@ typedef union { #define DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) (ctx->d3d11va.cfg->ConfigBitstreamRaw) #define DXVA_CONTEXT_CFG_INTRARESID(avctx, ctx) (ctx->d3d11va.cfg->ConfigIntraResidUnsigned) #define DXVA_CONTEXT_CFG_RESIDACCEL(avctx, ctx) (ctx->d3d11va.cfg->ConfigResidDiffAccelerator) -#define DXVA_CONTEXT_VALID(avctx, ctx) (ctx->d3d11va.decoder && ctx->d3d11va.cfg && ctx->d3d11va.surface_count) +#define DXVA_CONTEXT_VALID(avctx, ctx) (ctx->d3d11va.decoder && ctx->d3d11va.cfg) #endif unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx, diff --git a/libavcodec/version.h b/libavcodec/version.h index c28867a..69aae45 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #define LIBAVCODEC_VERSION_MAJOR 57 #define LIBAVCODEC_VERSION_MINOR 66 -#define LIBAVCODEC_VERSION_MICRO 108 +#define LIBAVCODEC_VERSION_MICRO 109 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ -- 2.10.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/6] tests/ffserver.regression.ref: Update ffserver checksums
They have changed due to 122190392b297b7cd9783641d880df887fd80d07 Signed-off-by: Michael Niedermayer--- tests/ffserver.regression.ref | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ffserver.regression.ref b/tests/ffserver.regression.ref index 3106f85..398c285 100644 --- a/tests/ffserver.regression.ref +++ b/tests/ffserver.regression.ref @@ -1,5 +1,5 @@ -233020d119085ba47535d5f2faf73cc0 *ff-test_h.avi -431b75d1f12cb039acebad61a3d39225 *ff-test_l.avi +0c9639f09decbc54c9f091dcf1ca0e8f *ff-test_h.avi +e28ba75853caf975e06d92955c9f7f73 *ff-test_l.avi a767dbdf5d1bded3450279f812f97b37 *ff-test.swf dc16f607e13328a832e73801cd21ec98 *ff-test_h.asf 69337d6c8cd7ac7e626338decdbf41d3 *ff-test_l.asf -- 2.10.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 6/6] avformat/ffmenc: Remove the last use of st->codec
Signed-off-by: Michael Niedermayer--- libavformat/ffmenc.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c index caf278f..ef7dc3a 100644 --- a/libavformat/ffmenc.c +++ b/libavformat/ffmenc.c @@ -148,11 +148,11 @@ static int ffm_write_header_codec_ctx(AVIOContext *pb, AVCodecParameters *ctxpar #undef ENC } -static int ffm_write_recommended_config(AVIOContext *pb, AVCodecContext *ctx, unsigned tag, +static int ffm_write_recommended_config(AVIOContext *pb, AVCodecParameters *codecpar, unsigned tag, const char *configuration) { int ret; -const AVCodec *enc = ctx->codec ? ctx->codec : avcodec_find_encoder(ctx->codec_id); +const AVCodec *enc = avcodec_find_encoder(codecpar->codec_id); AVIOContext *tmp; AVDictionaryEntry *t = NULL; AVDictionary *all = NULL, *comm = NULL, *prv = NULL; @@ -207,7 +207,6 @@ static int ffm_write_header(AVFormatContext *s) FFMContext *ffm = s->priv_data; AVStream *st; AVIOContext *pb = s->pb; -AVCodecContext *codec; AVCodecParameters *codecpar; int bit_rate, i, ret; @@ -242,7 +241,6 @@ static int ffm_write_header(AVFormatContext *s) if(avio_open_dyn_buf() < 0) return AVERROR(ENOMEM); -codec = st->codec; codecpar = st->codecpar; /* generic info */ avio_wb32(pb, codecpar->codec_id); @@ -271,7 +269,7 @@ static int ffm_write_header(AVFormatContext *s) if (st->recommended_encoder_configuration) { av_log(NULL, AV_LOG_DEBUG, "writing recommended configuration: %s\n", st->recommended_encoder_configuration); -if ((ret = ffm_write_recommended_config(s->pb, codec, MKBETAG('S', '2', 'V', 'I'), +if ((ret = ffm_write_recommended_config(s->pb, codecpar, MKBETAG('S', '2', 'V', 'I'), st->recommended_encoder_configuration)) < 0) return ret; } else if ((ret = ffm_write_header_codec_ctx(s->pb, codecpar, MKBETAG('S', '2', 'V', 'I'), AV_OPT_FLAG_VIDEO_PARAM)) < 0) @@ -281,7 +279,7 @@ static int ffm_write_header(AVFormatContext *s) if (st->recommended_encoder_configuration) { av_log(NULL, AV_LOG_DEBUG, "writing recommended configuration: %s\n", st->recommended_encoder_configuration); -if ((ret = ffm_write_recommended_config(s->pb, codec, MKBETAG('S', '2', 'A', 'U'), +if ((ret = ffm_write_recommended_config(s->pb, codecpar, MKBETAG('S', '2', 'A', 'U'), st->recommended_encoder_configuration)) < 0) return ret; } else if ((ret = ffm_write_header_codec_ctx(s->pb, codecpar, MKBETAG('S', '2', 'A', 'U'), AV_OPT_FLAG_AUDIO_PARAM)) < 0) -- 2.10.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 5/6] avformat/ffmenc: Make ffm_write_header_codec_ctx() use codecpar
This would be simpler if codecpar supported AVOptions modern ffserver should be unaffected by this, older ffserver which required the muxer to directly access the encoder could have issues with this, but this direct access is just wrong and unsafe Signed-off-by: Michael Niedermayer--- libavformat/ffmenc.c | 19 --- tests/ref/lavf/ffm | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c index 7ed4320..caf278f 100644 --- a/libavformat/ffmenc.c +++ b/libavformat/ffmenc.c @@ -95,11 +95,12 @@ static void write_header_chunk(AVIOContext *pb, AVIOContext *dpb, unsigned id) av_free(dyn_buf); } -static int ffm_write_header_codec_ctx(AVIOContext *pb, AVCodecContext *ctx, unsigned tag, int type) +static int ffm_write_header_codec_ctx(AVIOContext *pb, AVCodecParameters *ctxpar, unsigned tag, int type) { AVIOContext *tmp; char *buf = NULL; int ret, need_coma = 0; +AVCodecContext *ctx = NULL; #define SKIP_DEFAULTS AV_OPT_SERIALIZE_SKIP_DEFAULTS #define OPT_FLAGS_EXACT AV_OPT_SERIALIZE_OPT_FLAGS_EXACT @@ -107,6 +108,16 @@ static int ffm_write_header_codec_ctx(AVIOContext *pb, AVCodecContext *ctx, unsi if (avio_open_dyn_buf() < 0) return AVERROR(ENOMEM); + +// AVCodecParameters does not suport AVOptions, we thus must copy it over to a context that does +// otherwise it could be used directly and this would be much simpler +ctx = avcodec_alloc_context3(NULL); +if (!ctx) { +ret = AVERROR(ENOMEM); +goto fail; +} +avcodec_parameters_to_context(ctx, ctxpar); + if ((ret = av_opt_serialize(ctx, ENC | type, SKIP_DEFAULTS, , '=', ',')) < 0) goto fail; if (buf && strlen(buf)) { @@ -124,10 +135,12 @@ static int ffm_write_header_codec_ctx(AVIOContext *pb, AVCodecContext *ctx, unsi av_freep(); avio_w8(tmp, 0); write_header_chunk(pb, tmp, tag); +avcodec_free_context(); return 0; fail: av_free(buf); ffio_free_dyn_buf(); +avcodec_free_context(); return ret; #undef SKIP_DEFAULTS @@ -261,7 +274,7 @@ static int ffm_write_header(AVFormatContext *s) if ((ret = ffm_write_recommended_config(s->pb, codec, MKBETAG('S', '2', 'V', 'I'), st->recommended_encoder_configuration)) < 0) return ret; -} else if ((ret = ffm_write_header_codec_ctx(s->pb, codec, MKBETAG('S', '2', 'V', 'I'), AV_OPT_FLAG_VIDEO_PARAM)) < 0) +} else if ((ret = ffm_write_header_codec_ctx(s->pb, codecpar, MKBETAG('S', '2', 'V', 'I'), AV_OPT_FLAG_VIDEO_PARAM)) < 0) return ret; break; case AVMEDIA_TYPE_AUDIO: @@ -271,7 +284,7 @@ static int ffm_write_header(AVFormatContext *s) if ((ret = ffm_write_recommended_config(s->pb, codec, MKBETAG('S', '2', 'A', 'U'), st->recommended_encoder_configuration)) < 0) return ret; -} else if ((ret = ffm_write_header_codec_ctx(s->pb, codec, MKBETAG('S', '2', 'A', 'U'), AV_OPT_FLAG_AUDIO_PARAM)) < 0) +} else if ((ret = ffm_write_header_codec_ctx(s->pb, codecpar, MKBETAG('S', '2', 'A', 'U'), AV_OPT_FLAG_AUDIO_PARAM)) < 0) return ret; break; default: diff --git a/tests/ref/lavf/ffm b/tests/ref/lavf/ffm index 7a51d9b..54c5603 100644 --- a/tests/ref/lavf/ffm +++ b/tests/ref/lavf/ffm @@ -1,3 +1,3 @@ -03f2673a39a9494157eb4be9af537f84 *./tests/data/lavf/lavf.ffm +a0e9616f0d9a8c1029f3220b1b9175f4 *./tests/data/lavf/lavf.ffm 376832 ./tests/data/lavf/lavf.ffm ./tests/data/lavf/lavf.ffm CRC=0x000e23ae -- 2.10.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 4/6] avformat/ffmenc: set bitexact mode for old API without accessing the encoder
Signed-off-by: Michael Niedermayer--- libavformat/ffmenc.c | 12 +++- tests/ref/lavf/ffm | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c index 221f0a2..7ed4320 100644 --- a/libavformat/ffmenc.c +++ b/libavformat/ffmenc.c @@ -223,6 +223,7 @@ static int ffm_write_header(AVFormatContext *s) /* list of streams */ for(i=0;inb_streams;i++) { +int flags = 0; st = s->streams[i]; avpriv_set_pts_info(st, 64, 1, 100); if(avio_open_dyn_buf() < 0) @@ -234,7 +235,16 @@ static int ffm_write_header(AVFormatContext *s) avio_wb32(pb, codecpar->codec_id); avio_w8(pb, codecpar->codec_type); avio_wb32(pb, codecpar->bit_rate); -avio_wb32(pb, codecpar->extradata_size ? AV_CODEC_FLAG_GLOBAL_HEADER : 0); +if (codecpar->extradata_size) +flags |= AV_CODEC_FLAG_GLOBAL_HEADER; + +// If the user is not providing us with a configuration we have to fill it in as we cannot access the encoder +if (!st->recommended_encoder_configuration) { +if (s->flags & AVFMT_FLAG_BITEXACT) +flags |= AV_CODEC_FLAG_BITEXACT; +} + +avio_wb32(pb, flags); avio_wb32(pb, 0); // flags2 avio_wb32(pb, 0); // debug if (codecpar->extradata_size) { diff --git a/tests/ref/lavf/ffm b/tests/ref/lavf/ffm index 9d9d07f..7a51d9b 100644 --- a/tests/ref/lavf/ffm +++ b/tests/ref/lavf/ffm @@ -1,3 +1,3 @@ -15a9929d1cb7129dcaffeccf3cb2fda9 *./tests/data/lavf/lavf.ffm +03f2673a39a9494157eb4be9af537f84 *./tests/data/lavf/lavf.ffm 376832 ./tests/data/lavf/lavf.ffm ./tests/data/lavf/lavf.ffm CRC=0x000e23ae -- 2.10.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 3/6] avformat/ffmenc: Drop ffm_write_header_codec_private_ctx()
This accesses the private encoder context, it should not be used by the current ffserver it may affect old ffserver versions but i believe there is consens that accessing the private encoder context from the muxer is completely wrong. Signed-off-by: Michael Niedermayer--- libavformat/ffmenc.c | 35 ++- tests/ref/lavf/ffm | 2 +- 2 files changed, 3 insertions(+), 34 deletions(-) diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c index c89b9b3..221f0a2 100644 --- a/libavformat/ffmenc.c +++ b/libavformat/ffmenc.c @@ -95,35 +95,6 @@ static void write_header_chunk(AVIOContext *pb, AVIOContext *dpb, unsigned id) av_free(dyn_buf); } -static int ffm_write_header_codec_private_ctx(AVFormatContext *s, AVCodecContext *ctx, int type) -{ -AVIOContext *pb = s->pb; -AVIOContext *tmp; -char *buf = NULL; -int ret; -const AVCodec *enc = ctx->codec ? ctx->codec : avcodec_find_encoder(ctx->codec_id); - -if (!enc) { -av_log(s, AV_LOG_WARNING, "Stream codec is not found. Codec private options are not stored.\n"); -return 0; -} -if (ctx->priv_data && enc->priv_class && enc->priv_data_size) { -if ((ret = av_opt_serialize(ctx->priv_data, AV_OPT_FLAG_ENCODING_PARAM | type, -AV_OPT_SERIALIZE_SKIP_DEFAULTS, , '=', ',')) < 0) -return ret; -if (buf && strlen(buf)) { -if (avio_open_dyn_buf() < 0) { -av_free(buf); -return AVERROR(ENOMEM); -} -avio_put_str(tmp, buf); -write_header_chunk(pb, tmp, MKBETAG('C', 'P', 'R', 'V')); -} -av_free(buf); -} -return 0; -} - static int ffm_write_header_codec_ctx(AVIOContext *pb, AVCodecContext *ctx, unsigned tag, int type) { AVIOContext *tmp; @@ -280,8 +251,7 @@ static int ffm_write_header(AVFormatContext *s) if ((ret = ffm_write_recommended_config(s->pb, codec, MKBETAG('S', '2', 'V', 'I'), st->recommended_encoder_configuration)) < 0) return ret; -} else if ((ret = ffm_write_header_codec_ctx(s->pb, codec, MKBETAG('S', '2', 'V', 'I'), AV_OPT_FLAG_VIDEO_PARAM)) < 0 || - (ret = ffm_write_header_codec_private_ctx(s, codec, AV_OPT_FLAG_VIDEO_PARAM)) < 0) +} else if ((ret = ffm_write_header_codec_ctx(s->pb, codec, MKBETAG('S', '2', 'V', 'I'), AV_OPT_FLAG_VIDEO_PARAM)) < 0) return ret; break; case AVMEDIA_TYPE_AUDIO: @@ -291,8 +261,7 @@ static int ffm_write_header(AVFormatContext *s) if ((ret = ffm_write_recommended_config(s->pb, codec, MKBETAG('S', '2', 'A', 'U'), st->recommended_encoder_configuration)) < 0) return ret; -} else if ((ret = ffm_write_header_codec_ctx(s->pb, codec, MKBETAG('S', '2', 'A', 'U'), AV_OPT_FLAG_AUDIO_PARAM)) < 0 || - (ret = ffm_write_header_codec_private_ctx(s, codec, AV_OPT_FLAG_AUDIO_PARAM)) < 0) +} else if ((ret = ffm_write_header_codec_ctx(s->pb, codec, MKBETAG('S', '2', 'A', 'U'), AV_OPT_FLAG_AUDIO_PARAM)) < 0) return ret; break; default: diff --git a/tests/ref/lavf/ffm b/tests/ref/lavf/ffm index c4d7e1f..9d9d07f 100644 --- a/tests/ref/lavf/ffm +++ b/tests/ref/lavf/ffm @@ -1,3 +1,3 @@ -e63c16b5f0ad5015304fc4009fdb33ca *./tests/data/lavf/lavf.ffm +15a9929d1cb7129dcaffeccf3cb2fda9 *./tests/data/lavf/lavf.ffm 376832 ./tests/data/lavf/lavf.ffm ./tests/data/lavf/lavf.ffm CRC=0x000e23ae -- 2.10.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/6] avformat/ffmenc: Replace some st->codec use by codecpar
Note, this temporarly drops the ability to set ffmpeg encoder debug and flags2 via ffserver.conf Signed-off-by: Michael Niedermayer--- libavformat/ffmenc.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c index 0f23b79..c89b9b3 100644 --- a/libavformat/ffmenc.c +++ b/libavformat/ffmenc.c @@ -224,6 +224,7 @@ static int ffm_write_header(AVFormatContext *s) AVStream *st; AVIOContext *pb = s->pb; AVCodecContext *codec; +AVCodecParameters *codecpar; int bit_rate, i, ret; if ((ret = ff_parse_creation_time_metadata(s, >start_time, 0)) < 0) @@ -243,7 +244,7 @@ static int ffm_write_header(AVFormatContext *s) bit_rate = 0; for(i=0;inb_streams;i++) { st = s->streams[i]; -bit_rate += st->codec->bit_rate; +bit_rate += st->codecpar->bit_rate; } avio_wb32(pb, bit_rate); @@ -257,20 +258,21 @@ static int ffm_write_header(AVFormatContext *s) return AVERROR(ENOMEM); codec = st->codec; +codecpar = st->codecpar; /* generic info */ -avio_wb32(pb, codec->codec_id); -avio_w8(pb, codec->codec_type); -avio_wb32(pb, codec->bit_rate); -avio_wb32(pb, codec->flags); -avio_wb32(pb, codec->flags2); -avio_wb32(pb, codec->debug); -if (codec->flags & AV_CODEC_FLAG_GLOBAL_HEADER) { -avio_wb32(pb, codec->extradata_size); -avio_write(pb, codec->extradata, codec->extradata_size); +avio_wb32(pb, codecpar->codec_id); +avio_w8(pb, codecpar->codec_type); +avio_wb32(pb, codecpar->bit_rate); +avio_wb32(pb, codecpar->extradata_size ? AV_CODEC_FLAG_GLOBAL_HEADER : 0); +avio_wb32(pb, 0); // flags2 +avio_wb32(pb, 0); // debug +if (codecpar->extradata_size) { +avio_wb32(pb, codecpar->extradata_size); +avio_write(pb, codecpar->extradata, codecpar->extradata_size); } write_header_chunk(s->pb, pb, MKBETAG('C', 'O', 'M', 'M')); /* specific info */ -switch(codec->codec_type) { +switch(codecpar->codec_type) { case AVMEDIA_TYPE_VIDEO: if (st->recommended_encoder_configuration) { av_log(NULL, AV_LOG_DEBUG, "writing recommended configuration: %s\n", -- 2.10.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Define ETIMEDOUT in fifo_muxer.c for MinGW/Windows fate build.
> -Original Message- > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On > Behalf Of James Almer > Sent: Wednesday, November 30, 2016 5:18 PM > To: FFmpeg development discussions and patches de...@ffmpeg.org> > Subject: Re: [FFmpeg-devel] [PATCH] Define ETIMEDOUT in > fifo_muxer.c for MinGW/Windows fate build. > > On 11/30/2016 7:02 PM, Gregory J. Wolfe wrote: > > Fate failed to build in the MinGW/Windows environment because > > macro ETIMEDOUT was undefined. When this condition is detected, > > the code now defines this symbol the same way it's done in > > libavformat/network.h. > > > > Signed-off-by: Gregory J. Wolfe> > --- > > libavformat/tests/fifo_muxer.c | 12 > > 1 file changed, 12 insertions(+) > > > > diff --git a/libavformat/tests/fifo_muxer.c > b/libavformat/tests/fifo_muxer.c > > index 9659198..97f798f 100644 > > --- a/libavformat/tests/fifo_muxer.c > > +++ b/libavformat/tests/fifo_muxer.c > > @@ -25,6 +25,18 @@ > > #include "libavutil/avassert.h" > > #include "libavformat/avformat.h" > > #include "libavformat/url.h" > > +#ifndef ETIMEDOUT > > +#if HAVE_WINSOCK2_H > > +#include > > +#include > > +#define ETIMEDOUT WSAETIMEDOUT > > Why are you duplicating this code instead of simply including > network.h? My reasoning is that all that is needed in fifo_muxer.c is that ETIMEDOUT be defined. It does not need EVERYTHING that is in network.h (otherwise it would have already included it). Given my limited familiarity with FFmpeg source code, I did not want to introduce unneeded dependencies, but if you folks don't think that's an issue, fine with me (it is a BIG issue for our software development team). So should I submit a revised patch, or, given that the revised patch would add only a single line of code, would it be easier for you guys to make the fix directly? Greg W. > > > +#else /* HAVE_WINSOCK2_H */ > > +#include > > +#include > > +#include > > +#include > > +#endif /* HAVE_WINSOCK2_H */ > > +#endif /* ifndef ETIMEDOUT */ > > > > #define MAX_TST_PACKETS 128 > > #define SLEEPTIME_50_MS 5 > > > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 3/4] dxva2: get the slice number directly from the surface in D3D11VA
From: Steve LhommeNo need to loop through the known surfaces, we'll use it anyway. The loop is only done for DXVA2 --- libavcodec/dxva2.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c index a64b1b5..459e267 100644 --- a/libavcodec/dxva2.c +++ b/libavcodec/dxva2.c @@ -41,20 +41,20 @@ unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx, void *surface = ff_dxva2_get_surface(frame); unsigned i; -for (i = 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) { #if CONFIG_D3D11VA -if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD && ctx->d3d11va.surface[i] == surface) -{ -D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc; -ID3D11VideoDecoderOutputView_GetDesc(ctx->d3d11va.surface[i], ); -return viewDesc.Texture2D.ArraySlice; -} +if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD) +{ +D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc; +ID3D11VideoDecoderOutputView_GetDesc((ID3D11VideoDecoderOutputView*) surface, ); +return viewDesc.Texture2D.ArraySlice; +} #endif #if CONFIG_DXVA2 +for (i = 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) { if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD && ctx->dxva2.surface[i] == surface) return i; -#endif } +#endif assert(0); return 0; -- 2.10.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/4] dxva2: make ff_dxva2_get_surface() static
From: Steve Lhomme--- libavcodec/dxva2.c | 2 +- libavcodec/dxva2_internal.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c index 04a9c11..a64b1b5 100644 --- a/libavcodec/dxva2.c +++ b/libavcodec/dxva2.c @@ -29,7 +29,7 @@ #include "avcodec.h" #include "dxva2_internal.h" -void *ff_dxva2_get_surface(const AVFrame *frame) +static void *ff_dxva2_get_surface(const AVFrame *frame) { return frame->data[3]; } diff --git a/libavcodec/dxva2_internal.h b/libavcodec/dxva2_internal.h index 24adb99..c962810 100644 --- a/libavcodec/dxva2_internal.h +++ b/libavcodec/dxva2_internal.h @@ -96,8 +96,6 @@ typedef union { #define DXVA_CONTEXT_CFG_RESIDACCEL(avctx, ctx) (ctx->d3d11va.cfg->ConfigResidDiffAccelerator) #endif -void *ff_dxva2_get_surface(const AVFrame *frame); - unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx, const AVDXVAContext *, const AVFrame *frame); -- 2.10.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/4] dxva2: use a single macro to test if the DXVA context is valid
From: Steve Lhomme--- libavcodec/dxva2_h264.c | 4 +--- libavcodec/dxva2_hevc.c | 4 +--- libavcodec/dxva2_internal.h | 5 + libavcodec/dxva2_mpeg2.c| 4 +--- libavcodec/dxva2_vc1.c | 4 +--- libavcodec/dxva2_vp9.c | 4 +--- 6 files changed, 10 insertions(+), 15 deletions(-) diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c index 82a772d..59fa5e3 100644 --- a/libavcodec/dxva2_h264.c +++ b/libavcodec/dxva2_h264.c @@ -450,9 +450,7 @@ static int dxva2_h264_start_frame(AVCodecContext *avctx, AVDXVAContext *ctx = avctx->hwaccel_context; struct dxva2_picture_context *ctx_pic = h->cur_pic_ptr->hwaccel_picture_private; -if (DXVA_CONTEXT_DECODER(avctx, ctx) == NULL || -DXVA_CONTEXT_CFG(avctx, ctx) == NULL || -DXVA_CONTEXT_COUNT(avctx, ctx) <= 0) +if (!DXVA_CONTEXT_VALID(avctx, ctx)) return -1; assert(ctx_pic); diff --git a/libavcodec/dxva2_hevc.c b/libavcodec/dxva2_hevc.c index 5a312ea..981c888 100644 --- a/libavcodec/dxva2_hevc.c +++ b/libavcodec/dxva2_hevc.c @@ -364,9 +364,7 @@ static int dxva2_hevc_start_frame(AVCodecContext *avctx, AVDXVAContext *ctx = avctx->hwaccel_context; struct hevc_dxva2_picture_context *ctx_pic = h->ref->hwaccel_picture_private; -if (DXVA_CONTEXT_DECODER(avctx, ctx) == NULL || -DXVA_CONTEXT_CFG(avctx, ctx) == NULL || -DXVA_CONTEXT_COUNT(avctx, ctx) <= 0) +if (!DXVA_CONTEXT_VALID(avctx, ctx)) return -1; av_assert0(ctx_pic); diff --git a/libavcodec/dxva2_internal.h b/libavcodec/dxva2_internal.h index c962810..e5322ef 100644 --- a/libavcodec/dxva2_internal.h +++ b/libavcodec/dxva2_internal.h @@ -76,6 +76,9 @@ typedef union { #define DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD ? ctx->d3d11va.cfg->ConfigBitstreamRaw : ctx->dxva2.cfg->ConfigBitstreamRaw) #define DXVA_CONTEXT_CFG_INTRARESID(avctx, ctx) (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD ? ctx->d3d11va.cfg->ConfigIntraResidUnsigned : ctx->dxva2.cfg->ConfigIntraResidUnsigned) #define DXVA_CONTEXT_CFG_RESIDACCEL(avctx, ctx) (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD ? ctx->d3d11va.cfg->ConfigResidDiffAccelerator : ctx->dxva2.cfg->ConfigResidDiffAccelerator) +#define DXVA_CONTEXT_VALID(avctx, ctx) (DXVA_CONTEXT_DECODER(avctx, ctx) && \ + DXVA_CONTEXT_CFG(avctx, ctx) && \ + DXVA_CONTEXT_COUNT(avctx, ctx)) #elif CONFIG_DXVA2 #define DXVA_CONTEXT_WORKAROUND(avctx, ctx) (ctx->dxva2.workaround) #define DXVA_CONTEXT_COUNT(avctx, ctx) (ctx->dxva2.surface_count) @@ -85,6 +88,7 @@ typedef union { #define DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) (ctx->dxva2.cfg->ConfigBitstreamRaw) #define DXVA_CONTEXT_CFG_INTRARESID(avctx, ctx) (ctx->dxva2.cfg->ConfigIntraResidUnsigned) #define DXVA_CONTEXT_CFG_RESIDACCEL(avctx, ctx) (ctx->dxva2.cfg->ConfigResidDiffAccelerator) +#define DXVA_CONTEXT_VALID(avctx, ctx) (ctx->dxva2.decoder && ctx->dxva2.cfg && ctx->dxva2.surface_count) #elif CONFIG_D3D11VA #define DXVA_CONTEXT_WORKAROUND(avctx, ctx) (ctx->d3d11va.workaround) #define DXVA_CONTEXT_COUNT(avctx, ctx) (ctx->d3d11va.surface_count) @@ -94,6 +98,7 @@ typedef union { #define DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) (ctx->d3d11va.cfg->ConfigBitstreamRaw) #define DXVA_CONTEXT_CFG_INTRARESID(avctx, ctx) (ctx->d3d11va.cfg->ConfigIntraResidUnsigned) #define DXVA_CONTEXT_CFG_RESIDACCEL(avctx, ctx) (ctx->d3d11va.cfg->ConfigResidDiffAccelerator) +#define DXVA_CONTEXT_VALID(avctx, ctx) (ctx->d3d11va.decoder && ctx->d3d11va.cfg && ctx->d3d11va.surface_count) #endif unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx, diff --git a/libavcodec/dxva2_mpeg2.c b/libavcodec/dxva2_mpeg2.c index c2f0b58..14ac48f 100644 --- a/libavcodec/dxva2_mpeg2.c +++ b/libavcodec/dxva2_mpeg2.c @@ -262,9 +262,7 @@ static int dxva2_mpeg2_start_frame(AVCodecContext *avctx, struct dxva2_picture_context *ctx_pic = s->current_picture_ptr->hwaccel_picture_private; -if (DXVA_CONTEXT_DECODER(avctx, ctx) == NULL || -DXVA_CONTEXT_CFG(avctx, ctx) == NULL || -DXVA_CONTEXT_COUNT(avctx, ctx) <= 0) +if (!DXVA_CONTEXT_VALID(avctx, ctx)) return -1; assert(ctx_pic); diff --git a/libavcodec/dxva2_vc1.c b/libavcodec/dxva2_vc1.c index 36bf1ba..cc97d7b 100644 --- a/libavcodec/dxva2_vc1.c +++ b/libavcodec/dxva2_vc1.c @@ -317,9 +317,7 @@ static int dxva2_vc1_start_frame(AVCodecContext *avctx, AVDXVAContext *ctx = avctx->hwaccel_context; struct dxva2_picture_context *ctx_pic = v->s.current_picture_ptr->hwaccel_picture_private; -if (DXVA_CONTEXT_DECODER(avctx, ctx) == NULL || -DXVA_CONTEXT_CFG(avctx, ctx) == NULL || -DXVA_CONTEXT_COUNT(avctx, ctx) <= 0) +if (!DXVA_CONTEXT_VALID(avctx, ctx)) return -1; assert(ctx_pic);
Re: [FFmpeg-devel] [PATCH 2/2] dxva2: get the slice number directly from the surface in D3D11VA
On Thu, Dec 1, 2016 at 3:43 PM, Hendrik Leppkeswrote: > On Thu, Dec 1, 2016 at 3:13 PM, Stève Lhomme wrote: >> I think I should update the minor version number as I need to rely on >> this behaviour change in VLC, the surface array will be empty. >> >> Should I also change the headers so that they don't require the output >> surface to be pre-allocated ? > > How does this end up being a behavior change? The commit doesn't make > it sound like it would change anything but simplify the code. Before this change the d3d11va.surface and d3d11va.surface_count could not be NULL/0 respectively. They had to be filled. But with this change it's not necessary anymore. We may even drop them in the future. I should investigate if the same thing is possible with D3D9 surfaces. > Please document the changed behavior in the commit message, then. OK > - Hendrik > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] dxva2: get the slice number directly from the surface in D3D11VA
On Thu, Dec 1, 2016 at 3:13 PM, Stève Lhommewrote: > I think I should update the minor version number as I need to rely on > this behaviour change in VLC, the surface array will be empty. > > Should I also change the headers so that they don't require the output > surface to be pre-allocated ? How does this end up being a behavior change? The commit doesn't make it sound like it would change anything but simplify the code. Please document the changed behavior in the commit message, then. - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/2] dxva2: get the slice number directly from the surface in D3D11VA
No need to loop through the known surfaces, we'll use it anyway. The loop is only done for DXVA2 --- libavcodec/dxva2.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c index a64b1b5..459e267 100644 --- a/libavcodec/dxva2.c +++ b/libavcodec/dxva2.c @@ -41,20 +41,20 @@ unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx, void *surface = ff_dxva2_get_surface(frame); unsigned i; -for (i = 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) { #if CONFIG_D3D11VA -if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD && ctx->d3d11va.surface[i] == surface) -{ -D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc; -ID3D11VideoDecoderOutputView_GetDesc(ctx->d3d11va.surface[i], ); -return viewDesc.Texture2D.ArraySlice; -} +if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD) +{ +D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc; +ID3D11VideoDecoderOutputView_GetDesc((ID3D11VideoDecoderOutputView*) surface, ); +return viewDesc.Texture2D.ArraySlice; +} #endif #if CONFIG_DXVA2 +for (i = 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) { if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD && ctx->dxva2.surface[i] == surface) return i; -#endif } +#endif assert(0); return 0; -- 2.10.1.windows.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/2] dxva2: make ff_dxva2_get_surface() static
--- libavcodec/dxva2.c | 2 +- libavcodec/dxva2_internal.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c index 04a9c11..a64b1b5 100644 --- a/libavcodec/dxva2.c +++ b/libavcodec/dxva2.c @@ -29,7 +29,7 @@ #include "avcodec.h" #include "dxva2_internal.h" -void *ff_dxva2_get_surface(const AVFrame *frame) +static void *ff_dxva2_get_surface(const AVFrame *frame) { return frame->data[3]; } diff --git a/libavcodec/dxva2_internal.h b/libavcodec/dxva2_internal.h index 24adb99..c962810 100644 --- a/libavcodec/dxva2_internal.h +++ b/libavcodec/dxva2_internal.h @@ -96,8 +96,6 @@ typedef union { #define DXVA_CONTEXT_CFG_RESIDACCEL(avctx, ctx) (ctx->d3d11va.cfg->ConfigResidDiffAccelerator) #endif -void *ff_dxva2_get_surface(const AVFrame *frame); - unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx, const AVDXVAContext *, const AVFrame *frame); -- 2.10.1.windows.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] dxva2: get the slice number directly from the surface in D3D11VA
I think I should update the minor version number as I need to rely on this behaviour change in VLC, the surface array will be empty. Should I also change the headers so that they don't require the output surface to be pre-allocated ? On Thu, Dec 1, 2016 at 3:10 PM, Steve Lhommewrote: > No need to loop through the known surfaces, we'll use it anyway. > > The loop is only done for DXVA2 > --- > libavcodec/dxva2.c | 16 > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c > index a64b1b5..459e267 100644 > --- a/libavcodec/dxva2.c > +++ b/libavcodec/dxva2.c > @@ -41,20 +41,20 @@ unsigned ff_dxva2_get_surface_index(const AVCodecContext > *avctx, > void *surface = ff_dxva2_get_surface(frame); > unsigned i; > > -for (i = 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) { > #if CONFIG_D3D11VA > -if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD && > ctx->d3d11va.surface[i] == surface) > -{ > -D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc; > -ID3D11VideoDecoderOutputView_GetDesc(ctx->d3d11va.surface[i], > ); > -return viewDesc.Texture2D.ArraySlice; > -} > +if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD) > +{ > +D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc; > +ID3D11VideoDecoderOutputView_GetDesc((ID3D11VideoDecoderOutputView*) > surface, ); > +return viewDesc.Texture2D.ArraySlice; > +} > #endif > #if CONFIG_DXVA2 > +for (i = 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) { > if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD && ctx->dxva2.surface[i] > == surface) > return i; > -#endif > } > +#endif > > assert(0); > return 0; > -- > 2.10.1.windows.1 > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] dxva2: get the slice number directly from the surface in D3D11VA
I think I should update the minor version number as I need to rely on this behaviour change in VLC, the surface array will be empty. Should I also change the headers so that they don't require the output surface to be pre-allocated ? On Thu, Dec 1, 2016 at 3:10 PM, Steve Lhommewrote: > No need to loop through the known surfaces, we'll use it anyway. > > The loop is only done for DXVA2 > --- > libavcodec/dxva2.c | 16 > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c > index a64b1b5..459e267 100644 > --- a/libavcodec/dxva2.c > +++ b/libavcodec/dxva2.c > @@ -41,20 +41,20 @@ unsigned ff_dxva2_get_surface_index(const AVCodecContext > *avctx, > void *surface = ff_dxva2_get_surface(frame); > unsigned i; > > -for (i = 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) { > #if CONFIG_D3D11VA > -if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD && > ctx->d3d11va.surface[i] == surface) > -{ > -D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc; > -ID3D11VideoDecoderOutputView_GetDesc(ctx->d3d11va.surface[i], > ); > -return viewDesc.Texture2D.ArraySlice; > -} > +if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD) > +{ > +D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc; > +ID3D11VideoDecoderOutputView_GetDesc((ID3D11VideoDecoderOutputView*) > surface, ); > +return viewDesc.Texture2D.ArraySlice; > +} > #endif > #if CONFIG_DXVA2 > +for (i = 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) { > if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD && ctx->dxva2.surface[i] > == surface) > return i; > -#endif > } > +#endif > > assert(0); > return 0; > -- > 2.10.1.windows.1 > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH v3] Added Turing codec interface for ffmpeg
- This patch contains the changes to interface the Turing codec (http://turingcodec.org/) to ffmpeg. The patch was modified to address the comments in the review as follows: - Added a pkg-config file to list all dependencies required by libturing. This should address the issue pointed out by Hendrik Leppkes on Fri 18/11/2016 - As per suggestions of wm4, two functions (add_option and finalise_options) have been created. The former appends new options while the latter sets up the argv array of pointers to char* accordingly. add_option re-allocats the buffer for options using realloc. --- LICENSE.md | 1 + configure | 5 + libavcodec/Makefile| 1 + libavcodec/allcodecs.c | 1 + libavcodec/libturing.c | 279 + 5 files changed, 287 insertions(+) create mode 100644 libavcodec/libturing.c diff --git a/LICENSE.md b/LICENSE.md index 640633c..86e5371 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -85,6 +85,7 @@ The following libraries are under GPL: - frei0r - libcdio - librubberband +- libturing - libvidstab - libx264 - libx265 diff --git a/configure b/configure index 6345fc2..022ffa9 100755 --- a/configure +++ b/configure @@ -255,6 +255,7 @@ External library support: --enable-libssh enable SFTP protocol via libssh [no] --enable-libtesseractenable Tesseract, needed for ocr filter [no] --enable-libtheora enable Theora encoding via libtheora [no] + --enable-libturing enable H.265/HEVC encoding via libturing [no] --enable-libtwolame enable MP2 encoding via libtwolame [no] --enable-libv4l2 enable libv4l2/v4l-utils [no] --enable-libvidstab enable video stabilization using vid.stab [no] @@ -1534,6 +1535,7 @@ EXTERNAL_LIBRARY_LIST=" libssh libtesseract libtheora +libturing libtwolame libv4l2 libvidstab @@ -2831,6 +2833,7 @@ libspeex_decoder_deps="libspeex" libspeex_encoder_deps="libspeex" libspeex_encoder_select="audio_frame_queue" libtheora_encoder_deps="libtheora" +libturing_encoder_deps="libturing" libtwolame_encoder_deps="libtwolame" libvo_amrwbenc_encoder_deps="libvo_amrwbenc" libvorbis_decoder_deps="libvorbis" @@ -5096,6 +5099,7 @@ die_license_disabled gpl frei0r die_license_disabled gpl libcdio die_license_disabled gpl librubberband die_license_disabled gpl libsmbclient +die_license_disabled gpl libturing die_license_disabled gpl libvidstab die_license_disabled gpl libx264 die_license_disabled gpl libx265 @@ -5754,6 +5758,7 @@ enabled libssh&& require_pkg_config libssh libssh/sftp.h sftp_init enabled libspeex && require_pkg_config speex speex/speex.h speex_decoder_init -lspeex enabled libtesseract && require_pkg_config tesseract tesseract/capi.h TessBaseAPICreate enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg +enabled libturing && require_pkg_config libturing turing.h turing_version enabled libtwolame&& require libtwolame twolame.h twolame_init -ltwolame && { check_lib twolame.h twolame_encode_buffer_float32_interleaved -ltwolame || die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; } diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 82f7fa2..cadefdc 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -880,6 +880,7 @@ OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o OBJS-$(CONFIG_LIBTHEORA_ENCODER) += libtheoraenc.o OBJS-$(CONFIG_LIBTWOLAME_ENCODER) += libtwolame.o +OBJS-$(CONFIG_LIBTURING_ENCODER) += libturing.o OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o OBJS-$(CONFIG_LIBVORBIS_DECODER) += libvorbisdec.o OBJS-$(CONFIG_LIBVORBIS_ENCODER) += libvorbisenc.o \ diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index ada9481..0e61a4a 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -610,6 +610,7 @@ void avcodec_register_all(void) REGISTER_ENCDEC (LIBSPEEX, libspeex); REGISTER_ENCODER(LIBTHEORA, libtheora); REGISTER_ENCODER(LIBTWOLAME,libtwolame); +REGISTER_ENCODER(LIBTURING, libturing); REGISTER_ENCODER(LIBVO_AMRWBENC,libvo_amrwbenc); REGISTER_ENCDEC (LIBVORBIS, libvorbis); REGISTER_ENCDEC (LIBVPX_VP8,libvpx_vp8); diff --git a/libavcodec/libturing.c b/libavcodec/libturing.c new file mode 100644 index 000..fab17cd --- /dev/null +++ b/libavcodec/libturing.c @@ -0,0 +1,279 @@ +/* + * libturing encoder + * + * Copyright (c) 2016 Turing Codec contributors + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as
Re: [FFmpeg-devel] [PATCH] Fixes for ffmpeg and editorial typos
Please discard this message, I've sent the wrong patch. Sorry ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] examples: fix a typo
On Wed, Nov 30, 2016 at 01:31:58PM +0300, Александр Слободенюк wrote: > --- > doc/examples/transcode_aac.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) applied thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB it is not once nor twice but times without number that the same ideas make their appearance in the world. -- Aristotle signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] Fixes for ffmpeg and editorial typos
- The libturing.pc file is added in CMAKE_INSTALL_PREFIX/lib/pkgconfig and contains some CMAKE variables which get expanded during installation - Fixed some editorial typos and trailing space - Fixed version numbering in the std output - Added function to check for binary option as passed when calling the codec from FFmpeg - Modified boost program options so that an option can be repeated multiple times and only the last value is used --- boost/libs/program_options/src/value_semantic.cpp | 4 +- turing/CMakeLists.txt | 57 -- turing/GetGitRevisionDescription.cmake| 1 + turing/encode.cpp | 59 ++- turing/libturing.pc.in| 11 + turing/turing.h | 2 + 6 files changed, 106 insertions(+), 28 deletions(-) create mode 100644 turing/libturing.pc.in diff --git a/boost/libs/program_options/src/value_semantic.cpp b/boost/libs/program_options/src/value_semantic.cpp index d35d17d..fe129c2 100644 --- a/boost/libs/program_options/src/value_semantic.cpp +++ b/boost/libs/program_options/src/value_semantic.cpp @@ -11,6 +11,7 @@ #include #include +#include namespace boost { namespace program_options { @@ -204,8 +205,7 @@ namespace boost { namespace program_options { void check_first_occurrence(const boost::any& value) { if (!value.empty()) -boost::throw_exception( -multiple_occurrences()); +cerr<<"Warning: multiple values submitted for command line option: "<
Re: [FFmpeg-devel] [PATCH] swscale: add gbr(a)p16 output support
On Thu, Dec 01, 2016 at 10:09:30AM +0100, Paul B Mahol wrote: > On 11/30/16, Paul B Maholwrote: > > Hi, > > > > patch attached, needs fate update. > > > > Updated with fate stuff, please comment attached patch. Tested-by: michael on linux x86 32/64, arm, mips, mingw 32/64 with fate [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Freedom in capitalist society always remains about the same as it was in ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] matroskadec: partly revert "demux relevant subtitle packets after a seek" c16582579b1c6f66a86615c5808cd5b2bf17be73
On Thu, 1 Dec 2016 08:26:44 +0100 Rainer Hocheckerwrote: > We already included this patch in Kodi v17. Dropping this incomplete > feature is much better than living with the downsides. Having files on a > network share is a common use case and in most cases there is no index > anyway: start video and seek forward. Will push this patch in 24 hours, then. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2] ffmpeg: fix uninitialized return value
On Wed, Nov 30, 2016 at 03:26:04PM +0100, Tobias Rapp wrote: > On 22.11.2016 15:34, Tobias Rapp wrote: > >On 22.11.2016 15:06, Michael Niedermayer wrote: > >>On Tue, Nov 22, 2016 at 02:43:57PM +0100, Tobias Rapp wrote: > >>>On 22.11.2016 14:34, Michael Niedermayer wrote: > On Tue, Nov 22, 2016 at 09:16:26AM +0100, Tobias Rapp wrote: > >Signed-off-by: Tobias Rapp> >--- > >ffmpeg.c | 2 +- > >1 file changed, 1 insertion(+), 1 deletion(-) > > do you have a testcase for this ? > >>> > >>>No, I just stumbled over it when reading the code. > >> > >>are you sure that the codepath leaving ret uninitialized is possible ? > >> > >>if not adding a av_assert() may be better > > > >From my quick glance I assumed that ist->nb_filters could be zero and > >the for-loop is not entered. If that should never be the case I agree > >that an added av_assert(ist->nb_filters > 0) would be better. > > I added an assert and it is not triggered when running FATE, see > attached patch. > > Regards, > Tobias > ffmpeg.c |1 + > 1 file changed, 1 insertion(+) > a88ad0978feedd41c833a943b21cb6e954b663e4 > 0001-ffmpeg-assert-return-value-is-initialized.patch > From a270cfdb637a48aca12d492cf4cb72d9200b6024 Mon Sep 17 00:00:00 2001 > From: Tobias Rapp > Date: Thu, 24 Nov 2016 15:45:00 +0100 > Subject: [PATCH 1/2] ffmpeg: assert return value is initialized > > Signed-off-by: Tobias Rapp > --- > ffmpeg.c | 1 + > 1 file changed, 1 insertion(+) applied thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Democracy is the form of government in which you can choose your dictator signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavc/vaapi_h26[45]: add crop info support in vaapi_h26[4, 5]
On Wed, 30 Nov 2016 18:25:59 +0100 Michael Niedermayerwrote: > > > AVFrame had a pan_scan parameter to store one or more croping > > > rectangles. > > > That is now available as side data > > > > > > I remember the intend that this could be used for multiple rectangles > > > of different sizes for example for storing recommanded display > > > rectangles for a 4:3 and a 16:9 display device, but it seems only a > > > single size per frame is supported in the API > > > > > > [...] > > > > This one is very "special" - I don't know if I'd want to further its > > existence. What's it used for at all? > > I only know whats written in the specs, i dont remember having > investigated what real world files do with it, and my knowledge of the > specs is many years old so the spec would be a better place than my > memory of it for further research ... If we're going to have a crop rectangle, lots of code (including many video filters) will need to be able to interpret them. Considering this, the pan scan side data is prohibitively complex. Maybe it accurately reflects some standard (mpeg1/2 apparently?), but I'd say it's not simple enough for general use. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/3] configure: enable autodetected libraries after option parsing
On Thu, Dec 1, 2016 at 12:22 AM, Andreas Cadhalpunwrote: > This is needed for the following patch. > > Signed-off-by: Andreas Cadhalpun > --- > configure | 18 +- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/configure b/configure > index 2ce7555..28c78ef 100755 > --- a/configure > +++ b/configure > @@ -3237,15 +3237,6 @@ enable valgrind_backtrace > sws_max_filter_size_default=256 > set_default sws_max_filter_size > > -# Enable platform codecs by default. > -enable audiotoolbox > - > -# Enable hwaccels by default. > -enable d3d11va dxva2 vaapi vda vdpau videotoolbox_hwaccel xvmc > -enable xlib > - > -enable cuda cuvid nvenc vda_framework videotoolbox videotoolbox_encoder > - > # build settings > SHFLAGS='-shared -Wl,-soname,$$(@F)' > LIBPREF="lib" > @@ -3491,6 +3482,15 @@ for e in $env; do > eval "export $e" > done > > +# Enable platform codecs by default. > +enable audiotoolbox > + > +# Enable hwaccels by default. > +enable d3d11va dxva2 vaapi vda vdpau videotoolbox_hwaccel xvmc > +enable xlib > + > +enable cuda cuvid nvenc vda_framework videotoolbox videotoolbox_encoder > + > disabled logging && logfile=/dev/null > If those are enabled after option parsing, doesn't this then prevent me from turning them off? - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swscale: add gbr(a)p16 output support
On 11/30/16, Paul B Maholwrote: > Hi, > > patch attached, needs fate update. > Updated with fate stuff, please comment attached patch. From 6c0718d0adfd16b262cdc3936048787a10c78d08 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Wed, 30 Nov 2016 22:45:08 +0100 Subject: [PATCH] swscale: add gbr(a)p16 output support Signed-off-by: Paul B Mahol --- libswscale/output.c | 80 +++- libswscale/utils.c | 8 ++-- tests/ref/fate/filter-pixdesc-gbrap16be | 1 + tests/ref/fate/filter-pixdesc-gbrap16le | 1 + tests/ref/fate/filter-pixdesc-gbrp16be | 1 + tests/ref/fate/filter-pixdesc-gbrp16le | 1 + tests/ref/fate/filter-pixfmts-copy | 4 ++ tests/ref/fate/filter-pixfmts-crop | 4 ++ tests/ref/fate/filter-pixfmts-field | 4 ++ tests/ref/fate/filter-pixfmts-fieldorder | 4 ++ tests/ref/fate/filter-pixfmts-hflip | 4 ++ tests/ref/fate/filter-pixfmts-il | 4 ++ tests/ref/fate/filter-pixfmts-lut| 2 + tests/ref/fate/filter-pixfmts-null | 4 ++ tests/ref/fate/filter-pixfmts-pad| 2 + tests/ref/fate/filter-pixfmts-scale | 4 ++ tests/ref/fate/filter-pixfmts-vflip | 4 ++ 17 files changed, 126 insertions(+), 6 deletions(-) create mode 100644 tests/ref/fate/filter-pixdesc-gbrap16be create mode 100644 tests/ref/fate/filter-pixdesc-gbrap16le create mode 100644 tests/ref/fate/filter-pixdesc-gbrp16be create mode 100644 tests/ref/fate/filter-pixdesc-gbrp16le diff --git a/libswscale/output.c b/libswscale/output.c index b0d33b1..ea6b457 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -2022,6 +2022,78 @@ yuv2gbrp_full_X_c(SwsContext *c, const int16_t *lumFilter, } static void +yuv2gbrp16_full_X_c(SwsContext *c, const int16_t *lumFilter, +const int32_t **lumSrc, int lumFilterSize, +const int16_t *chrFilter, const int32_t **chrUSrc, +const int32_t **chrVSrc, int chrFilterSize, +const int16_t **alpSrc, uint8_t **dest, +int dstW, int y) +{ +const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->dstFormat); +int i; +int hasAlpha = (desc->flags & AV_PIX_FMT_FLAG_ALPHA) && alpSrc; +uint16_t **dest16 = (uint16_t**)dest; +int A = 0; // init to silence warning + +for (i = 0; i < dstW; i++) { +int j; +int Y = -0x4000; +int U = -(128 << 23); +int V = -(128 << 23); +int R, G, B; + +for (j = 0; j < lumFilterSize; j++) +Y += lumSrc[j][i] * (unsigned)lumFilter[j]; + +for (j = 0; j < chrFilterSize; j++) { +U += chrUSrc[j][i] * (unsigned)chrFilter[j]; +V += chrVSrc[j][i] * (unsigned)chrFilter[j]; +} + +Y >>= 14; +Y += 0x1; +U >>= 14; +V >>= 14; + +if (hasAlpha) { +A = 1 << 18; + +for (j = 0; j < lumFilterSize; j++) +A += alpSrc[j][i] * lumFilter[j]; + +if (A & 0xF800) +A = av_clip_uintp2(A, 27); +} + +Y -= c->yuv2rgb_y_offset; +Y *= c->yuv2rgb_y_coeff; +Y += 1 << 13; +R = V * c->yuv2rgb_v2r_coeff; +G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff; +B =U * c->yuv2rgb_u2b_coeff; + +R = av_clip_uintp2(Y + R, 30); +G = av_clip_uintp2(Y + G, 30); +B = av_clip_uintp2(Y + B, 30); + +dest16[0][i] = G >> 14; +dest16[1][i] = B >> 14; +dest16[2][i] = R >> 14; +if (hasAlpha) +dest16[3][i] = A >> 11; +} +if ((!isBE(c->dstFormat)) != (!HAVE_BIGENDIAN)) { +for (i = 0; i < dstW; i++) { +dest16[0][i] = av_bswap16(dest16[0][i]); +dest16[1][i] = av_bswap16(dest16[1][i]); +dest16[2][i] = av_bswap16(dest16[2][i]); +if (hasAlpha) +dest16[3][i] = av_bswap16(dest16[3][i]); +} +} +} + +static void yuv2ya8_1_c(SwsContext *c, const int16_t *buf0, const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf0, uint8_t *dest, int dstW, @@ -2402,8 +2474,6 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, case AV_PIX_FMT_GBRP12LE: case AV_PIX_FMT_GBRP14BE: case AV_PIX_FMT_GBRP14LE: -case AV_PIX_FMT_GBRP16BE: -case AV_PIX_FMT_GBRP16LE: case AV_PIX_FMT_GBRAP: case AV_PIX_FMT_GBRAP10BE: case AV_PIX_FMT_GBRAP10LE: @@ -2411,6 +2481,12 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, case AV_PIX_FMT_GBRAP12LE: *yuv2anyX = yuv2gbrp_full_X_c; break; +case AV_PIX_FMT_GBRP16BE: +case AV_PIX_FMT_GBRP16LE: +case AV_PIX_FMT_GBRAP16BE: +case AV_PIX_FMT_GBRAP16LE: +*yuv2anyX =
Re: [FFmpeg-devel] [PATCH 3/3] configure: fail if autodetect-libraries are requested but not found
2016-12-01 0:22 GMT+01:00 Andreas Cadhalpun: > Signed-off-by: Andreas Cadhalpun > --- > configure | 72 > ++- Needs a Changelog and a NEWS entry. Have you tested the patch? It was tried before and the result were different regressions iirc. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavfi:Fix aix compilation
2016-11-29 23:35 GMT+01:00 Paul B Mahol: > On 11/29/16, Carl Eugen Hoyos wrote: >> Hi! >> >> Attached patch fixes aix compilation, similar to 33f5d70d >> >> Please comment, Carl Eugen >> > > should be ok Patch applied. Thank you, Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel