Re: [FFmpeg-devel] [PATCH v4 2/2] avfilter: Add tonemap vaapi filter
> On 11/09/2019 06:39, Zachary Zhou wrote: > > It supports ICL platform. > > H2H (HDR to HDR): P010 -> A2R10G10B10 > > H2S (HDR to SDR): P010 -> ARGB > > The input format doesn't have any alpha so the output shouldn't either. Not > sure what the first case wants, but the second should be AV_PIX_FMT_0RGB (or > some swizzle thereof). Hi Mark, Usually the default alpha is taken as 1.0 when alpha is not specified, so how about setting alpha to 1.0 too when doing P010-> A2R10G10B10/ARGB in this filter? On the other hand, we need to send the output of tonemapping to HDR/SDR display and the HW supports A2R10G10B10/ARGB instead of 0R10G10B10/0RGB. Thanks Haihao > > > --- > > configure | 2 + > > doc/filters.texi | 72 + > > libavfilter/Makefile | 1 + > > libavfilter/allfilters.c | 1 + > > libavfilter/vaapi_vpp.c| 5 + > > libavfilter/vf_tonemap_vaapi.c | 575 + > > 6 files changed, 656 insertions(+) > > create mode 100644 libavfilter/vf_tonemap_vaapi.c > > > > diff --git a/configure b/configure > > index 8413826f9e..c9bd4bfcd8 100755 > > --- a/configure > > +++ b/configure > > @@ -3551,6 +3551,7 @@ tinterlace_merge_test_deps="tinterlace_filter" > > tinterlace_pad_test_deps="tinterlace_filter" > > tonemap_filter_deps="const_nan" > > tonemap_opencl_filter_deps="opencl const_nan" > > +tonemap_vaapi_filter_deps="vaapi > > VAProcPipelineParameterBuffer_output_hdr_metadata" > > transpose_opencl_filter_deps="opencl" > > transpose_vaapi_filter_deps="vaapi VAProcPipelineCaps_rotation_flags" > > unsharp_opencl_filter_deps="opencl" > > @@ -6544,6 +6545,7 @@ if enabled vaapi; then > > > > check_type "va/va.h va/va_dec_hevc.h" "VAPictureParameterBufferHEVC" > > check_struct "va/va.h" "VADecPictureParameterBufferVP9" bit_depth > > +check_struct "va/va.h va/va_vpp.h" "VAProcPipelineParameterBuffer" > > output_hdr_metadata > > check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" rotation_flags > > check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC" > > check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG" > > diff --git a/doc/filters.texi b/doc/filters.texi > > index 9d500e44a9..3a3e259f8d 100644 > > --- a/doc/filters.texi > > +++ b/doc/filters.texi > > @@ -20140,6 +20140,78 @@ Convert HDR(PQ/HLG) video to bt2020-transfer- > > characteristic p010 format using li > > @end example > > @end itemize > > > > +@section tonemap_vappi > > + > > +Perform HDR(High Dynamic Range) to HDR and HDR to SDR conversion with tone- > > mapping. > > +It maps the dynamic range of HDR10 content to the dynamic range of the > > +display panel. > > Does this support anything other than HDR10? (E.g. HLG.) > > > + > > +It accepts the following parameters: > > + > > +@table @option > > +@item type > > +Specify the tone-mapping operator to be used. > > + > > +Possible values are: > > +@table @var > > +@item h2h > > +Perform H2H(HDR to HDR), convert from p010 to r10g10b10a2 > > +@item h2s > > +Perform H2S(HDR to SDR), convert from p010 to argb > > Mentioning the actual formats here is probably confusing. It's 10-bit YUV > 4:2:0 to RGB in 10-bit or 8-bit (with no alpha channel in either case). > > > +@end table > > + > > +@item display > > +Set mastering display metadata for H2H > > I think this is setting the properties of the output for an HDR > display? Please make this clear. > > > + > > +Can assume the following values: > > +@table @var > > +@item G > > +Green primary G(x|y). > > +The value for x and y shall be in the range of 0 to 5 inclusive. > > Make it a fraction rather than using the H.26[45] SEI fixed-point > representation. > > > +@item B > > +Blue primary B(x|y). > > +The value for x and y shall be in the range of 0 to 5 inclusive. > > +@item R > > +Red primary R(x|y). > > +The value for x and y shall be in the range of 0 to 5 inclusive. > > +@item WP > > +White point WP(x|y). > > +The value for x and y shall be in the range of 0 to 5 inclusive. > > +@item L > > +Display mastering luminance L(min|max). > > +The value is in units of 0.0001 candelas per square metre. > > Candelas per square metre (accepting a fractional value) would be clearer. > > > +@end table > > + > > +@item light > > +Set content light level for H2H > > + > > +Can assume the following values: > > +@table @var > > +@item CLL > > +Max content light level. > > +The value is in units of 0.0001 candelas per square metre. > > +@item FALL > > +Max average light level per frame. > > +The value is in units of 0.0001 candelas per square metre. > > Also clearer as a fraction. > > > +@end table > > + > > +@end table > > More generally, I think we probably want to agree on a uniform way to express > these values for filters. A string representation of > AVMasteringDisplayMetadata and AVContentLightMetadata could be used in a > number of different places. > > >
Re: [FFmpeg-devel] [PATCH v5] avfilter/vaapi: add overlay_vaapi filter
> -Original Message- > From: ffmpeg-devel On Behalf Of Zachary Zhou > Sent: Sunday, September 08, 2019 11:51 PM > To: ffmpeg-devel@ffmpeg.org > Cc: Zhou, Zachary > Subject: [FFmpeg-devel] [PATCH v5] avfilter/vaapi: add overlay_vaapi filter > Do you need to set params.pipeline_flags = VA_PROC_PIPELINE_SUBPICTURES somewhere for this to work? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] Support for zulu timezone format for PDT in HLS playlists
> 在 2019年10月22日,18:37,Ole Andre Birkedal 写道: > > Some HLS players prefer UTC+0 timestamps in PROGRAM-DATE-TIME to end in a Z > instead of +, this patch adds a hlsflag to enable that feature. > > Example command: > ffmpeg -i input.mp4 -c copy -hls_flags +program_date_time+zulu_timezone > output.m3u8 > > Example PDT output: > #EXT-X-PROGRAM-DATE-TIME:2019-10-22T10:27:54.000Z > > Ole Andre > Birkedal___ Document doc/muxer.texi please. > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". Thanks Steven ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] Add support for VP9 VDPAU hwaccel decode
On 2019-10-22 05:06, ManojGuptaBonda wrote: Support for VDPAU accelerated VP9 decoding was added with libvdpau-1.3. Support for the same in ffmpeg is added with this patch. Profiles related to VDPAU VP9 can be found in latest vdpau.h present in libvdpau-1.3. DRC clips are not supported yet due to http://trac.ffmpeg.org/ticket/8068 Add VP9 VDPAU to list of hwaccels and supported formats Added file vdpau_vp9.c and Modified configure to add VDPAU VP9 support. Mapped VP9 profiles to VDPAU VP9 profiles. Populated the codec specific params that need to be passed to VDPAU. --- Changelog | 2 +- configure | 3 + libavcodec/Makefile | 1 + libavcodec/hwaccels.h | 1 + libavcodec/vdpau_internal.h | 3 + libavcodec/vdpau_vp9.c | 242 libavcodec/version.h| 2 +- libavcodec/vp9.c| 9 +- 8 files changed, 260 insertions(+), 3 deletions(-) create mode 100644 libavcodec/vdpau_vp9.c Looks good. I will do another sanity check pass and then push in the next few days. Thanks, --phil ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] web/download: general improvements
probably ok On 10/21/19, Lou Logan wrote: > Mention big download button is for source code. > Mention "executable files" for Windows users in subheader. > State that FFmpeg only provides source code. > Rename OS X to macOS. > Remove PPA to EOL Ubuntu Trusty. > Add button to Old Releases. > > Signed-off-by: Lou Logan > --- > src/download | 24 > 1 file changed, 12 insertions(+), 12 deletions(-) > > diff --git a/src/download b/src/download > index ce7e047..a8fdc26 100644 > --- a/src/download > +++ b/src/download > @@ -3,7 +3,7 @@ > > https://ffmpeg.org/releases/ffmpeg-4.2.1.tar.bz2; class="btn > btn-success"> > > - Download > + Download Source Code >ffmpeg-4.2.1.tar.bz2 > > > @@ -26,8 +26,8 @@ > > > > - Get the packages > - > + Get packages executable files > +FFmpeg only provides source code. Below are some links that > provide it already compiled and ready to go. > > > > @@ -60,11 +60,7 @@ > Debian – deb-multimedia packages for > Oldstable, Stable, Testing, Unstable > >https://launchpad.net/ubuntu/+source/ffmpeg; > class="list-group-item"> > -Ubuntu – Official packages for Vivid, > Wily, Xenial > - > - href="https://launchpad.net/~mc3man/+archive/ubuntu/trusty-media; > class="list-group-item"> > -Ubuntu – Ubuntu Multimedia for Trusty PPA. > Provides static binaries > -from most recent release branch. > +Ubuntu – Official packages > >https://rpmfusion.org/;> > Fedora and Red Hat Enterprise > Linux packages > @@ -80,18 +76,18 @@ > > > > -Windows Packages > +Windows EXE Files > > > href="https://ffmpeg.zeranoe.com/builds/;> > -Windows Builds > +Windows builds by Zeranoe > > > > > > > -OS X Packages > +macOS > > > href="https://evermeet.cx/ffmpeg/;> > @@ -541,5 +537,9 @@ libpostproc53. 3.100 > Older versions are available at the Old >Releases page. > > - > + > + > + Get old > releases > + > + > > -- > 2.23.0 > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] aviflter/vf_maskedclamp: add x86 SIMD
On 10/22/2019 2:51 PM, Paul B Mahol wrote: > Signed-off-by: Paul B Mahol > --- > libavfilter/maskedclamp.h | 35 ++ > libavfilter/vf_maskedclamp.c | 18 +++-- > libavfilter/x86/Makefile | 2 + > libavfilter/x86/vf_maskedclamp.asm| 96 +++ > libavfilter/x86/vf_maskedclamp_init.c | 47 + > 5 files changed, 191 insertions(+), 7 deletions(-) > create mode 100644 libavfilter/maskedclamp.h > create mode 100644 libavfilter/x86/vf_maskedclamp.asm > create mode 100644 libavfilter/x86/vf_maskedclamp_init.c > > diff --git a/libavfilter/maskedclamp.h b/libavfilter/maskedclamp.h > new file mode 100644 > index 00..6a1fd9c04b > --- /dev/null > +++ b/libavfilter/maskedclamp.h > @@ -0,0 +1,35 @@ > + /* > + * Copyright (c) 2019 Paul B Mahol > + * > + * This file is part of FFmpeg. > + * > + * FFmpeg is free software; you can redistribute it and/or > + * modify it under the terms of the GNU Lesser General Public > + * License as published by the Free Software Foundation; either > + * version 2.1 of the License, or (at your option) any later version. > + * > + * FFmpeg is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * Lesser General Public License for more details. > + * > + * You should have received a copy of the GNU Lesser General Public > + * License along with FFmpeg; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 > USA > + */ > + > +#ifndef AVFILTER_MASKEDCLAMP_H > +#define AVFILTER_MASKEDCLAMP_H > + > +#include > +#include > + > +typedef struct MaskedClampDSPContext { > +void (*maskedclamp)(const uint8_t *bsrc, uint8_t *dst, > +const uint8_t *darksrc, const uint8_t *brightsrc, > +int w, int undershoot, int overshoot); > +} MaskedClampDSPContext; > + > +void ff_maskedclamp_init_x86(MaskedClampDSPContext *dsp, int depth); > + > +#endif /* AVFILTER_MASKEDCLAMP_H */ > diff --git a/libavfilter/vf_maskedclamp.c b/libavfilter/vf_maskedclamp.c > index 595c8f17fd..97000c7f9d 100644 > --- a/libavfilter/vf_maskedclamp.c > +++ b/libavfilter/vf_maskedclamp.c > @@ -26,6 +26,7 @@ > #include "internal.h" > #include "video.h" > #include "framesync.h" > +#include "maskedclamp.h" > > #define OFFSET(x) offsetof(MaskedClampContext, x) > #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM > @@ -47,9 +48,7 @@ typedef struct MaskedClampContext { > int depth; > FFFrameSync fs; > > -void (*maskedclamp)(const uint8_t *bsrc, uint8_t *dst, > -const uint8_t *darksrc, const uint8_t *brightsrc, > -int w, int undershoot, int overshoot); > +MaskedClampDSPContext dsp; > } MaskedClampContext; > > static const AVOption maskedclamp_options[] = { > @@ -117,7 +116,7 @@ static int maskedclamp_slice(AVFilterContext *ctx, void > *arg, int jobnr, int nb_ > } > > for (y = slice_start; y < slice_end; y++) { > -s->maskedclamp(bsrc, dst, darksrc, brightsrc, w, undershoot, > overshoot); > +s->dsp.maskedclamp(bsrc, dst, darksrc, brightsrc, w, undershoot, > overshoot); > > dst += dlinesize; > bsrc += blinesize; > @@ -210,11 +209,16 @@ static int config_input(AVFilterLink *inlink) > s->width[0] = s->width[3] = inlink->w; > > s->depth = desc->comp[0].depth; > +s->undershoot = FFMIN(s->undershoot, (1 << s->depth) - 1); > +s->overshoot = FFMIN(s->overshoot, (1 << s->depth) - 1); > > -if (desc->comp[0].depth == 8) > -s->maskedclamp = maskedclamp8; > +if (s->depth <= 8) > +s->dsp.maskedclamp = maskedclamp8; > else > -s->maskedclamp = maskedclamp16; > +s->dsp.maskedclamp = maskedclamp16; > + > +if (ARCH_X86) > +ff_maskedclamp_init_x86(>dsp, s->depth); > > return 0; > } > diff --git a/libavfilter/x86/Makefile b/libavfilter/x86/Makefile > index 8d97e46c3f..016a5b3511 100644 > --- a/libavfilter/x86/Makefile > +++ b/libavfilter/x86/Makefile > @@ -17,6 +17,7 @@ OBJS-$(CONFIG_HQDN3D_FILTER) += > x86/vf_hqdn3d_init.o > OBJS-$(CONFIG_IDET_FILTER) += x86/vf_idet_init.o > OBJS-$(CONFIG_INTERLACE_FILTER) += x86/vf_tinterlace_init.o > OBJS-$(CONFIG_LIMITER_FILTER)+= x86/vf_limiter_init.o > +OBJS-$(CONFIG_MASKEDCLAMP_FILTER)+= x86/vf_maskedclamp_init.o > OBJS-$(CONFIG_MASKEDMERGE_FILTER)+= x86/vf_maskedmerge_init.o > OBJS-$(CONFIG_NOISE_FILTER) += x86/vf_noise.o > OBJS-$(CONFIG_OVERLAY_FILTER)+= x86/vf_overlay_init.o > @@ -56,6 +57,7 @@ X86ASM-OBJS-$(CONFIG_HQDN3D_FILTER) += > x86/vf_hqdn3d.o > X86ASM-OBJS-$(CONFIG_IDET_FILTER)
[FFmpeg-devel] [PATCH] aviflter/vf_maskedclamp: add x86 SIMD
Signed-off-by: Paul B Mahol --- libavfilter/maskedclamp.h | 35 ++ libavfilter/vf_maskedclamp.c | 18 +++-- libavfilter/x86/Makefile | 2 + libavfilter/x86/vf_maskedclamp.asm| 96 +++ libavfilter/x86/vf_maskedclamp_init.c | 47 + 5 files changed, 191 insertions(+), 7 deletions(-) create mode 100644 libavfilter/maskedclamp.h create mode 100644 libavfilter/x86/vf_maskedclamp.asm create mode 100644 libavfilter/x86/vf_maskedclamp_init.c diff --git a/libavfilter/maskedclamp.h b/libavfilter/maskedclamp.h new file mode 100644 index 00..6a1fd9c04b --- /dev/null +++ b/libavfilter/maskedclamp.h @@ -0,0 +1,35 @@ + /* + * Copyright (c) 2019 Paul B Mahol + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFILTER_MASKEDCLAMP_H +#define AVFILTER_MASKEDCLAMP_H + +#include +#include + +typedef struct MaskedClampDSPContext { +void (*maskedclamp)(const uint8_t *bsrc, uint8_t *dst, +const uint8_t *darksrc, const uint8_t *brightsrc, +int w, int undershoot, int overshoot); +} MaskedClampDSPContext; + +void ff_maskedclamp_init_x86(MaskedClampDSPContext *dsp, int depth); + +#endif /* AVFILTER_MASKEDCLAMP_H */ diff --git a/libavfilter/vf_maskedclamp.c b/libavfilter/vf_maskedclamp.c index 595c8f17fd..97000c7f9d 100644 --- a/libavfilter/vf_maskedclamp.c +++ b/libavfilter/vf_maskedclamp.c @@ -26,6 +26,7 @@ #include "internal.h" #include "video.h" #include "framesync.h" +#include "maskedclamp.h" #define OFFSET(x) offsetof(MaskedClampContext, x) #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM @@ -47,9 +48,7 @@ typedef struct MaskedClampContext { int depth; FFFrameSync fs; -void (*maskedclamp)(const uint8_t *bsrc, uint8_t *dst, -const uint8_t *darksrc, const uint8_t *brightsrc, -int w, int undershoot, int overshoot); +MaskedClampDSPContext dsp; } MaskedClampContext; static const AVOption maskedclamp_options[] = { @@ -117,7 +116,7 @@ static int maskedclamp_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_ } for (y = slice_start; y < slice_end; y++) { -s->maskedclamp(bsrc, dst, darksrc, brightsrc, w, undershoot, overshoot); +s->dsp.maskedclamp(bsrc, dst, darksrc, brightsrc, w, undershoot, overshoot); dst += dlinesize; bsrc += blinesize; @@ -210,11 +209,16 @@ static int config_input(AVFilterLink *inlink) s->width[0] = s->width[3] = inlink->w; s->depth = desc->comp[0].depth; +s->undershoot = FFMIN(s->undershoot, (1 << s->depth) - 1); +s->overshoot = FFMIN(s->overshoot, (1 << s->depth) - 1); -if (desc->comp[0].depth == 8) -s->maskedclamp = maskedclamp8; +if (s->depth <= 8) +s->dsp.maskedclamp = maskedclamp8; else -s->maskedclamp = maskedclamp16; +s->dsp.maskedclamp = maskedclamp16; + +if (ARCH_X86) +ff_maskedclamp_init_x86(>dsp, s->depth); return 0; } diff --git a/libavfilter/x86/Makefile b/libavfilter/x86/Makefile index 8d97e46c3f..016a5b3511 100644 --- a/libavfilter/x86/Makefile +++ b/libavfilter/x86/Makefile @@ -17,6 +17,7 @@ OBJS-$(CONFIG_HQDN3D_FILTER) += x86/vf_hqdn3d_init.o OBJS-$(CONFIG_IDET_FILTER) += x86/vf_idet_init.o OBJS-$(CONFIG_INTERLACE_FILTER) += x86/vf_tinterlace_init.o OBJS-$(CONFIG_LIMITER_FILTER)+= x86/vf_limiter_init.o +OBJS-$(CONFIG_MASKEDCLAMP_FILTER)+= x86/vf_maskedclamp_init.o OBJS-$(CONFIG_MASKEDMERGE_FILTER)+= x86/vf_maskedmerge_init.o OBJS-$(CONFIG_NOISE_FILTER) += x86/vf_noise.o OBJS-$(CONFIG_OVERLAY_FILTER)+= x86/vf_overlay_init.o @@ -56,6 +57,7 @@ X86ASM-OBJS-$(CONFIG_HQDN3D_FILTER) += x86/vf_hqdn3d.o X86ASM-OBJS-$(CONFIG_IDET_FILTER)+= x86/vf_idet.o X86ASM-OBJS-$(CONFIG_INTERLACE_FILTER) += x86/vf_interlace.o X86ASM-OBJS-$(CONFIG_LIMITER_FILTER) += x86/vf_limiter.o +X86ASM-OBJS-$(CONFIG_MASKEDCLAMP_FILTER) += x86/vf_maskedclamp.o X86ASM-OBJS-$(CONFIG_MASKEDMERGE_FILTER) += x86/vf_maskedmerge.o
Re: [FFmpeg-devel] [PATCH] x86/vf_transpose: make ff_transpose_8x8_16_sse2 work on x86_32
On 10/22/2019 1:25 PM, Paul B Mahol wrote: > probably ok Applied, thanks. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] x86/vf_transpose: make ff_transpose_8x8_16_sse2 work on x86_32
probably ok On 10/21/19, James Almer wrote: > Signed-off-by: James Almer > --- > libavfilter/x86/vf_transpose.asm| 11 +-- > libavfilter/x86/vf_transpose_init.c | 2 +- > 2 files changed, 6 insertions(+), 7 deletions(-) > > diff --git a/libavfilter/x86/vf_transpose.asm > b/libavfilter/x86/vf_transpose.asm > index f9f585369a..c532c899ee 100644 > --- a/libavfilter/x86/vf_transpose.asm > +++ b/libavfilter/x86/vf_transpose.asm > @@ -56,10 +56,7 @@ cglobal transpose_8x8_8, 4,5,8, src, src_linesize, dst, > dst_linesize, linesize3 > movq [dstq + linesize3q], m7 > RET > > -%if ARCH_X86_64 > - > -INIT_XMM sse2 > -cglobal transpose_8x8_16, 4,5,9, src, src_linesize, dst, dst_linesize, > linesize3 > +cglobal transpose_8x8_16, 4,5,9, ARCH_X86_32 * 32, src, src_linesize, dst, > dst_linesize, linesize3 > lea linesize3q, [src_linesizeq * 3] > movum0, [srcq + src_linesizeq * 0] > movum1, [srcq + src_linesizeq * 1] > @@ -71,7 +68,11 @@ cglobal transpose_8x8_16, 4,5,9, src, src_linesize, dst, > dst_linesize, linesize3 > movum6, [srcq + src_linesizeq * 2] > movum7, [srcq + linesize3q] > > +%if ARCH_X86_64 > TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, 8 > +%else > +TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, [rsp], [rsp + 16] > +%endif > > lea linesize3q, [dst_linesizeq * 3] > movu [dstq + dst_linesizeq * 0], m0 > @@ -84,5 +85,3 @@ cglobal transpose_8x8_16, 4,5,9, src, src_linesize, dst, > dst_linesize, linesize3 > movu [dstq + dst_linesizeq * 2], m6 > movu [dstq + linesize3q], m7 > RET > - > -%endif > diff --git a/libavfilter/x86/vf_transpose_init.c > b/libavfilter/x86/vf_transpose_init.c > index f1a9cd058b..6bb9908725 100644 > --- a/libavfilter/x86/vf_transpose_init.c > +++ b/libavfilter/x86/vf_transpose_init.c > @@ -43,7 +43,7 @@ av_cold void ff_transpose_init_x86(TransVtable *v, int > pixstep) > v->transpose_8x8 = ff_transpose_8x8_8_sse2; > } > > -if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags) && pixstep == 2) { > +if (EXTERNAL_SSE2(cpu_flags) && pixstep == 2) { > v->transpose_8x8 = ff_transpose_8x8_16_sse2; > } > } > -- > 2.23.0 > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2] avcodec/libdav1d: fix setting AVFrame reordered_opaque
On Tue, Oct 22, 2019 at 4:51 PM Andrey Semashev wrote: > > On 2019-10-22 17:14, Andrey Semashev wrote: > > On 2019-10-22 17:09, James Almer wrote: > >> On 10/22/2019 11:01 AM, Andrey Semashev wrote: > >>> On 2019-10-18 02:18, James Almer wrote: > Actually reorder the values. > > Should effectively fix ticket #8300. > > Signed-off-by: James Almer > --- > Now unconditionally propagating the field, since checking its value is > not correct usage of the field. > >>> > >>> James, do you still plan working on this patch? > >> > >> Yes, but i have no way to test it. Can you confirm the current > >> implementation in the tree misbehaves, and that this approach corrects > >> it? > > > > No, I don't have a test video file that would cause frame reordering. At > > least I don't think any of my files cause it. > > > > I tried my v3 patch with the files I have, it worked as intended. > > Actually, no, one of the files causes a delay for one frame, so I can > test it. Delay automatically happens if you use frame-threaded decoding, its not something in the bitstream. - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2] avcodec/libdav1d: fix setting AVFrame reordered_opaque
On 10/22/2019 11:51 AM, Andrey Semashev wrote: > On 2019-10-22 17:14, Andrey Semashev wrote: >> On 2019-10-22 17:09, James Almer wrote: >>> On 10/22/2019 11:01 AM, Andrey Semashev wrote: On 2019-10-18 02:18, James Almer wrote: > Actually reorder the values. > > Should effectively fix ticket #8300. > > Signed-off-by: James Almer > --- > Now unconditionally propagating the field, since checking its value is > not correct usage of the field. James, do you still plan working on this patch? >>> >>> Yes, but i have no way to test it. Can you confirm the current >>> implementation in the tree misbehaves, and that this approach >>> corrects it? >> >> No, I don't have a test video file that would cause frame reordering. >> At least I don't think any of my files cause it. >> >> I tried my v3 patch with the files I have, it worked as intended. > > Actually, no, one of the files causes a delay for one frame, so I can > test it. Your v2 and my v3 patches work (i.e. the decoded > reordered_opaque lags behind input pts for one frame). Ok, patch applied then. Thanks for testing. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 1/4] avcodec/sonic: Check e in get_symbol()
This code is dead and nonfunctional and should be removed ASAP! On 10/22/19, Michael Niedermayer wrote: > Fixes: signed integer overflow: 1721520852 + 1721520852 cannot be > represented in type 'int' > Fixes: > 18346/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5709623893426176 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/sonic.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c > index 34d2952e69..b890d79c28 100644 > --- a/libavcodec/sonic.c > +++ b/libavcodec/sonic.c > @@ -144,6 +144,8 @@ static inline av_flatten int get_symbol(RangeCoder *c, > uint8_t *state, int is_si > e= 0; > while(get_rac(c, state+1 + FFMIN(e,9))){ //1..10 > e++; > +if (e > 31) > +return AVERROR_INVALIDDATA; > } > > a= 1; > -- > 2.23.0 > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2] avcodec/libdav1d: fix setting AVFrame reordered_opaque
On 2019-10-22 17:14, Andrey Semashev wrote: On 2019-10-22 17:09, James Almer wrote: On 10/22/2019 11:01 AM, Andrey Semashev wrote: On 2019-10-18 02:18, James Almer wrote: Actually reorder the values. Should effectively fix ticket #8300. Signed-off-by: James Almer --- Now unconditionally propagating the field, since checking its value is not correct usage of the field. James, do you still plan working on this patch? Yes, but i have no way to test it. Can you confirm the current implementation in the tree misbehaves, and that this approach corrects it? No, I don't have a test video file that would cause frame reordering. At least I don't think any of my files cause it. I tried my v3 patch with the files I have, it worked as intended. Actually, no, one of the files causes a delay for one frame, so I can test it. Your v2 and my v3 patches work (i.e. the decoded reordered_opaque lags behind input pts for one frame). ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 2/4] avcodec/sonic: Fix integer overflow in predictor_calc_error()
Fixes: signed integer overflow: 5 * -1094995529 cannot be represented in type 'int' Fixes: 18346/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5709623893426176 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/sonic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index b890d79c28..c975774b04 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -475,7 +475,7 @@ static int predictor_calc_error(int *k, int *state, int order, int error) { int k_value = *k_ptr, state_value = *state_ptr; x -= shift_down(k_value * state_value, LATTICE_SHIFT); -state_ptr[1] = state_value + shift_down(k_value * x, LATTICE_SHIFT); +state_ptr[1] = state_value + shift_down(k_value * (unsigned)x, LATTICE_SHIFT); } #else for (i = order-2; i >= 0; i--) -- 2.23.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 3/4] avcodec/sbcdec: Fix integer overflows in sbc_synthesize_four()
Fixes: signed integer overflow: 1494495519 + 1494495519 cannot be represented in type 'int' Fixes: 18347/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SBC_fuzzer-5711714661695488 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/sbcdec.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/libavcodec/sbcdec.c b/libavcodec/sbcdec.c index 23226d5155..d8ea6855fe 100644 --- a/libavcodec/sbcdec.c +++ b/libavcodec/sbcdec.c @@ -227,10 +227,10 @@ static inline void sbc_synthesize_four(struct sbc_decoder_state *state, /* Distribute the new matrix value to the shifted position */ v[offset[i]] = -( ff_synmatrix4[i][0] * frame->sb_sample[blk][ch][0] + - ff_synmatrix4[i][1] * frame->sb_sample[blk][ch][1] + - ff_synmatrix4[i][2] * frame->sb_sample[blk][ch][2] + - ff_synmatrix4[i][3] * frame->sb_sample[blk][ch][3] ) >> 15; +(int)( (unsigned)ff_synmatrix4[i][0] * frame->sb_sample[blk][ch][0] + + (unsigned)ff_synmatrix4[i][1] * frame->sb_sample[blk][ch][1] + + (unsigned)ff_synmatrix4[i][2] * frame->sb_sample[blk][ch][2] + + (unsigned)ff_synmatrix4[i][3] * frame->sb_sample[blk][ch][3] ) >> 15; } /* Compute the samples */ @@ -239,16 +239,16 @@ static inline void sbc_synthesize_four(struct sbc_decoder_state *state, /* Store in output, Q0 */ AV_WN16A(_frame->data[ch][blk * 8 + i * 2], av_clip_int16( -( v[offset[i] + 0] * ff_sbc_proto_4_40m0[idx + 0] + - v[offset[k] + 1] * ff_sbc_proto_4_40m1[idx + 0] + - v[offset[i] + 2] * ff_sbc_proto_4_40m0[idx + 1] + - v[offset[k] + 3] * ff_sbc_proto_4_40m1[idx + 1] + - v[offset[i] + 4] * ff_sbc_proto_4_40m0[idx + 2] + - v[offset[k] + 5] * ff_sbc_proto_4_40m1[idx + 2] + - v[offset[i] + 6] * ff_sbc_proto_4_40m0[idx + 3] + - v[offset[k] + 7] * ff_sbc_proto_4_40m1[idx + 3] + - v[offset[i] + 8] * ff_sbc_proto_4_40m0[idx + 4] + - v[offset[k] + 9] * ff_sbc_proto_4_40m1[idx + 4] ) >> 15)); + (int)( (unsigned)v[offset[i] + 0] * ff_sbc_proto_4_40m0[idx + 0] + +(unsigned)v[offset[k] + 1] * ff_sbc_proto_4_40m1[idx + 0] + +(unsigned)v[offset[i] + 2] * ff_sbc_proto_4_40m0[idx + 1] + +(unsigned)v[offset[k] + 3] * ff_sbc_proto_4_40m1[idx + 1] + +(unsigned)v[offset[i] + 4] * ff_sbc_proto_4_40m0[idx + 2] + +(unsigned)v[offset[k] + 5] * ff_sbc_proto_4_40m1[idx + 2] + +(unsigned)v[offset[i] + 6] * ff_sbc_proto_4_40m0[idx + 3] + +(unsigned)v[offset[k] + 7] * ff_sbc_proto_4_40m1[idx + 3] + +(unsigned)v[offset[i] + 8] * ff_sbc_proto_4_40m0[idx + 4] + +(unsigned)v[offset[k] + 9] * ff_sbc_proto_4_40m1[idx + 4] ) >> 15)); } } -- 2.23.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 4/4] avcodec/twinvq: Check block_align
Fixes: signed integer overflow: 538976288 * 8 cannot be represented in type 'int' Fixes: 18348/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_METASOUND_fuzzer-6681325716635648 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/twinvq.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/libavcodec/twinvq.c b/libavcodec/twinvq.c index 7b2e19e536..34ca1846b9 100644 --- a/libavcodec/twinvq.c +++ b/libavcodec/twinvq.c @@ -771,23 +771,26 @@ av_cold int ff_twinvq_decode_init(AVCodecContext *avctx) { int ret; TwinVQContext *tctx = avctx->priv_data; +int64_t frames_per_packet; tctx->avctx = avctx; avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; if (!avctx->block_align) { avctx->block_align = tctx->frame_size + 7 >> 3; -} else if (avctx->block_align * 8 < tctx->frame_size) { -av_log(avctx, AV_LOG_ERROR, "Block align is %d bits, expected %d\n", - avctx->block_align * 8, tctx->frame_size); +} +frames_per_packet = avctx->block_align * 8LL / tctx->frame_size; +if (frames_per_packet <= 0) { +av_log(avctx, AV_LOG_ERROR, "Block align is %"PRId64" bits, expected %d\n", + avctx->block_align * (int64_t)8, tctx->frame_size); return AVERROR_INVALIDDATA; } -tctx->frames_per_packet = avctx->block_align * 8 / tctx->frame_size; -if (tctx->frames_per_packet > TWINVQ_MAX_FRAMES_PER_PACKET) { -av_log(avctx, AV_LOG_ERROR, "Too many frames per packet (%d)\n", - tctx->frames_per_packet); +if (frames_per_packet > TWINVQ_MAX_FRAMES_PER_PACKET) { +av_log(avctx, AV_LOG_ERROR, "Too many frames per packet (%"PRId64")\n", + frames_per_packet); return AVERROR_INVALIDDATA; } +tctx->frames_per_packet = frames_per_packet; tctx->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); if (!tctx->fdsp) { -- 2.23.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 1/4] avcodec/sonic: Check e in get_symbol()
Fixes: signed integer overflow: 1721520852 + 1721520852 cannot be represented in type 'int' Fixes: 18346/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5709623893426176 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/sonic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index 34d2952e69..b890d79c28 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -144,6 +144,8 @@ static inline av_flatten int get_symbol(RangeCoder *c, uint8_t *state, int is_si e= 0; while(get_rac(c, state+1 + FFMIN(e,9))){ //1..10 e++; +if (e > 31) +return AVERROR_INVALIDDATA; } a= 1; -- 2.23.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2] avcodec/libdav1d: fix setting AVFrame reordered_opaque
On 2019-10-22 17:09, James Almer wrote: On 10/22/2019 11:01 AM, Andrey Semashev wrote: On 2019-10-18 02:18, James Almer wrote: Actually reorder the values. Should effectively fix ticket #8300. Signed-off-by: James Almer --- Now unconditionally propagating the field, since checking its value is not correct usage of the field. James, do you still plan working on this patch? Yes, but i have no way to test it. Can you confirm the current implementation in the tree misbehaves, and that this approach corrects it? No, I don't have a test video file that would cause frame reordering. At least I don't think any of my files cause it. I tried my v3 patch with the files I have, it worked as intended. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2] avcodec/libdav1d: fix setting AVFrame reordered_opaque
On 10/22/2019 11:01 AM, Andrey Semashev wrote: > On 2019-10-18 02:18, James Almer wrote: >> Actually reorder the values. >> >> Should effectively fix ticket #8300. >> >> Signed-off-by: James Almer >> --- >> Now unconditionally propagating the field, since checking its value is >> not correct usage of the field. > > James, do you still plan working on this patch? Yes, but i have no way to test it. Can you confirm the current implementation in the tree misbehaves, and that this approach corrects it? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2] avcodec/libdav1d: fix setting AVFrame reordered_opaque
On 2019-10-18 02:18, James Almer wrote: Actually reorder the values. Should effectively fix ticket #8300. Signed-off-by: James Almer --- Now unconditionally propagating the field, since checking its value is not correct usage of the field. James, do you still plan working on this patch? libavcodec/libdav1d.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c index 8aa248e6cd..1793c9e4f0 100644 --- a/libavcodec/libdav1d.c +++ b/libavcodec/libdav1d.c @@ -164,6 +164,11 @@ static void libdav1d_data_free(const uint8_t *data, void *opaque) { av_buffer_unref(); } +static void libdav1d_user_data_free(const uint8_t *data, void *opaque) { +av_assert2(data == opaque); +av_free(opaque); +} + static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) { Libdav1dContext *dav1d = c->priv_data; @@ -179,6 +184,8 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) return res; if (pkt.size) { +uint8_t *reordered_opaque; + res = dav1d_data_wrap(data, pkt.data, pkt.size, libdav1d_data_free, pkt.buf); if (res < 0) { av_packet_unref(); @@ -191,6 +198,21 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) pkt.buf = NULL; av_packet_unref(); + +reordered_opaque = av_malloc(sizeof(c->reordered_opaque)); +if (!reordered_opaque) { +dav1d_data_unref(data); +return AVERROR(ENOMEM); +} + +memcpy(reordered_opaque, >reordered_opaque, sizeof(c->reordered_opaque)); +res = dav1d_data_wrap_user_data(data, reordered_opaque, +libdav1d_user_data_free, reordered_opaque); +if (res < 0) { +av_free(reordered_opaque); +dav1d_data_unref(data); +return res; +} } } @@ -260,7 +282,8 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) else frame->format = c->pix_fmt = pix_fmt[p->p.layout][p->seq_hdr->hbd]; -frame->reordered_opaque = c->reordered_opaque; +av_assert0(p->m.user_data.data); +memcpy(>reordered_opaque, p->m.user_data.data, sizeof(frame->reordered_opaque)); // match timestamps and packet size frame->pts = frame->best_effort_timestamp = p->m.timestamp; ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avcodec/atrac9tab: use explicit ATRAC9BlockConfig struct initializers
On 10/22/2019 10:46 AM, Lynne wrote: > Oct 22, 2019, 14:01 by jamr...@gmail.com: > Cosmetic change. > > Signed-off-by: James Almer > --- > libavcodec/atrac9tab.h | 79 ++ > 1 file changed, 33 insertions(+), 46 deletions(-) > > lgtm Applied, thanks. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avcodec/atrac9tab: use explicit ATRAC9BlockConfig struct initializers
Oct 22, 2019, 14:01 by jamr...@gmail.com: Cosmetic change. Signed-off-by: James Almer --- libavcodec/atrac9tab.h | 79 ++ 1 file changed, 33 insertions(+), 46 deletions(-) lgtm ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 3/5] avformat/mpeg: Avoid allocation and fix memleak I
vobsub_read_header() uses an AVBPrint to write a string and up until now, it collected the string stored in the AVBPrint via av_bprint_finalize(), which might involve an allocation and copy of the string. But this is unnecessary, as the lifetime of the returned string does not exceed the lifetime of the AVBPrint. So use the string in the AVBPrint directly. This also makes it possible to easily fix a memleak: In certain error situations, the string stored in the AVBPrint would not be freed (if it was dynamically allocated). This has been fixed, too. Signed-off-by: Andreas Rheinhardt --- I guess that this is the memleak that 0b8956b2 intended to fix!? libavformat/mpeg.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index 46c59163fd..e6bc6700de 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -720,7 +720,6 @@ static int vobsub_read_header(AVFormatContext *s) int i, ret = 0, header_parsed = 0, langidx = 0; MpegDemuxContext *vobsub = s->priv_data; size_t fname_len; -char *header_str = NULL; AVBPrint header; int64_t delay = 0; AVStream *st = NULL; @@ -733,8 +732,7 @@ static int vobsub_read_header(AVFormatContext *s) char *ext; vobsub->sub_name = av_strdup(s->url); if (!vobsub->sub_name) { -ret = AVERROR(ENOMEM); -goto end; +return AVERROR(ENOMEM); } fname_len = strlen(vobsub->sub_name); @@ -742,24 +740,23 @@ static int vobsub_read_header(AVFormatContext *s) if (fname_len < 4 || *(ext - 1) != '.') { av_log(s, AV_LOG_ERROR, "The input index filename is too short " "to guess the associated .SUB file\n"); -ret = AVERROR_INVALIDDATA; -goto end; +return AVERROR_INVALIDDATA; } memcpy(ext, !strncmp(ext, "IDX", 3) ? "SUB" : "sub", 3); av_log(s, AV_LOG_VERBOSE, "IDX/SUB: %s -> %s\n", s->url, vobsub->sub_name); } if (!(iformat = av_find_input_format("mpeg"))) { -ret = AVERROR_DEMUXER_NOT_FOUND; -goto end; +return AVERROR_DEMUXER_NOT_FOUND; } vobsub->sub_ctx = avformat_alloc_context(); if (!vobsub->sub_ctx) { -ret = AVERROR(ENOMEM); -goto end; +return AVERROR(ENOMEM); } +av_bprint_init(, 0, INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE); + if ((ret = ff_copy_whiteblacklists(vobsub->sub_ctx, s)) < 0) goto end; @@ -769,7 +766,6 @@ static int vobsub_read_header(AVFormatContext *s) goto end; } -av_bprint_init(, 0, INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE); while (!avio_feof(s->pb)) { char line[MAX_LINE_SIZE]; int len = ff_get_line(s->pb, line, sizeof(line)); @@ -890,22 +886,20 @@ static int vobsub_read_header(AVFormatContext *s) } if (!av_bprint_is_complete()) { -av_bprint_finalize(, NULL); ret = AVERROR(ENOMEM); goto end; } -av_bprint_finalize(, _str); for (i = 0; i < s->nb_streams; i++) { AVCodecParameters *par = s->streams[i]->codecpar; ret = ff_alloc_extradata(par, header.len); if (ret < 0) { goto end; } -memcpy(par->extradata, header_str, header.len); +memcpy(par->extradata, header.str, header.len); } end: -av_free(header_str); +av_bprint_finalize(, NULL); return ret; } -- 2.20.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 4/5] avformat/mpeg: Fix memleak II
If an error happens in vobsub_read_header() after allocating the AVFormatContext intended to read the sub-file, both the AVFormatContext as well as the data in the subtitles queues leaks. This has been fixed. Signed-off-by: Andreas Rheinhardt --- libavformat/mpeg.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index e6bc6700de..73ade71d95 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -715,6 +715,18 @@ static int vobsub_probe(const AVProbeData *p) return 0; } +static int vobsub_read_close(AVFormatContext *s) +{ +int i; +MpegDemuxContext *vobsub = s->priv_data; + +for (i = 0; i < s->nb_streams; i++) +ff_subtitles_queue_clean(>q[i]); +if (vobsub->sub_ctx) +avformat_close_input(>sub_ctx); +return 0; +} + static int vobsub_read_header(AVFormatContext *s) { int i, ret = 0, header_parsed = 0, langidx = 0; @@ -898,7 +910,8 @@ static int vobsub_read_header(AVFormatContext *s) memcpy(par->extradata, header.str, header.len); } end: - +if (ret < 0) +vobsub_read_close(s); av_bprint_finalize(, NULL); return ret; } @@ -1023,18 +1036,6 @@ static int vobsub_read_seek(AVFormatContext *s, int stream_index, min_ts, ts, max_ts, flags); } -static int vobsub_read_close(AVFormatContext *s) -{ -int i; -MpegDemuxContext *vobsub = s->priv_data; - -for (i = 0; i < s->nb_streams; i++) -ff_subtitles_queue_clean(>q[i]); -if (vobsub->sub_ctx) -avformat_close_input(>sub_ctx); -return 0; -} - static const AVOption options[] = { { "sub_name", "URI for .sub file", offsetof(MpegDemuxContext, sub_name), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, AV_OPT_FLAG_DECODING_PARAM }, { NULL } -- 2.20.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 1/5] avformat/mpeg: Don't free unintialized pointer
In order to fix a potential memleak upon failure, 0b8956b2 made sure that a buffer given by a pointer was freed upon error. But this pointer was only initialized upon use and in several cases (Clang gives no fewer than 13 -Wsometimes-uninitialized warnings) this meant that an uninitialized pointer was used to free a buffer. So initialize the pointer. Signed-off-by: Andreas Rheinhardt --- Was 0b8956b2 ever sent to the ML before it got pushed? I couldn't find it. And what does CID mean? libavformat/mpeg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index c33401f1a0..ebc064931a 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -720,7 +720,7 @@ static int vobsub_read_header(AVFormatContext *s) int i, ret = 0, header_parsed = 0, langidx = 0; MpegDemuxContext *vobsub = s->priv_data; size_t fname_len; -char *header_str; +char *header_str = NULL; AVBPrint header; int64_t delay = 0; AVStream *st = NULL; -- 2.20.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 5/5] avformat/mpeg: Don't use unintialized value
vobsub_read_packet() didn't check whether an index in array of AVPackets was valid and therefore used uninitialized values. Signed-off-by: Andreas Rheinhardt --- Actually I only wanted to use Valgrind to check for memleaks... libavformat/mpeg.c | 4 1 file changed, 4 insertions(+) diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index 73ade71d95..474afd06b9 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -930,6 +930,10 @@ static int vobsub_read_packet(AVFormatContext *s, AVPacket *pkt) FFDemuxSubtitlesQueue *tmpq = >q[i]; int64_t ts; av_assert0(tmpq->nb_subs); + +if (tmpq->current_sub_idx >= tmpq->nb_subs) +continue; + ts = tmpq->subs[tmpq->current_sub_idx].pts; if (ts < min_ts) { min_ts = ts; -- 2.20.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 2/5] avformat/mpeg: Add padding to extradata
Extradata is supposed to be padded with AV_INPUT_BUFFER_PADDING_SIZE bytes, yet the VobSub demuxer used av_strdup for the allocation of extradata. This has been changed. Signed-off-by: Andreas Rheinhardt --- I did not change the extradata_size in order to explicitly include a zero byte; i.e. the first byte of the padding is the zero byte ending the string. This is just like now. libavformat/mpeg.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index ebc064931a..46c59163fd 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -769,7 +769,7 @@ static int vobsub_read_header(AVFormatContext *s) goto end; } -av_bprint_init(, 0, AV_BPRINT_SIZE_UNLIMITED); +av_bprint_init(, 0, INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE); while (!avio_feof(s->pb)) { char line[MAX_LINE_SIZE]; int len = ff_get_line(s->pb, line, sizeof(line)); @@ -896,14 +896,12 @@ static int vobsub_read_header(AVFormatContext *s) } av_bprint_finalize(, _str); for (i = 0; i < s->nb_streams; i++) { -AVStream *sub_st = s->streams[i]; -sub_st->codecpar->extradata = av_strdup(header_str); -if (!sub_st->codecpar->extradata) { -ret = AVERROR(ENOMEM); -sub_st->codecpar->extradata_size = 0; +AVCodecParameters *par = s->streams[i]->codecpar; +ret = ff_alloc_extradata(par, header.len); +if (ret < 0) { goto end; } -sub_st->codecpar->extradata_size = header.len; +memcpy(par->extradata, header_str, header.len); } end: -- 2.20.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avfilter: add gmsd filter
On 10/22/2019 10:02 AM, Paul B Mahol wrote: > +static av_cold int init(AVFilterContext *ctx) > +{ > +GMSDContext *s = ctx->priv; > + > +if (s->stats_file_str) { > +if (!strcmp(s->stats_file_str, "-")) { > +s->stats_file = stdout; > +} else { > +s->stats_file = fopen(s->stats_file_str, "w"); You could use av_fopen_utf8() instead. > +if (!s->stats_file) { > +int err = AVERROR(errno); > +char buf[128]; > +av_strerror(err, buf, sizeof(buf)); > +av_log(ctx, AV_LOG_ERROR, "Could not open stats file %s: > %s\n", > + s->stats_file_str, buf); > +return err; > +} > +} > +} > + > +s->fs.on_event = do_gmsd; > + > +return 0; > +} ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH] avcodec/atrac9tab: use explicit ATRAC9BlockConfig struct initializers
Cosmetic change. Signed-off-by: James Almer --- libavcodec/atrac9tab.h | 79 ++ 1 file changed, 33 insertions(+), 46 deletions(-) diff --git a/libavcodec/atrac9tab.h b/libavcodec/atrac9tab.h index d25c6f1b7f..8f290f158c 100644 --- a/libavcodec/atrac9tab.h +++ b/libavcodec/atrac9tab.h @@ -41,61 +41,48 @@ typedef struct ATRAC9BlockConfig { static const ATRAC9BlockConfig at9_block_layout[] = { { /* Mono */ -AV_CH_LAYOUT_MONO, -{ -ATRAC9_BLOCK_TYPE_SCE, -}, -{ { 0 }, }, -1, +.channel_layout = AV_CH_LAYOUT_MONO, +.type= { ATRAC9_BLOCK_TYPE_SCE, }, +.count = 1, }, { /* Dual Mono */ -AV_CH_LAYOUT_STEREO, -{ -ATRAC9_BLOCK_TYPE_SCE, -ATRAC9_BLOCK_TYPE_SCE, -}, -{ { 0 }, { 1 }, }, -2, +.channel_layout = AV_CH_LAYOUT_STEREO, +.type= { ATRAC9_BLOCK_TYPE_SCE, + ATRAC9_BLOCK_TYPE_SCE, }, +.plane_map = { { 0 }, { 1 }, }, +.count = 2, }, { /* Stereo */ -AV_CH_LAYOUT_STEREO, -{ -ATRAC9_BLOCK_TYPE_CPE, -}, -{ { 0, 1 }, }, -1, +.channel_layout = AV_CH_LAYOUT_STEREO, +.type= { ATRAC9_BLOCK_TYPE_CPE, }, +.plane_map = { { 0, 1 }, }, +.count = 1, }, { /* 5.1 */ -AV_CH_LAYOUT_5POINT1, -{ -ATRAC9_BLOCK_TYPE_CPE, -ATRAC9_BLOCK_TYPE_SCE, -ATRAC9_BLOCK_TYPE_LFE, -ATRAC9_BLOCK_TYPE_CPE, -}, -{ { 0, 1 }, { 2 }, { 3 }, { 4, 5 }, }, -4, +.channel_layout = AV_CH_LAYOUT_5POINT1, +.type= { ATRAC9_BLOCK_TYPE_CPE, + ATRAC9_BLOCK_TYPE_SCE, + ATRAC9_BLOCK_TYPE_LFE, + ATRAC9_BLOCK_TYPE_CPE, }, +.plane_map = { { 0, 1 }, { 2 }, { 3 }, { 4, 5 }, }, +.count = 4, }, -{ /* 5.1 */ -AV_CH_LAYOUT_7POINT1, -{ -ATRAC9_BLOCK_TYPE_CPE, -ATRAC9_BLOCK_TYPE_SCE, -ATRAC9_BLOCK_TYPE_LFE, -ATRAC9_BLOCK_TYPE_CPE, -ATRAC9_BLOCK_TYPE_CPE, -}, -{ { 0, 1 }, { 2 }, { 3 }, { 4, 5 }, { 6, 7 }, }, -5, +{ /* 7.1 */ +.channel_layout = AV_CH_LAYOUT_7POINT1, +.type= { ATRAC9_BLOCK_TYPE_CPE, + ATRAC9_BLOCK_TYPE_SCE, + ATRAC9_BLOCK_TYPE_LFE, + ATRAC9_BLOCK_TYPE_CPE, + ATRAC9_BLOCK_TYPE_CPE, }, +.plane_map = { { 0, 1 }, { 2 }, { 3 }, { 4, 5 }, { 6, 7 }, }, +.count = 5, }, { /* Quad */ -AV_CH_LAYOUT_QUAD, -{ -ATRAC9_BLOCK_TYPE_CPE, -ATRAC9_BLOCK_TYPE_CPE, -}, -{ { 0, 1 }, { 2, 3 }, }, -2, +.channel_layout = AV_CH_LAYOUT_QUAD, +.type= { ATRAC9_BLOCK_TYPE_CPE, + ATRAC9_BLOCK_TYPE_CPE, }, +.plane_map = { { 0, 1 }, { 2, 3 }, }, +.count = 2, }, }; -- 2.23.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH] avfilter: add gmsd filter
Signed-off-by: Paul B Mahol --- doc/filters.texi | 58 ++ libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/vf_gmsd.c| 376 +++ 4 files changed, 436 insertions(+) create mode 100644 libavfilter/vf_gmsd.c diff --git a/doc/filters.texi b/doc/filters.texi index 7400e7dd31..dcb98f772b 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -11152,6 +11152,64 @@ geq=lum=255*gauss((X/W-0.5)*3)*gauss((Y/H-0.5)*3)/gauss(0)/gauss(0),format=gray @end example @end itemize +@section gmsd + +Obtain the GMSD (Gradient Magnitude Similarity Deviation) between two input videos. + +This filter takes in input two input videos, the first input is +considered the "main" source and is passed unchanged to the +output. The second input is used as a "reference" video for computing +the GMSD. + +Both video inputs must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. + +The filter stores the calculated GMSD of each frame. + +The description of the accepted parameters follows. + +@table @option +@item stats_file, f +If specified the filter will use the named file to save the SSIM of +each individual frame. When filename equals "-" the data is sent to +standard output. +@end table + +The file printed if @var{stats_file} is selected, contains a sequence of +key/value pairs of the form @var{key}:@var{value} for each compared +couple of frames. + +A description of each shown parameter follows: + +@table @option +@item n +sequential number of the input frame, starting from 1 + +@item Y, U, V, R, G, B +GMSD of the compared frames for the component specified by the suffix. + +@item All +GMSD of the compared frames for the whole frame. +@end table + +This filter also supports the @ref{framesync} options. + +For example: +@example +movie=ref_movie.mpg, setpts=PTS-STARTPTS [main]; +[main][ref] gmsd="stats_file=stats.log" [out] +@end example + +On this example the input file being processed is compared with the +reference file @file{ref_movie.mpg}. The GMSD of each individual frame +is stored in @file{stats.log}. + +Another example with both gmsd and ssim at same time: +@example +ffmpeg -i main.mpg -i ref.mpg -lavfi "ssim;[0:v][1:v]gmsd" -f null - +@end example + @section gradfun Fix the banding artifacts that are sometimes introduced into nearly flat diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 63d2fba861..d966b9532b 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -256,6 +256,7 @@ OBJS-$(CONFIG_FREI0R_FILTER) += vf_frei0r.o OBJS-$(CONFIG_FSPP_FILTER) += vf_fspp.o OBJS-$(CONFIG_GBLUR_FILTER) += vf_gblur.o OBJS-$(CONFIG_GEQ_FILTER)+= vf_geq.o +OBJS-$(CONFIG_GMSD_FILTER) += vf_gmsd.o framesync.o OBJS-$(CONFIG_GRADFUN_FILTER)+= vf_gradfun.o OBJS-$(CONFIG_GRAPHMONITOR_FILTER) += f_graphmonitor.o OBJS-$(CONFIG_GREYEDGE_FILTER) += vf_colorconstancy.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index e4186f93db..d98c5971ac 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -241,6 +241,7 @@ extern AVFilter ff_vf_frei0r; extern AVFilter ff_vf_fspp; extern AVFilter ff_vf_gblur; extern AVFilter ff_vf_geq; +extern AVFilter ff_vf_gmsd; extern AVFilter ff_vf_gradfun; extern AVFilter ff_vf_graphmonitor; extern AVFilter ff_vf_greyedge; diff --git a/libavfilter/vf_gmsd.c b/libavfilter/vf_gmsd.c new file mode 100644 index 00..894e079fa7 --- /dev/null +++ b/libavfilter/vf_gmsd.c @@ -0,0 +1,376 @@ +/* + * Copyright (c) 2019 Paul B Mahol + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* + * @file + * Caculate the GMSD between two input videos. + */ + +#include "libavutil/avstring.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" +#include "avfilter.h" +#include "drawutils.h" +#include "formats.h" +#include "framesync.h" +#include "internal.h" +#include "video.h" + +typedef struct GMSDContext { +const AVClass *class; +FFFrameSync fs; +FILE *stats_file; +char *stats_file_str;
[FFmpeg-devel] Motion vectors implementation for HEVC
Hi all, I am intersting on extracting motion vectors in the HEVC decoder, get it from the side_data of the decoded frame like we doing in the h.264, good example is the extarct_mvs.c file . So i will be glad if someone will give me the entry points for : - Is there a reason why this is not implement in the HEVC decoder? - If i want to start develop it inside the hevcdec.c, do you have good starting point? - Good document beside the "ITU-T H.265" ? Thanks in advanced, Asaf ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH] Add support for VP9 VDPAU hwaccel decode
Support for VDPAU accelerated VP9 decoding was added with libvdpau-1.3. Support for the same in ffmpeg is added with this patch. Profiles related to VDPAU VP9 can be found in latest vdpau.h present in libvdpau-1.3. DRC clips are not supported yet due to http://trac.ffmpeg.org/ticket/8068 Add VP9 VDPAU to list of hwaccels and supported formats Added file vdpau_vp9.c and Modified configure to add VDPAU VP9 support. Mapped VP9 profiles to VDPAU VP9 profiles. Populated the codec specific params that need to be passed to VDPAU. --- Changelog | 2 +- configure | 3 + libavcodec/Makefile | 1 + libavcodec/hwaccels.h | 1 + libavcodec/vdpau_internal.h | 3 + libavcodec/vdpau_vp9.c | 242 libavcodec/version.h| 2 +- libavcodec/vp9.c| 9 +- 8 files changed, 260 insertions(+), 3 deletions(-) create mode 100644 libavcodec/vdpau_vp9.c diff --git a/Changelog b/Changelog index 44e41848b2..88feb2a415 100644 --- a/Changelog +++ b/Changelog @@ -16,7 +16,7 @@ version : - photosensitivity filter - anlms filter - arnndn filter - +- VDPAU VP9 hwaccel version 4.2: - tpad filter diff --git a/configure b/configure index 8413826f9e..7f63eebc9d 100755 --- a/configure +++ b/configure @@ -2979,6 +2979,8 @@ vp9_nvdec_hwaccel_deps="nvdec" vp9_nvdec_hwaccel_select="vp9_decoder" vp9_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferVP9_bit_depth" vp9_vaapi_hwaccel_select="vp9_decoder" +vp9_vdpau_hwaccel_deps="vdpau VdpPictureInfoVP9" +vp9_vdpau_hwaccel_select="vp9_decoder" wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel" wmv3_d3d11va2_hwaccel_select="vc1_d3d11va2_hwaccel" wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel" @@ -6093,6 +6095,7 @@ check_type "windows.h d3d11.h" "ID3D11VideoContext" check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602 check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC" +check_type "vdpau/vdpau.h" "VdpPictureInfoVP9" if [ -z "$nvccflags" ]; then nvccflags=$nvccflags_default diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 37a84a6bb4..34c3a22116 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -913,6 +913,7 @@ OBJS-$(CONFIG_VP9_D3D11VA_HWACCEL)+= dxva2_vp9.o OBJS-$(CONFIG_VP9_DXVA2_HWACCEL) += dxva2_vp9.o OBJS-$(CONFIG_VP9_NVDEC_HWACCEL) += nvdec_vp9.o OBJS-$(CONFIG_VP9_VAAPI_HWACCEL) += vaapi_vp9.o +OBJS-$(CONFIG_VP9_VDPAU_HWACCEL) += vdpau_vp9.o OBJS-$(CONFIG_VP8_QSV_HWACCEL)+= qsvdec_other.o # libavformat dependencies diff --git a/libavcodec/hwaccels.h b/libavcodec/hwaccels.h index 7d73da8676..6109c89bd6 100644 --- a/libavcodec/hwaccels.h +++ b/libavcodec/hwaccels.h @@ -68,6 +68,7 @@ extern const AVHWAccel ff_vp9_d3d11va2_hwaccel; extern const AVHWAccel ff_vp9_dxva2_hwaccel; extern const AVHWAccel ff_vp9_nvdec_hwaccel; extern const AVHWAccel ff_vp9_vaapi_hwaccel; +extern const AVHWAccel ff_vp9_vdpau_hwaccel; extern const AVHWAccel ff_wmv3_d3d11va_hwaccel; extern const AVHWAccel ff_wmv3_d3d11va2_hwaccel; extern const AVHWAccel ff_wmv3_dxva2_hwaccel; diff --git a/libavcodec/vdpau_internal.h b/libavcodec/vdpau_internal.h index 1ee38dbc55..b6ea078cb2 100644 --- a/libavcodec/vdpau_internal.h +++ b/libavcodec/vdpau_internal.h @@ -54,6 +54,9 @@ union VDPAUPictureInfo { #ifdef VDP_YCBCR_FORMAT_Y_U_V_444 VdpPictureInfoHEVC444 hevc_444; #endif +#ifdef VDP_DECODER_PROFILE_VP9_PROFILE_0 +VdpPictureInfoVP9vp9; +#endif }; typedef struct VDPAUHWContext { diff --git a/libavcodec/vdpau_vp9.c b/libavcodec/vdpau_vp9.c new file mode 100644 index 00..f1ee4ac5e0 --- /dev/null +++ b/libavcodec/vdpau_vp9.c @@ -0,0 +1,242 @@ +/* + * VP9 HW decode acceleration through VDPAU + * + * Copyright (c) 2019 Manoj Gupta Bonda + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include "libavutil/pixdesc.h" +#include "avcodec.h" +#include "internal.h" +#include "vp9data.h" +#include "vp9dec.h" +#include "hwaccel.h" +#include "vdpau.h" +#include "vdpau_internal.h" + +static int vdpau_vp9_start_frame(AVCodecContext *avctx, + const uint8_t *buffer, uint32_t size) +{ +VP9Context *s
[FFmpeg-devel] [PATCH] Support for zulu timezone format for PDT in HLS playlists
Some HLS players prefer UTC+0 timestamps in PROGRAM-DATE-TIME to end in a Z instead of +, this patch adds a hlsflag to enable that feature. Example command: ffmpeg -i input.mp4 -c copy -hls_flags +program_date_time+zulu_timezone output.m3u8 Example PDT output: #EXT-X-PROGRAM-DATE-TIME:2019-10-22T10:27:54.000Z Ole Andre Birkedal zulu_timezone.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".