Re: [FFmpeg-devel] [PATCH] ffmpeg: add -drop_deviant_frames option

2019-04-01 Thread Gyan



On 01-04-2019 10:23 AM, Gyan wrote:



On 27-03-2019 08:26 PM, Gyan wrote:

Weird. Attached corrected patch.

Thanks.


Ping.


Plan to push tomorrow evening.

Gyan
___
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 4/9] vp9_parser: Return stream properties

2019-04-01 Thread Li, Zhong
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Mark Thompson
> Sent: Tuesday, April 2, 2019 7:40 AM
> To: ffmpeg-devel@ffmpeg.org
> Subject: [FFmpeg-devel] [PATCH v2 4/9] vp9_parser: Return stream
> properties
> 
> Rewrites the parser entirely, using CBS for header parsing.
> ---
>  libavcodec/vp9_parser.c | 112 +---
>  1 file changed, 82 insertions(+), 30 deletions(-)
> 
> diff --git a/libavcodec/vp9_parser.c b/libavcodec/vp9_parser.c index
> c957a75667..6bf4f30e80 100644
> --- a/libavcodec/vp9_parser.c
> +++ b/libavcodec/vp9_parser.c
> @@ -1,8 +1,5 @@
>  /*
> - * VP9 compatible video decoder
> - *
> - * Copyright (C) 2013 Ronald S. Bultje 
> - * Copyright (C) 2013 Clément Bœsch 
> + * VP9 parser
>   *
>   * This file is part of FFmpeg.
>   *
> @@ -21,50 +18,105 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
> USA
>   */
> 
> -#include "libavutil/intreadwrite.h"
> -#include "libavcodec/get_bits.h"
> +#include "libavutil/avassert.h"
> +#include "cbs.h"
> +#include "cbs_vp9.h"
>  #include "parser.h"
> 
> -static int parse(AVCodecParserContext *ctx,
> - AVCodecContext *avctx,
> - const uint8_t **out_data, int *out_size,
> - const uint8_t *data, int size)
> +typedef struct VP9ParserContext {
> +CodedBitstreamContext *cbc;
> +VP9RawFrameHeader frame_header;
> +} VP9ParserContext;
> +
> +static const enum AVPixelFormat vp9_pix_fmts[3][2][2] = {
> +{ // 8-bit.
> +{ AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P },
> +{ AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P },
> +},
> +{ // 10-bit.
> +{ AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV440P10 },
> +{ AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV420P10 },
> +},
> +{ // 12-bit.
> +{ AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12 },
> +{ AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV420P12 },
> +},
> +};
> +
> +static int vp9_parser_parse(AVCodecParserContext *ctx,
> +AVCodecContext *avctx,
> +const uint8_t **out_data, int *out_size,
> +const uint8_t *data, int size)
>  {
> -GetBitContext gb;
> -int res, profile, keyframe;
> +VP9ParserContext *s = ctx->priv_data;
> +const CodedBitstreamVP9Context *vp9 = s->cbc->priv_data;
> +const VP9RawFrameHeader *fh;
> +int err;
> 
>  *out_data = data;
>  *out_size = size;
> 
> -if (!size || (res = init_get_bits8(, data, size)) < 0)
> -return size; // parsers can't return errors
> -get_bits(, 2); // frame marker
> -profile  = get_bits1();
> -profile |= get_bits1() << 1;
> -if (profile == 3) profile += get_bits1();
> -if (profile > 3)
> -return size;
> +ctx->key_frame = -1;
> +ctx->pict_type = AV_PICTURE_TYPE_NONE;
> +ctx->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN;
> 
> -avctx->profile = profile;
> +if (!size)
> +return 0;
> 
> -if (get_bits1()) {
> -keyframe = 0;
> -} else {
> -keyframe  = !get_bits1();
> +s->cbc->log_ctx = avctx;
> +
> +err = ff_cbs_parse_headers(s->cbc, >frame_header, data, size);
> +if (err < 0) {
> +av_log(avctx, AV_LOG_WARNING, "Failed to parse VP9 frame
> headers.\n");
> +goto end;
>  }
> +fh = >frame_header;
> 
> -if (!keyframe) {
> -ctx->pict_type = AV_PICTURE_TYPE_P;
> -ctx->key_frame = 0;
> -} else {
> +avctx->profile = vp9->profile;
> +avctx->level   = FF_LEVEL_UNKNOWN;
> +
> +ctx->width  = ctx->coded_width  = vp9->frame_width;
> +ctx->height = ctx->coded_height = vp9->frame_height;
> +
> +if (fh->frame_type == VP9_KEY_FRAME) {
>  ctx->pict_type = AV_PICTURE_TYPE_I;
>  ctx->key_frame = 1;
> +} else {
> +ctx->pict_type = fh->intra_only ? AV_PICTURE_TYPE_I :
> AV_PICTURE_TYPE_P;
> +ctx->key_frame = 0;
>  }
> 
> +ctx->picture_structure = AV_PICTURE_STRUCTURE_FRAME;
> +
> +av_assert0(vp9->bit_depth == 8  ||
> +   vp9->bit_depth == 10 ||
> +   vp9->bit_depth == 12);
> +
> +ctx->format = vp9_pix_fmts[(vp9->bit_depth - 8) / 2]
> +
> [vp9->subsampling_x][vp9->subsampling_y];
> +
> +end:
> +s->cbc->log_ctx = NULL;
> +
>  return size;
>  }
> 
> +static av_cold int vp9_parser_init(AVCodecParserContext *ctx) {
> +VP9ParserContext *s = ctx->priv_data;
> +return ff_cbs_init(>cbc, AV_CODEC_ID_VP9, NULL); }
> +
> +static av_cold void vp9_parser_close(AVCodecParserContext *ctx) {
> +VP9ParserContext *s = ctx->priv_data;
> +ff_cbs_close(>cbc);
> +}
> +
>  AVCodecParser ff_vp9_parser = {
>  .codec_ids  = { AV_CODEC_ID_VP9 },
> -.parser_parse   = parse,
> +.priv_data_size = sizeof(VP9ParserContext),
> +.parser_init= _parser_init,
> +.parser_close   = _parser_close,
> +.parser_parse   = _parser_parse,
>  

Re: [FFmpeg-devel] [PATCH] configure: include pkgconfig path as vaapi header search

2019-04-01 Thread Song, Ruiling


> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of
> Dennis Mungai
> Sent: Thursday, March 28, 2019 7:11 AM
> To: FFmpeg development discussions and patches 
> Subject: Re: [FFmpeg-devel] [PATCH] configure: include pkgconfig path as vaapi
> header search
> 
> On Thu, 28 Mar 2019 at 02:05, Mark Thompson  wrote:
> 
> > On 20/03/2019 07:57, Zhong Li wrote:
> > > Currectly just standard header path and be found,
> > > check_type/struct will fail if vaapi is installed somewhere else.
> > > ---
> > >  configure | 18 ++
> > >  1 file changed, 10 insertions(+), 8 deletions(-)
> > >
> > > diff --git a/configure b/configure
> > > index eaf543df96..0e3c2d24bf 100755
> > > --- a/configure
> > > +++ b/configure
> > > @@ -6024,14 +6024,6 @@ check_type "windows.h d3d11.h"
> > "ID3D11VideoDecoder"
> > >  check_type "windows.h d3d11.h" "ID3D11VideoContext"
> > >  check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode
> > -D_WIN32_WINNT=0x0602
> > >
> > > -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" "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"
> > > -check_type "va/va.h va/va_enc_vp8.h"  "VAEncPictureParameterBufferVP8"
> > > -check_type "va/va.h va/va_enc_vp9.h"  "VAEncPictureParameterBufferVP9"
> > > -
> > >  check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
> > >
> > >  if enabled cuda_sdk; then
> > > @@ -6469,6 +6461,16 @@ if enabled vaapi; then
> > >  check_cpp_condition vaapi_1 "va/va.h" "VA_CHECK_VERSION(1, 0, 0)"
> > >  fi
> > >
> > > +if enabled vaapi; then
> >
> > Merge this into the previous block, which has the same condition.
> >
> > > +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" "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"
> > > +check_type "va/va.h va/va_enc_vp8.h"
> > "VAEncPictureParameterBufferVP8"
> > > +check_type "va/va.h va/va_enc_vp9.h"
> > "VAEncPictureParameterBufferVP9"
> > > +fi
> > > +
> > >  if enabled_all opencl libdrm ; then
> > >  check_type "CL/cl_intel.h" "clCreateImageFromFdINTEL_fn" &&
> > >  enable opencl_drm_beignet
> > >
> >
> > LGTM with that.
> >
> > Thanks,
> >
> > - Mark
> >
> >
> Does a similar check exist for Intel's Neo OpenCL runtime?
I find that Neo does not install a intel-opencl.pc. I guess the reason is that 
Neo is designed to be loaded by OpenCL ICD. So a pkg_check seems not possible.
Currently FFmpeg only checks against cl_va_api_media_sharing_intel.h header 
file. Which acts similar way as checking against Beignet.
For example, on Ubuntu 18.04, the opencl-c-headers shipped is version 2.2, 
which already includes this specific header file.
If you configure FFmpeg with --enable-opencl. And also install Neo and 
intel-media-driver. Then everything should work.
The only thing you need take care is both Neo and intel-media-driver depends on 
gmmlib. So you should choose matching gmmlib version and intel-media-driver 
version that will work with Neo release.

Ruiling
> ___
> 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".

[FFmpeg-devel] [PATCH v1] libavf/movenc: Fix indent

2019-04-01 Thread Jun Li
---
 libavformat/movenc.c | 144 +--
 1 file changed, 72 insertions(+), 72 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 26cb2e6ea1..9f05d48733 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5544,87 +5544,87 @@ err:
 
 static int mov_write_single_packet(AVFormatContext *s, AVPacket *pkt)
 {
-MOVMuxContext *mov = s->priv_data;
-MOVTrack *trk = >tracks[pkt->stream_index];
-AVCodecParameters *par = trk->par;
-int64_t frag_duration = 0;
-int size = pkt->size;
-
-int ret = check_pkt(s, pkt);
-if (ret < 0)
-return ret;
+MOVMuxContext *mov = s->priv_data;
+MOVTrack *trk = >tracks[pkt->stream_index];
+AVCodecParameters *par = trk->par;
+int64_t frag_duration = 0;
+int size = pkt->size;
 
-if (mov->flags & FF_MOV_FLAG_FRAG_DISCONT) {
-int i;
-for (i = 0; i < s->nb_streams; i++)
-mov->tracks[i].frag_discont = 1;
-mov->flags &= ~FF_MOV_FLAG_FRAG_DISCONT;
-}
+int ret = check_pkt(s, pkt);
+if (ret < 0)
+return ret;
 
-if (mov->flags & FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS) {
-if (trk->dts_shift == AV_NOPTS_VALUE)
-trk->dts_shift = pkt->pts - pkt->dts;
-pkt->dts += trk->dts_shift;
-}
+if (mov->flags & FF_MOV_FLAG_FRAG_DISCONT) {
+int i;
+for (i = 0; i < s->nb_streams; i++)
+mov->tracks[i].frag_discont = 1;
+mov->flags &= ~FF_MOV_FLAG_FRAG_DISCONT;
+}
 
-if (trk->par->codec_id == AV_CODEC_ID_MP4ALS ||
-trk->par->codec_id == AV_CODEC_ID_AAC ||
-trk->par->codec_id == AV_CODEC_ID_AV1 ||
-trk->par->codec_id == AV_CODEC_ID_FLAC) {
-int side_size = 0;
-uint8_t *side = av_packet_get_side_data(pkt, 
AV_PKT_DATA_NEW_EXTRADATA, _size);
-if (side && side_size > 0 && (side_size != par->extradata_size || 
memcmp(side, par->extradata, side_size))) {
-void *newextra = av_mallocz(side_size + 
AV_INPUT_BUFFER_PADDING_SIZE);
-if (!newextra)
-return AVERROR(ENOMEM);
-av_free(par->extradata);
-par->extradata = newextra;
-memcpy(par->extradata, side, side_size);
-par->extradata_size = side_size;
-if (!pkt->size) // Flush packet
-mov->need_rewrite_extradata = 1;
-}
-}
+if (mov->flags & FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS) {
+if (trk->dts_shift == AV_NOPTS_VALUE)
+trk->dts_shift = pkt->pts - pkt->dts;
+pkt->dts += trk->dts_shift;
+}
 
-if (!pkt->size) {
-if (trk->start_dts == AV_NOPTS_VALUE && trk->frag_discont) {
-trk->start_dts = pkt->dts;
-if (pkt->pts != AV_NOPTS_VALUE)
-trk->start_cts = pkt->pts - pkt->dts;
-else
-trk->start_cts = 0;
-}
+if (trk->par->codec_id == AV_CODEC_ID_MP4ALS ||
+trk->par->codec_id == AV_CODEC_ID_AAC ||
+trk->par->codec_id == AV_CODEC_ID_AV1 ||
+trk->par->codec_id == AV_CODEC_ID_FLAC) {
+int side_size = 0;
+uint8_t *side = av_packet_get_side_data(pkt, 
AV_PKT_DATA_NEW_EXTRADATA, _size);
+if (side && side_size > 0 && (side_size != par->extradata_size || 
memcmp(side, par->extradata, side_size))) {
+void *newextra = av_mallocz(side_size + 
AV_INPUT_BUFFER_PADDING_SIZE);
+if (!newextra)
+return AVERROR(ENOMEM);
+av_free(par->extradata);
+par->extradata = newextra;
+memcpy(par->extradata, side, side_size);
+par->extradata_size = side_size;
+if (!pkt->size) // Flush packet
+mov->need_rewrite_extradata = 1;
+}
+}
 
-return 0; /* Discard 0 sized packets */
+if (!pkt->size) {
+if (trk->start_dts == AV_NOPTS_VALUE && trk->frag_discont) {
+trk->start_dts = pkt->dts;
+if (pkt->pts != AV_NOPTS_VALUE)
+trk->start_cts = pkt->pts - pkt->dts;
+else
+trk->start_cts = 0;
 }
 
-if (trk->entry && pkt->stream_index < s->nb_streams)
-frag_duration = av_rescale_q(pkt->dts - trk->cluster[0].dts,
- 
s->streams[pkt->stream_index]->time_base,
- AV_TIME_BASE_Q);
-if ((mov->max_fragment_duration &&
- frag_duration >= mov->max_fragment_duration) ||
- (mov->max_fragment_size && mov->mdat_size + size >= 
mov->max_fragment_size) ||
- (mov->flags & FF_MOV_FLAG_FRAG_KEYFRAME &&
-  par->codec_type == AVMEDIA_TYPE_VIDEO &&
-  trk->entry && pkt->flags & 

Re: [FFmpeg-devel] [PATCH] lavfi: add nlmeans_opencl filter

2019-04-01 Thread Song, Ruiling



> Can you supply some details performance data ? 

On my i7-6770HQ, the nlmeans take 1.2s to process one 1080p frame.
And nlmeans_opencl take 500ms to process one frame.

Ruiling
___
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/qtrle: Check how much of the chunk is available before decoding

2019-04-01 Thread Michael Niedermayer
Fixes: Timeout (10sec -> 2sec)
Fixes: 
13979/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QTRLE_fuzzer-5635157718990848

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/qtrle.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c
index 1613530e02..2c29547e5a 100644
--- a/libavcodec/qtrle.c
+++ b/libavcodec/qtrle.c
@@ -452,7 +452,7 @@ static int qtrle_decode_frame(AVCodecContext *avctx,
 int header, start_line;
 int height, row_ptr;
 int has_palette = 0;
-int ret;
+int ret, size;
 
 bytestream2_init(>g, avpkt->data, avpkt->size);
 
@@ -461,7 +461,10 @@ static int qtrle_decode_frame(AVCodecContext *avctx,
 return avpkt->size;
 
 /* start after the chunk size */
-bytestream2_seek(>g, 4, SEEK_SET);
+size = bytestream2_get_be32(>g) & 0x3FFF;
+if (size - avpkt->size >  size * 
(int64_t)avctx->discard_damaged_percentage / 100)
+return AVERROR_INVALIDDATA;
+
 
 /* fetch the header */
 header = bytestream2_get_be16(>g);
-- 
2.21.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 v2 3/9] cbs_vp9: Fill context information for show-existing-frame

2019-04-01 Thread Mark Thompson
The frame being shown could have different properties to the last-decoded
one.
---
 libavcodec/cbs_vp9.h |  3 +++
 libavcodec/cbs_vp9_syntax_template.c | 23 +++
 2 files changed, 26 insertions(+)

diff --git a/libavcodec/cbs_vp9.h b/libavcodec/cbs_vp9.h
index 4c9b2f880d..c637c0d346 100644
--- a/libavcodec/cbs_vp9.h
+++ b/libavcodec/cbs_vp9.h
@@ -182,11 +182,14 @@ typedef struct VP9RawSuperframe {
 } VP9RawSuperframe;
 
 typedef struct VP9ReferenceFrameState {
+int valid;
 int frame_width;// RefFrameWidth
 int frame_height;   // RefFrameHeight
 int subsampling_x;  // RefSubsamplingX
 int subsampling_y;  // RefSubsamplingY
 int bit_depth;  // RefBitDepth
+int frame_type;
+int intra_only;
 } VP9ReferenceFrameState;
 
 typedef struct CodedBitstreamVP9Context {
diff --git a/libavcodec/cbs_vp9_syntax_template.c 
b/libavcodec/cbs_vp9_syntax_template.c
index 898cede329..811f5c12ce 100644
--- a/libavcodec/cbs_vp9_syntax_template.c
+++ b/libavcodec/cbs_vp9_syntax_template.c
@@ -290,10 +290,30 @@ static int 
FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
 
 f(1, show_existing_frame);
 if (current->show_existing_frame) {
+VP9ReferenceFrameState *ref;
+
 f(3, frame_to_show_map_idx);
+ref = >ref[current->frame_to_show_map_idx];
+if (!ref->valid) {
+av_log(ctx->log_ctx, AV_LOG_ERROR,
+   "Missing reference frame needed to show existing frame "
+   "(frame_to_show_map_idx = %d).\n",
+   current->frame_to_show_map_idx);
+return AVERROR_INVALIDDATA;
+}
+
+vp9->frame_width   = ref->frame_width;
+vp9->frame_height  = ref->frame_height;
+vp9->subsampling_x = ref->subsampling_x;
+vp9->subsampling_y = ref->subsampling_y;
+vp9->bit_depth = ref->bit_depth;
+infer(frame_type, ref->frame_type);
+infer(intra_only, ref->intra_only);
+
 infer(header_size_in_bytes, 0);
 infer(refresh_frame_flags,  0x00);
 infer(loop_filter_level,0);
+
 return 0;
 }
 
@@ -374,11 +394,14 @@ static int 
FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
 for (i = 0; i < VP9_NUM_REF_FRAMES; i++) {
 if (current->refresh_frame_flags & (1 << i)) {
 vp9->ref[i] = (VP9ReferenceFrameState) {
+.valid  = 1,
 .frame_width= vp9->frame_width,
 .frame_height   = vp9->frame_height,
 .subsampling_x  = vp9->subsampling_x,
 .subsampling_y  = vp9->subsampling_y,
 .bit_depth  = vp9->bit_depth,
+.frame_type = current->frame_type,
+.intra_only = current->intra_only,
 };
 }
 }
-- 
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 1/3] avcodec/cbs_av1: add support for Padding OBUs

2019-04-01 Thread James Almer
On 4/1/2019 7:47 PM, Mark Thompson wrote:
> On 25/03/2019 14:22, James Almer wrote:
>> Based on itut_t35 Matadata OBU parsing code.
>>
>> Signed-off-by: James Almer 
>> ---
>>  libavcodec/cbs_av1.c | 20 +
>>  libavcodec/cbs_av1.h |  7 ++
>>  libavcodec/cbs_av1_syntax_template.c | 32 
>>  3 files changed, 59 insertions(+)
>>
>> diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c
>> index 02f168b58d..22330eabf3 100644
>> --- a/libavcodec/cbs_av1.c
>> +++ b/libavcodec/cbs_av1.c
>> @@ -857,6 +857,11 @@ static void cbs_av1_free_tile_data(AV1RawTileData *td)
>>  av_buffer_unref(>data_ref);
>>  }
>>  
>> +static void cbs_av1_free_padding(AV1RawPadding *pd)
>> +{
>> +av_buffer_unref(>payload_ref);
>> +}
>> +
>>  static void cbs_av1_free_metadata(AV1RawMetadata *md)
>>  {
>>  switch (md->metadata_type) {
>> @@ -883,6 +888,9 @@ static void cbs_av1_free_obu(void *unit, uint8_t 
>> *content)
>>  case AV1_OBU_METADATA:
>>  cbs_av1_free_metadata(>obu.metadata);
>>  break;
>> +case AV1_OBU_PADDING:
>> +cbs_av1_free_padding(>obu.padding);
>> +break;
>>  }
>>  
>>  av_freep();
>> @@ -1057,6 +1065,12 @@ static int cbs_av1_read_unit(CodedBitstreamContext 
>> *ctx,
>>  }
>>  break;
>>  case AV1_OBU_PADDING:
>> +{
>> +err = cbs_av1_read_padding(ctx, , >obu.padding);
>> +if (err < 0)
>> +return err;
>> +}
>> +break;
>>  default:
>>  return AVERROR(ENOSYS);
>>  }
>> @@ -1182,6 +1196,12 @@ static int cbs_av1_write_obu(CodedBitstreamContext 
>> *ctx,
>>  }
>>  break;
>>  case AV1_OBU_PADDING:
>> +{
>> +err = cbs_av1_write_padding(ctx, pbc, >obu.padding);
>> +if (err < 0)
>> +return err;
>> +}
>> +break;
>>  default:
>>  return AVERROR(ENOSYS);
>>  }
>> diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h
>> index 71ceff9427..e799964b72 100644
>> --- a/libavcodec/cbs_av1.h
>> +++ b/libavcodec/cbs_av1.h
>> @@ -364,6 +364,12 @@ typedef struct AV1RawMetadata {
>>  } metadata;
>>  } AV1RawMetadata;
>>  
>> +typedef struct AV1RawPadding {
>> +uint8_t *payload;
>> +size_t   payload_size;
>> +AVBufferRef *payload_ref;
>> +} AV1RawPadding;
>> +
>>  
>>  typedef struct AV1RawOBU {
>>  AV1RawOBUHeader header;
>> @@ -377,6 +383,7 @@ typedef struct AV1RawOBU {
>>  AV1RawTileGroup  tile_group;
>>  AV1RawTileList   tile_list;
>>  AV1RawMetadata   metadata;
>> +AV1RawPaddingpadding;
>>  } obu;
>>  } AV1RawOBU;
>>  
>> diff --git a/libavcodec/cbs_av1_syntax_template.c 
>> b/libavcodec/cbs_av1_syntax_template.c
>> index 76eb90b279..a6cafdd99f 100644
>> --- a/libavcodec/cbs_av1_syntax_template.c
>> +++ b/libavcodec/cbs_av1_syntax_template.c
>> @@ -1763,3 +1763,35 @@ static int FUNC(metadata_obu)(CodedBitstreamContext 
>> *ctx, RWContext *rw,
>>  
>>  return 0;
>>  }
>> +
>> +static int FUNC(padding)(CodedBitstreamContext *ctx, RWContext *rw,
>> + AV1RawPadding *current)
>> +{
>> +int i, err;
>> +
>> +HEADER("Padding");
>> +
>> +#ifdef READ
>> +// The payload runs up to the start of the trailing bits, but there 
>> might
>> +// be arbitrarily many trailing zeroes so we need to read through twice.
>> +{
>> +GetBitContext tmp = *rw;
>> +current->payload_size = 0;
>> +for (i = 0; get_bits_left(rw) >= 8; i++) {
>> +if (get_bits(rw, 8))
>> +current->payload_size = i;
>> +}
>> +*rw = tmp;
>> +
>> +current->payload_ref = av_buffer_alloc(current->payload_size);
>> +if (!current->payload_ref)
>> +return AVERROR(ENOMEM);
>> +current->payload = current->payload_ref->data;
>> +}
>> +#endif
> 
> That looks factorisable.  Can we make a "measure length of payload and 
> allocate buffer for it" function and use it in metadata_itu_t35 as well?

Will do.

> 
>> +
>> +for (i = 0; i < current->payload_size; i++)
>> +xf(8, obu_padding_byte[i], current->payload[i], 0x00, 0xff, 1, i);
>> +
>> +return 0;
>> +}
>>
> 
> Code looks sensible, but could you explain a bit more about why this is 
> helpful.  Is there a use-case for preserving the actual padding bytes?  

The padding could be anything, and samples could exploit it to insert
arbitrary data for whatever reason into the bitstream without damaging
it (ASCII art signature? :P).
I figured it was better to let the CBS caller decide if they want to
keep them, replace them with something else, or even inserting a brand
new one. Hardcoding it to 0xff or whatever didn't seem proper.

> If that's some sort of CBR application, is it actually going to need to 
> preserve the trailing zeroes as well?

I don't think we're keeping them 

[FFmpeg-devel] [PATCH v2 5/9] lavc/qsvdec: Add VP9 decoder support

2019-04-01 Thread Mark Thompson
From: Zhong Li 

VP9 decoder is supported on Intel kabyLake+ platforms with MSDK Version 1.19+

Signed-off-by: Zhong Li 
---
On 20/03/2019 14:41, Li, Zhong wrote:
> Yes, QSV is a marketing name which is no equal to libmfx/MSDK.
> But would be better to keep consistent with others, such as "Intel 
> QSV-accelerated VP8 video decoding" in pervious changelog?

I don't think so?  VP9 decoding with the QSV hardware is already supported, 
this only adds the additional option of using libmfx to access the same thing 
as well.


 Changelog |  1 +
 configure |  6 ++
 libavcodec/allcodecs.c|  1 +
 libavcodec/qsv.c  |  5 +
 libavcodec/qsvdec_other.c | 31 ++-
 5 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/Changelog b/Changelog
index cd4ed54f2c..d838873dd4 100644
--- a/Changelog
+++ b/Changelog
@@ -21,6 +21,7 @@ version :
 - Support decoding of HEVC 4:4:4 content in nvdec and cuviddec
 - removed libndi-newtek
 - agm decoder
+- Intel libmfx VP9 decoding
 
 
 version 4.1:
diff --git a/configure b/configure
index f6123f53e5..60cbbaf39e 100755
--- a/configure
+++ b/configure
@@ -3058,6 +3058,8 @@ vp8_v4l2m2m_decoder_deps="v4l2_m2m vp8_v4l2_m2m"
 vp8_v4l2m2m_encoder_deps="v4l2_m2m vp8_v4l2_m2m"
 vp9_cuvid_decoder_deps="cuvid"
 vp9_mediacodec_decoder_deps="mediacodec"
+vp9_qsv_decoder_deps="MFX_CODEC_VP9"
+vp9_qsv_decoder_select="qsvdec"
 vp9_rkmpp_decoder_deps="rkmpp"
 vp9_vaapi_encoder_deps="VAEncPictureParameterBufferVP9"
 vp9_vaapi_encoder_select="vaapi_encode"
@@ -6157,6 +6159,10 @@ enabled liblensfun&& require_pkg_config 
liblensfun lensfun lensfun.h lf_
 # can find the libraries and headers through other means.
 enabled libmfx&& { check_pkg_config libmfx libmfx "mfx/mfxvideo.h" 
MFXInit ||
{ require libmfx "mfx/mfxvideo.h" MFXInit 
"-llibmfx $advapi32_extralibs" && warn "using libmfx without pkg-config"; } }
+if enabled libmfx; then
+   check_cc MFX_CODEC_VP9 "mfx/mfxvp9.h mfx/mfxstructures.h" "MFX_CODEC_VP9"
+fi
+
 enabled libmodplug&& require_pkg_config libmodplug libmodplug 
libmodplug/modplug.h ModPlug_Load
 enabled libmp3lame&& require "libmp3lame >= 3.98.3" lame/lame.h 
lame_set_VBR_quality -lmp3lame $libm_extralibs
 enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h 
mysofa_load ||
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 71fd74a07e..1f0233d971 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -776,6 +776,7 @@ extern AVCodec ff_vp8_v4l2m2m_encoder;
 extern AVCodec ff_vp8_vaapi_encoder;
 extern AVCodec ff_vp9_cuvid_decoder;
 extern AVCodec ff_vp9_mediacodec_decoder;
+extern AVCodec ff_vp9_qsv_decoder;
 extern AVCodec ff_vp9_vaapi_encoder;
 
 // The iterate API is not usable with ossfuzz due to the excessive size of 
binaries created
diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index bb0d79588c..389fdcff41 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -60,6 +60,11 @@ int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id)
 #endif
 case AV_CODEC_ID_MJPEG:
 return MFX_CODEC_JPEG;
+#if QSV_VERSION_ATLEAST(1, 19)
+case AV_CODEC_ID_VP9:
+return MFX_CODEC_VP9;
+#endif
+
 default:
 break;
 }
diff --git a/libavcodec/qsvdec_other.c b/libavcodec/qsvdec_other.c
index 03251d2c85..d7a6d79f63 100644
--- a/libavcodec/qsvdec_other.c
+++ b/libavcodec/qsvdec_other.c
@@ -1,5 +1,5 @@
 /*
- * Intel MediaSDK QSV based MPEG-2, VC-1 and VP8 decoders
+ * Intel MediaSDK QSV based MPEG-2, VC-1, VP8 and VP9 decoders
  *
  * copyright (c) 2015 Anton Khirnov
  *
@@ -255,3 +255,32 @@ AVCodec ff_vp8_qsv_decoder = {
 .wrapper_name   = "qsv",
 };
 #endif
+
+#if CONFIG_VP9_QSV_DECODER
+static const AVClass vp9_qsv_class = {
+.class_name = "vp9_qsv",
+.item_name  = av_default_item_name,
+.option = options,
+.version= LIBAVUTIL_VERSION_INT,
+};
+
+AVCodec ff_vp9_qsv_decoder = {
+.name   = "vp9_qsv",
+.long_name  = NULL_IF_CONFIG_SMALL("VP9 video (Intel Quick Sync Video 
acceleration)"),
+.priv_data_size = sizeof(QSVOtherContext),
+.type   = AVMEDIA_TYPE_VIDEO,
+.id = AV_CODEC_ID_VP9,
+.init   = qsv_decode_init,
+.decode = qsv_decode_frame,
+.flush  = qsv_decode_flush,
+.close  = qsv_decode_close,
+.capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | 
AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HYBRID,
+.priv_class = _qsv_class,
+.pix_fmts   = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
+AV_PIX_FMT_P010,
+AV_PIX_FMT_QSV,
+AV_PIX_FMT_NONE },
+.hw_configs = ff_qsv_hw_configs,
+.wrapper_name   = "qsv",
+};
+#endif
-- 
2.20.1


[FFmpeg-devel] [PATCH v2 8/9] av1_parser: Use CBS parser interface

2019-04-01 Thread Mark Thompson
This simplifies the parser and improves performance by reducing the number
of allocations and eliminating redundant copies.
---
 libavcodec/av1_parser.c | 63 +
 1 file changed, 13 insertions(+), 50 deletions(-)

diff --git a/libavcodec/av1_parser.c b/libavcodec/av1_parser.c
index b916608d65..4a743d92d4 100644
--- a/libavcodec/av1_parser.c
+++ b/libavcodec/av1_parser.c
@@ -27,7 +27,7 @@
 
 typedef struct AV1ParseContext {
 CodedBitstreamContext *cbc;
-CodedBitstreamFragment temporal_unit;
+AV1RawFrameHeader frame_header;
 int parsed_extradata;
 } AV1ParseContext;
 
@@ -50,8 +50,10 @@ static int av1_parser_parse(AVCodecParserContext *ctx,
 const uint8_t *data, int size)
 {
 AV1ParseContext *s = ctx->priv_data;
-CodedBitstreamFragment *td = >temporal_unit;
 CodedBitstreamAV1Context *av1 = s->cbc->priv_data;
+AV1RawSequenceHeader *seq;
+AV1RawColorConfig *color;
+AV1RawFrameHeader *frame;
 int ret;
 
 *out_data = data;
@@ -66,67 +68,35 @@ static int av1_parser_parse(AVCodecParserContext *ctx,
 if (avctx->extradata_size && !s->parsed_extradata) {
 s->parsed_extradata = 1;
 
-ret = ff_cbs_read(s->cbc, td, avctx->extradata, avctx->extradata_size);
-if (ret < 0) {
+ret = ff_cbs_parse_headers(s->cbc, NULL,
+   avctx->extradata, avctx->extradata_size);
+if (ret < 0)
 av_log(avctx, AV_LOG_WARNING, "Failed to parse extradata.\n");
-}
-
-ff_cbs_fragment_reset(s->cbc, td);
 }
 
-ret = ff_cbs_read(s->cbc, td, data, size);
+ret = ff_cbs_parse_headers(s->cbc, >frame_header, data, size);
 if (ret < 0) {
 av_log(avctx, AV_LOG_ERROR, "Failed to parse temporal unit.\n");
 goto end;
 }
+frame = >frame_header;
 
 if (!av1->sequence_header) {
 av_log(avctx, AV_LOG_ERROR, "No sequence header available\n");
 goto end;
 }
+seq = av1->sequence_header;
+color = >color_config;
 
-for (int i = 0; i < td->nb_units; i++) {
-CodedBitstreamUnit *unit = >units[i];
-AV1RawOBU *obu = unit->content;
-AV1RawSequenceHeader *seq = av1->sequence_header;
-AV1RawColorConfig *color = >color_config;
-AV1RawFrameHeader *frame;
-int frame_type;
-
-if (unit->type == AV1_OBU_FRAME)
-frame = >obu.frame.header;
-else if (unit->type == AV1_OBU_FRAME_HEADER)
-frame = >obu.frame_header;
-else
-continue;
-
-if (frame->show_existing_frame) {
-AV1ReferenceFrameState *ref = 
>ref[frame->frame_to_show_map_idx];
-
-if (!ref->valid) {
-av_log(avctx, AV_LOG_ERROR, "Invalid reference frame\n");
-goto end;
-}
-
-ctx->width  = ref->frame_width;
-ctx->height = ref->frame_height;
-frame_type  = ref->frame_type;
-
-ctx->key_frame = 0;
-} else if (!frame->show_frame) {
-continue;
-} else {
 ctx->width  = av1->frame_width;
 ctx->height = av1->frame_height;
-frame_type  = frame->frame_type;
 
-ctx->key_frame = frame_type == AV1_FRAME_KEY;
-}
+ctx->key_frame = frame->frame_type == AV1_FRAME_KEY;
 
 avctx->profile = seq->seq_profile;
 avctx->level   = seq->seq_level_idx[0];
 
-switch (frame_type) {
+switch (frame->frame_type) {
 case AV1_FRAME_KEY:
 case AV1_FRAME_INTRA_ONLY:
 ctx->pict_type = AV_PICTURE_TYPE_I;
@@ -155,11 +125,8 @@ static int av1_parser_parse(AVCodecParserContext *ctx,
 break;
 }
 av_assert2(ctx->format != AV_PIX_FMT_NONE);
-}
 
 end:
-ff_cbs_fragment_reset(s->cbc, td);
-
 s->cbc->log_ctx = NULL;
 
 return size;
@@ -182,9 +149,6 @@ static av_cold int av1_parser_init(AVCodecParserContext 
*ctx)
 if (ret < 0)
 return ret;
 
-s->cbc->decompose_unit_types= (CodedBitstreamUnitType 
*)decompose_unit_types;
-s->cbc->nb_decompose_unit_types = FF_ARRAY_ELEMS(decompose_unit_types);
-
 return 0;
 }
 
@@ -192,7 +156,6 @@ static void av1_parser_close(AVCodecParserContext *ctx)
 {
 AV1ParseContext *s = ctx->priv_data;
 
-ff_cbs_fragment_free(s->cbc, >temporal_unit);
 ff_cbs_close(>cbc);
 }
 
-- 
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 v2 6/9] cbs_av1: Implement parser entrypoint

2019-04-01 Thread Mark Thompson
---
Unsure about this one - while the patch is short, it's rather invasive in a 
pretty ugly way with how it abuses the read call.  It will still do allocations 
for the decomposition because of that, even though we don't really want them.

Any ideas welcome.


 libavcodec/cbs_av1.c | 89 +++-
 1 file changed, 79 insertions(+), 10 deletions(-)

diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c
index 02f168b58d..0b54b5820c 100644
--- a/libavcodec/cbs_av1.c
+++ b/libavcodec/cbs_av1.c
@@ -776,13 +776,15 @@ static int cbs_av1_get_relative_dist(const 
AV1RawSequenceHeader *seq,
 #undef byte_alignment
 
 
-static int cbs_av1_split_fragment(CodedBitstreamContext *ctx,
-  CodedBitstreamFragment *frag,
-  int header)
+typedef int (*cbs_av1_split_obu_callback)(CodedBitstreamContext *ctx,
+  void *priv, int obu_type,
+  const uint8_t *data, size_t size);
+
+static int cbs_av1_split_obus(CodedBitstreamContext *ctx,
+  void *priv, cbs_av1_split_obu_callback cb,
+  const uint8_t *data, size_t size)
 {
 GetBitContext gbc;
-uint8_t *data;
-size_t size;
 uint64_t obu_length;
 int pos, err, trace;
 
@@ -790,9 +792,6 @@ static int cbs_av1_split_fragment(CodedBitstreamContext 
*ctx,
 trace = ctx->trace_enable;
 ctx->trace_enable = 0;
 
-data = frag->data;
-size = frag->data_size;
-
 if (INT_MAX / 8 < size) {
 av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid fragment: "
"too large (%"SIZE_SPECIFIER" bytes).\n", size);
@@ -837,8 +836,7 @@ static int cbs_av1_split_fragment(CodedBitstreamContext 
*ctx,
 goto fail;
 }
 
-err = ff_cbs_insert_unit_data(ctx, frag, -1, header.obu_type,
-  data, obu_length, frag->data_ref);
+err = cb(ctx, priv, header.obu_type, data, obu_length);
 if (err < 0)
 goto fail;
 
@@ -852,6 +850,23 @@ fail:
 return err;
 }
 
+static int cbs_av1_insert_obu(CodedBitstreamContext *ctx,
+  void *priv, int obu_type,
+  const uint8_t *data, size_t size)
+{
+CodedBitstreamFragment *frag = priv;
+return ff_cbs_insert_unit_data(ctx, frag, -1, obu_type,
+   (uint8_t*)data, size, frag->data_ref);
+}
+
+static int cbs_av1_split_fragment(CodedBitstreamContext *ctx,
+  CodedBitstreamFragment *frag,
+  int header)
+{
+return cbs_av1_split_obus(ctx, frag, _av1_insert_obu,
+  frag->data, frag->data_size);
+}
+
 static void cbs_av1_free_tile_data(AV1RawTileData *td)
 {
 av_buffer_unref(>data_ref);
@@ -895,6 +910,12 @@ static int cbs_av1_ref_tile_data(CodedBitstreamContext 
*ctx,
 {
 int pos;
 
+if (!unit->data_ref) {
+// Not refcounted - only parsing headers, so tile data will
+// not be needed.
+return 0;
+}
+
 pos = get_bits_count(gbc);
 if (pos >= 8 * unit->data_size) {
 av_log(ctx->log_ctx, AV_LOG_ERROR, "Bitstream ended before "
@@ -1324,6 +1345,52 @@ static void cbs_av1_close(CodedBitstreamContext *ctx)
 av_freep(>write_buffer);
 }
 
+static int cbs_av1_parse_obu(CodedBitstreamContext *ctx,
+ void *priv, int obu_type,
+ const uint8_t *data, size_t data_size)
+{
+CodedBitstreamUnit unit;
+int err;
+
+// These OBU types will not affect parsing.
+if (obu_type == AV1_OBU_METADATA  ||
+obu_type == AV1_OBU_TILE_LIST ||
+obu_type == AV1_OBU_PADDING)
+return 0;
+
+unit = (CodedBitstreamUnit) {
+.type  = obu_type,
+.data  = (uint8_t*)data,
+.data_size = data_size,
+};
+
+err = cbs_av1_read_unit(ctx, );
+if (err >= 0 && priv) {
+AV1RawOBU *obu = unit.content;
+switch (obu->header.obu_type) {
+case AV1_OBU_FRAME_HEADER:
+case AV1_OBU_REDUNDANT_FRAME_HEADER:
+memcpy(priv, >obu.frame_header,
+   sizeof(obu->obu.frame_header));
+break;
+case AV1_OBU_FRAME:
+memcpy(priv, >obu.frame.header,
+   sizeof(obu->obu.frame.header));
+break;
+}
+}
+
+av_buffer_unref(_ref);
+
+return err;
+}
+
+static int cbs_av1_parse_headers(CodedBitstreamContext *ctx, void *header,
+ const uint8_t *data, size_t size)
+{
+return cbs_av1_split_obus(ctx, header, _av1_parse_obu, data, size);
+}
+
 const CodedBitstreamType ff_cbs_type_av1 = {
 .codec_id  = AV_CODEC_ID_AV1,
 
@@ -1335,4 +1402,6 @@ const CodedBitstreamType ff_cbs_type_av1 = {
 .assemble_fragment = _av1_assemble_fragment,
 
 

[FFmpeg-devel] [PATCH v2 7/9] cbs_av1: Fill context information for show-existing-frame

2019-04-01 Thread Mark Thompson
---
 libavcodec/cbs_av1_syntax_template.c | 16 
 1 file changed, 16 insertions(+)

diff --git a/libavcodec/cbs_av1_syntax_template.c 
b/libavcodec/cbs_av1_syntax_template.c
index 76eb90b279..a9bf78e4ad 100644
--- a/libavcodec/cbs_av1_syntax_template.c
+++ b/libavcodec/cbs_av1_syntax_template.c
@@ -1146,6 +1146,22 @@ static int 
FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
 
 fb(3, frame_to_show_map_idx);
 frame = >ref[current->frame_to_show_map_idx];
+if (!frame->valid) {
+av_log(ctx->log_ctx, AV_LOG_ERROR,
+   "Missing reference frame needed to show existing frame "
+   "(frame_to_show_map_idx = %d).\n",
+   current->frame_to_show_map_idx);
+return AVERROR_INVALIDDATA;
+}
+
+priv->bit_depth  = frame->bit_depth;
+priv->frame_width= frame->frame_width;
+priv->frame_height   = frame->frame_height;
+priv->upscaled_width = frame->upscaled_width;
+priv->render_width   = frame->render_width;
+priv->render_height  = frame->render_height;
+
+infer(frame_type, frame->frame_type);
 
 if (seq->decoder_model_info_present_flag &&
 !seq->timing_info.equal_picture_interval) {
-- 
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 v2 9/9] av1_parser: Reindent

2019-04-01 Thread Mark Thompson
---
 libavcodec/av1_parser.c | 74 -
 1 file changed, 37 insertions(+), 37 deletions(-)

diff --git a/libavcodec/av1_parser.c b/libavcodec/av1_parser.c
index 4a743d92d4..b848b41050 100644
--- a/libavcodec/av1_parser.c
+++ b/libavcodec/av1_parser.c
@@ -88,43 +88,43 @@ static int av1_parser_parse(AVCodecParserContext *ctx,
 seq = av1->sequence_header;
 color = >color_config;
 
-ctx->width  = av1->frame_width;
-ctx->height = av1->frame_height;
-
-ctx->key_frame = frame->frame_type == AV1_FRAME_KEY;
-
-avctx->profile = seq->seq_profile;
-avctx->level   = seq->seq_level_idx[0];
-
-switch (frame->frame_type) {
-case AV1_FRAME_KEY:
-case AV1_FRAME_INTRA_ONLY:
-ctx->pict_type = AV_PICTURE_TYPE_I;
-break;
-case AV1_FRAME_INTER:
-ctx->pict_type = AV_PICTURE_TYPE_P;
-break;
-case AV1_FRAME_SWITCH:
-ctx->pict_type = AV_PICTURE_TYPE_SP;
-break;
-}
-ctx->picture_structure = AV_PICTURE_STRUCTURE_FRAME;
-
-switch (av1->bit_depth) {
-case 8:
-ctx->format = color->mono_chrome ? AV_PIX_FMT_GRAY8
- : pix_fmts_8bit 
[color->subsampling_x][color->subsampling_y];
-break;
-case 10:
-ctx->format = color->mono_chrome ? AV_PIX_FMT_GRAY10
- : 
pix_fmts_10bit[color->subsampling_x][color->subsampling_y];
-break;
-case 12:
-ctx->format = color->mono_chrome ? AV_PIX_FMT_GRAY12
- : 
pix_fmts_12bit[color->subsampling_x][color->subsampling_y];
-break;
-}
-av_assert2(ctx->format != AV_PIX_FMT_NONE);
+ctx->width  = av1->frame_width;
+ctx->height = av1->frame_height;
+
+ctx->key_frame = frame->frame_type == AV1_FRAME_KEY;
+
+avctx->profile = seq->seq_profile;
+avctx->level   = seq->seq_level_idx[0];
+
+switch (frame->frame_type) {
+case AV1_FRAME_KEY:
+case AV1_FRAME_INTRA_ONLY:
+ctx->pict_type = AV_PICTURE_TYPE_I;
+break;
+case AV1_FRAME_INTER:
+ctx->pict_type = AV_PICTURE_TYPE_P;
+break;
+case AV1_FRAME_SWITCH:
+ctx->pict_type = AV_PICTURE_TYPE_SP;
+break;
+}
+ctx->picture_structure = AV_PICTURE_STRUCTURE_FRAME;
+
+switch (av1->bit_depth) {
+case 8:
+ctx->format = color->mono_chrome ? AV_PIX_FMT_GRAY8
+ : pix_fmts_8bit 
[color->subsampling_x][color->subsampling_y];
+break;
+case 10:
+ctx->format = color->mono_chrome ? AV_PIX_FMT_GRAY10
+ : 
pix_fmts_10bit[color->subsampling_x][color->subsampling_y];
+break;
+case 12:
+ctx->format = color->mono_chrome ? AV_PIX_FMT_GRAY12
+ : 
pix_fmts_12bit[color->subsampling_x][color->subsampling_y];
+break;
+}
+av_assert2(ctx->format != AV_PIX_FMT_NONE);
 
 end:
 s->cbc->log_ctx = 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 v2 4/9] vp9_parser: Return stream properties

2019-04-01 Thread Mark Thompson
Rewrites the parser entirely, using CBS for header parsing.
---
 libavcodec/vp9_parser.c | 112 +---
 1 file changed, 82 insertions(+), 30 deletions(-)

diff --git a/libavcodec/vp9_parser.c b/libavcodec/vp9_parser.c
index c957a75667..6bf4f30e80 100644
--- a/libavcodec/vp9_parser.c
+++ b/libavcodec/vp9_parser.c
@@ -1,8 +1,5 @@
 /*
- * VP9 compatible video decoder
- *
- * Copyright (C) 2013 Ronald S. Bultje 
- * Copyright (C) 2013 Clément Bœsch 
+ * VP9 parser
  *
  * This file is part of FFmpeg.
  *
@@ -21,50 +18,105 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "libavutil/intreadwrite.h"
-#include "libavcodec/get_bits.h"
+#include "libavutil/avassert.h"
+#include "cbs.h"
+#include "cbs_vp9.h"
 #include "parser.h"
 
-static int parse(AVCodecParserContext *ctx,
- AVCodecContext *avctx,
- const uint8_t **out_data, int *out_size,
- const uint8_t *data, int size)
+typedef struct VP9ParserContext {
+CodedBitstreamContext *cbc;
+VP9RawFrameHeader frame_header;
+} VP9ParserContext;
+
+static const enum AVPixelFormat vp9_pix_fmts[3][2][2] = {
+{ // 8-bit.
+{ AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P },
+{ AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P },
+},
+{ // 10-bit.
+{ AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV440P10 },
+{ AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV420P10 },
+},
+{ // 12-bit.
+{ AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12 },
+{ AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV420P12 },
+},
+};
+
+static int vp9_parser_parse(AVCodecParserContext *ctx,
+AVCodecContext *avctx,
+const uint8_t **out_data, int *out_size,
+const uint8_t *data, int size)
 {
-GetBitContext gb;
-int res, profile, keyframe;
+VP9ParserContext *s = ctx->priv_data;
+const CodedBitstreamVP9Context *vp9 = s->cbc->priv_data;
+const VP9RawFrameHeader *fh;
+int err;
 
 *out_data = data;
 *out_size = size;
 
-if (!size || (res = init_get_bits8(, data, size)) < 0)
-return size; // parsers can't return errors
-get_bits(, 2); // frame marker
-profile  = get_bits1();
-profile |= get_bits1() << 1;
-if (profile == 3) profile += get_bits1();
-if (profile > 3)
-return size;
+ctx->key_frame = -1;
+ctx->pict_type = AV_PICTURE_TYPE_NONE;
+ctx->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN;
 
-avctx->profile = profile;
+if (!size)
+return 0;
 
-if (get_bits1()) {
-keyframe = 0;
-} else {
-keyframe  = !get_bits1();
+s->cbc->log_ctx = avctx;
+
+err = ff_cbs_parse_headers(s->cbc, >frame_header, data, size);
+if (err < 0) {
+av_log(avctx, AV_LOG_WARNING, "Failed to parse VP9 frame headers.\n");
+goto end;
 }
+fh = >frame_header;
 
-if (!keyframe) {
-ctx->pict_type = AV_PICTURE_TYPE_P;
-ctx->key_frame = 0;
-} else {
+avctx->profile = vp9->profile;
+avctx->level   = FF_LEVEL_UNKNOWN;
+
+ctx->width  = ctx->coded_width  = vp9->frame_width;
+ctx->height = ctx->coded_height = vp9->frame_height;
+
+if (fh->frame_type == VP9_KEY_FRAME) {
 ctx->pict_type = AV_PICTURE_TYPE_I;
 ctx->key_frame = 1;
+} else {
+ctx->pict_type = fh->intra_only ? AV_PICTURE_TYPE_I : 
AV_PICTURE_TYPE_P;
+ctx->key_frame = 0;
 }
 
+ctx->picture_structure = AV_PICTURE_STRUCTURE_FRAME;
+
+av_assert0(vp9->bit_depth == 8  ||
+   vp9->bit_depth == 10 ||
+   vp9->bit_depth == 12);
+
+ctx->format = vp9_pix_fmts[(vp9->bit_depth - 8) / 2]
+  [vp9->subsampling_x][vp9->subsampling_y];
+
+end:
+s->cbc->log_ctx = NULL;
+
 return size;
 }
 
+static av_cold int vp9_parser_init(AVCodecParserContext *ctx)
+{
+VP9ParserContext *s = ctx->priv_data;
+return ff_cbs_init(>cbc, AV_CODEC_ID_VP9, NULL);
+}
+
+static av_cold void vp9_parser_close(AVCodecParserContext *ctx)
+{
+VP9ParserContext *s = ctx->priv_data;
+ff_cbs_close(>cbc);
+}
+
 AVCodecParser ff_vp9_parser = {
 .codec_ids  = { AV_CODEC_ID_VP9 },
-.parser_parse   = parse,
+.priv_data_size = sizeof(VP9ParserContext),
+.parser_init= _parser_init,
+.parser_close   = _parser_close,
+.parser_parse   = _parser_parse,
 };
-- 
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 v2 1/9] cbs: Add entrypoint for parser use

2019-04-01 Thread Mark Thompson
This can avoid copying due to lack of refcounting in parsers.
---
 libavcodec/cbs.c  |  9 +
 libavcodec/cbs.h  | 14 ++
 libavcodec/cbs_internal.h |  4 
 3 files changed, 27 insertions(+)

diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c
index c388be896b..ff98a1e8f4 100644
--- a/libavcodec/cbs.c
+++ b/libavcodec/cbs.c
@@ -280,6 +280,15 @@ int ff_cbs_read(CodedBitstreamContext *ctx,
 return cbs_read_fragment_content(ctx, frag);
 }
 
+int ff_cbs_parse_headers(CodedBitstreamContext *ctx, void *header,
+ const uint8_t *data, size_t size)
+{
+if (!ctx->codec->parse_headers)
+return AVERROR(ENOSYS);
+
+return ctx->codec->parse_headers(ctx, header, data, size);
+}
+
 
 int ff_cbs_write_fragment_data(CodedBitstreamContext *ctx,
CodedBitstreamFragment *frag)
diff --git a/libavcodec/cbs.h b/libavcodec/cbs.h
index 967dcd1468..be965ae258 100644
--- a/libavcodec/cbs.h
+++ b/libavcodec/cbs.h
@@ -278,6 +278,20 @@ int ff_cbs_read(CodedBitstreamContext *ctx,
 CodedBitstreamFragment *frag,
 const uint8_t *data, size_t size);
 
+/**
+ * Parse headers from a bitstream from a memory region, updating state
+ * but not storing intermediate results.
+ *
+ * If header is not NULL, the decomposition of the header of the last
+ * displayed unit in the stream is written there.  The type and size of
+ * this is codec-dependent.
+ *
+ * This is intended for use in parsers where only header parsing is
+ * required and the input is not refcounted.
+ */
+int ff_cbs_parse_headers(CodedBitstreamContext *ctx, void *header,
+ const uint8_t *data, size_t size);
+
 
 /**
  * Write the content of the fragment to its own internal buffer.
diff --git a/libavcodec/cbs_internal.h b/libavcodec/cbs_internal.h
index 53f2e5d187..9783555292 100644
--- a/libavcodec/cbs_internal.h
+++ b/libavcodec/cbs_internal.h
@@ -55,6 +55,10 @@ typedef struct CodedBitstreamType {
 
 // Free the codec internal state.
 void (*close)(CodedBitstreamContext *ctx);
+
+// Parse headers only.
+int (*parse_headers)(CodedBitstreamContext *ctx, void *header,
+ const uint8_t *data, size_t size);
 } CodedBitstreamType;
 
 
-- 
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 v2 2/9] cbs_vp9: Implement parser entrypoint

2019-04-01 Thread Mark Thompson
---
 libavcodec/cbs_vp9.c | 90 +++-
 1 file changed, 73 insertions(+), 17 deletions(-)

diff --git a/libavcodec/cbs_vp9.c b/libavcodec/cbs_vp9.c
index 0b5f137ed8..6ea4681d68 100644
--- a/libavcodec/cbs_vp9.c
+++ b/libavcodec/cbs_vp9.c
@@ -409,15 +409,23 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, 
PutBitContext *pbc,
 #undef byte_alignment
 
 
-static int cbs_vp9_split_fragment(CodedBitstreamContext *ctx,
-  CodedBitstreamFragment *frag,
-  int header)
+typedef int (*cbs_vp9_split_frame_callback)(CodedBitstreamContext *ctx,
+void *priv,
+const uint8_t *data,
+size_t data_size);
+
+static int cbs_vp9_split_frames(CodedBitstreamContext *ctx,
+void *priv, cbs_vp9_split_frame_callback cb,
+const uint8_t *data, size_t data_size)
 {
 uint8_t superframe_header;
 int err;
 
+if (data_size == 0)
+return 0;
+
 // Last byte in the packet.
-superframe_header = frag->data[frag->data_size - 1];
+superframe_header = data[data_size - 1];
 
 if ((superframe_header & 0xe0) == 0xc0) {
 VP9RawSuperframeIndex sfi;
@@ -427,8 +435,14 @@ static int cbs_vp9_split_fragment(CodedBitstreamContext 
*ctx,
 
 index_size = 2 + (((superframe_header & 0x18) >> 3) + 1) *
   ((superframe_header & 0x07) + 1);
+if (index_size > data_size) {
+av_log(ctx->log_ctx, AV_LOG_ERROR, "Superframe index (%"
+   SIZE_SPECIFIER" bytes) is larger than whole frame (%"
+   SIZE_SPECIFIER" bytes).\n", index_size, data_size);
+return AVERROR_INVALIDDATA;
+}
 
-err = init_get_bits(, frag->data + frag->data_size - index_size,
+err = init_get_bits(, data + data_size - index_size,
 8 * index_size);
 if (err < 0)
 return err;
@@ -439,34 +453,27 @@ static int cbs_vp9_split_fragment(CodedBitstreamContext 
*ctx,
 
 pos = 0;
 for (i = 0; i <= sfi.frames_in_superframe_minus_1; i++) {
-if (pos + sfi.frame_sizes[i] + index_size > frag->data_size) {
+if (pos + sfi.frame_sizes[i] + index_size > data_size) {
 av_log(ctx->log_ctx, AV_LOG_ERROR, "Frame %d too large "
"in superframe: %"PRIu32" bytes.\n",
i, sfi.frame_sizes[i]);
 return AVERROR_INVALIDDATA;
 }
 
-err = ff_cbs_insert_unit_data(ctx, frag, -1, 0,
-  frag->data + pos,
-  sfi.frame_sizes[i],
-  frag->data_ref);
+err = cb(ctx, priv, data + pos, sfi.frame_sizes[i]);
 if (err < 0)
 return err;
 
 pos += sfi.frame_sizes[i];
 }
-if (pos + index_size != frag->data_size) {
+if (pos + index_size != data_size) {
 av_log(ctx->log_ctx, AV_LOG_WARNING, "Extra padding at "
"end of superframe: %"SIZE_SPECIFIER" bytes.\n",
-   frag->data_size - (pos + index_size));
+   data_size - (pos + index_size));
 }
 
-return 0;
-
 } else {
-err = ff_cbs_insert_unit_data(ctx, frag, -1, 0,
-  frag->data, frag->data_size,
-  frag->data_ref);
+err = cb(ctx, priv, data, data_size);
 if (err < 0)
 return err;
 }
@@ -474,6 +481,23 @@ static int cbs_vp9_split_fragment(CodedBitstreamContext 
*ctx,
 return 0;
 }
 
+static int cbs_vp9_insert_unit(CodedBitstreamContext *ctx, void *priv,
+   const uint8_t *data, size_t data_size)
+{
+CodedBitstreamFragment *frag = priv;
+return ff_cbs_insert_unit_data(ctx, frag, -1, 0,
+   (uint8_t*)data, data_size,
+   frag->data_ref);
+}
+
+static int cbs_vp9_split_fragment(CodedBitstreamContext *ctx,
+  CodedBitstreamFragment *frag,
+  int header)
+{
+return cbs_vp9_split_frames(ctx, frag, _vp9_insert_unit,
+frag->data, frag->data_size);
+}
+
 static void cbs_vp9_free_frame(void *unit, uint8_t *content)
 {
 VP9RawFrame *frame = (VP9RawFrame*)content;
@@ -678,6 +702,36 @@ static void cbs_vp9_close(CodedBitstreamContext *ctx)
 av_freep(>write_buffer);
 }
 
+static int cbs_vp9_parse_frame(CodedBitstreamContext *ctx, void *priv,
+   const uint8_t *data, size_t data_size)
+{
+VP9RawFrameHeader *frame = priv;
+GetBitContext gbc;
+int 

Re: [FFmpeg-devel] [PATCH] avformat/mxfenc: support XAVC long gop

2019-04-01 Thread Thomas Mundt
Am Sa., 30. März 2019 um 17:52 Uhr schrieb Baptiste Coudurier <
baptiste.coudur...@gmail.com>:

> Hi Thomas,
>
> > On Mar 29, 2019, at 1:11 PM, Thomas Mundt  wrote:
> >
> >
> > […]
> >
> >>
> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x31,0x04
> >> }, 568832, 122, 0,  1 }, // AVC High 422 Intra RP2027 Class 100 1080/25p
> >> +{{
> >>
> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x31,0x08
> >> }, 236544, 122, 0,  1 }, // AVC High 422 Intra RP2027 Class 100
> 720/59.94p
> >> +{{
> >>
> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x31,0x09
> >> }, 284672, 122, 0,  1 }, // AVC High 422 Intra RP2027 Class 100 720/50p
> >>
> >
> > Maybe i miss something, but doesn´t the setting of the profile for all
> AVC
> > Intra codec ULs make the for-loop to always select the last AVC Intra
> > codec UL (720/50p) for AVC High 422 Intra?
>
> The frame size check prevents that.
>

The frame size check in the first condition of the for-loop works for fixed
frame size RP2027. However, with free frame size AVC High 422 Intra, the
second condition in the for-loop only checks for profile and intra-only.
Since the second condition doesn´t break the for-loop, the last UL with
matching profile and intra-only flag is set.

I wanted to test this behavior, so I applied this patch to
cf81284b1c14ef28d3f94e6d28c46188ba4e82f2, which is the last one that can be
compiled.
Unfortunately I was not able to produce any h264 mxf with this patch.
E.g. the following command works perfect without this patch:
ffmpeg -f lavfi -i testsrc=size=3840x2160:rate=50 -c:v libx264 -pix_fmt
yuv422p10 -x264-params keyint=1 -t 1 avc.mxf
With this patch I get errors: h264 profile not supported, could not get
h264 profile.
Same with other formats or long gop.
RP2027 Class 100 1080/50i shows the following error: frame size does not
match index unit size, 568832 != 0

Regards,
Thomas
___
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 3/3] avcodec/cbs_av1: fix parsing spatial_id

2019-04-01 Thread Mark Thompson
On 25/03/2019 14:22, James Almer wrote:
> Signed-off-by: James Almer 
> ---
>  libavcodec/cbs_av1.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c
> index 22330eabf3..77548084b6 100644
> --- a/libavcodec/cbs_av1.c
> +++ b/libavcodec/cbs_av1.c
> @@ -964,7 +964,7 @@ static int cbs_av1_read_unit(CodedBitstreamContext *ctx,
>  
>  if (obu->header.obu_extension_flag) {
>  priv->temporal_id = obu->header.temporal_id;
> -priv->spatial_id  = obu->header.temporal_id;
> +priv->spatial_id  = obu->header.spatial_id;

Oops :(

>  
>  if (obu->header.obu_type != AV1_OBU_SEQUENCE_HEADER &&
>  obu->header.obu_type != AV1_OBU_TEMPORAL_DELIMITER &&
> 
LGTM.

Thanks,

- Mark
___
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 2/3] avcodec/av1_metadata: add an option to remove Padding OBUs

2019-04-01 Thread Mark Thompson
On 25/03/2019 14:22, James Almer wrote:
> Signed-off-by: James Almer 
> ---
>  libavcodec/av1_metadata_bsf.c | 19 +++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/libavcodec/av1_metadata_bsf.c b/libavcodec/av1_metadata_bsf.c
> index 2b74b697e4..fe208feaf5 100644
> --- a/libavcodec/av1_metadata_bsf.c
> +++ b/libavcodec/av1_metadata_bsf.c
> @@ -46,6 +46,8 @@ typedef struct AV1MetadataContext {
>  
>  AVRational tick_rate;
>  int num_ticks_per_picture;
> +
> +int delete_padding;
>  } AV1MetadataContext;
>  
>  
> @@ -158,6 +160,19 @@ static int av1_metadata_filter(AVBSFContext *bsf, 
> AVPacket *out)
>  }
>  }
>  
> +if (ctx->delete_padding) {
> +for (i = 0; i < frag->nb_units; i++) {
> +if (frag->units[i].type == AV1_OBU_PADDING) {
> +err = ff_cbs_delete_unit(ctx->cbc, frag, i);
> +if (err < 0) {
> +av_log(bsf, AV_LOG_ERROR, "Failed to delete Padding 
> OBU.\n");
> +goto fail;
> +}
> +--i;
> +}
> +}
> +}
> +
>  err = ff_cbs_write_packet(ctx->cbc, out, frag);
>  if (err < 0) {
>  av_log(bsf, AV_LOG_ERROR, "Failed to write packet.\n");
> @@ -275,6 +290,10 @@ static const AVOption av1_metadata_options[] = {
>  OFFSET(num_ticks_per_picture), AV_OPT_TYPE_INT,
>  { .i64 = -1 }, -1, INT_MAX, FLAGS },
>  
> +{ "delete_padding", "Delete all Padding OBUs",
> +OFFSET(delete_padding), AV_OPT_TYPE_BOOL,
> +{ .i64 = 0 }, 0, 1, FLAGS},
> +
>  { NULL }
>  };
>  
> 

LGTM with matching doc update :)

Thanks,

- Mark
___
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/3] avcodec/cbs_av1: add support for Padding OBUs

2019-04-01 Thread Mark Thompson
On 25/03/2019 14:22, James Almer wrote:
> Based on itut_t35 Matadata OBU parsing code.
> 
> Signed-off-by: James Almer 
> ---
>  libavcodec/cbs_av1.c | 20 +
>  libavcodec/cbs_av1.h |  7 ++
>  libavcodec/cbs_av1_syntax_template.c | 32 
>  3 files changed, 59 insertions(+)
> 
> diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c
> index 02f168b58d..22330eabf3 100644
> --- a/libavcodec/cbs_av1.c
> +++ b/libavcodec/cbs_av1.c
> @@ -857,6 +857,11 @@ static void cbs_av1_free_tile_data(AV1RawTileData *td)
>  av_buffer_unref(>data_ref);
>  }
>  
> +static void cbs_av1_free_padding(AV1RawPadding *pd)
> +{
> +av_buffer_unref(>payload_ref);
> +}
> +
>  static void cbs_av1_free_metadata(AV1RawMetadata *md)
>  {
>  switch (md->metadata_type) {
> @@ -883,6 +888,9 @@ static void cbs_av1_free_obu(void *unit, uint8_t *content)
>  case AV1_OBU_METADATA:
>  cbs_av1_free_metadata(>obu.metadata);
>  break;
> +case AV1_OBU_PADDING:
> +cbs_av1_free_padding(>obu.padding);
> +break;
>  }
>  
>  av_freep();
> @@ -1057,6 +1065,12 @@ static int cbs_av1_read_unit(CodedBitstreamContext 
> *ctx,
>  }
>  break;
>  case AV1_OBU_PADDING:
> +{
> +err = cbs_av1_read_padding(ctx, , >obu.padding);
> +if (err < 0)
> +return err;
> +}
> +break;
>  default:
>  return AVERROR(ENOSYS);
>  }
> @@ -1182,6 +1196,12 @@ static int cbs_av1_write_obu(CodedBitstreamContext 
> *ctx,
>  }
>  break;
>  case AV1_OBU_PADDING:
> +{
> +err = cbs_av1_write_padding(ctx, pbc, >obu.padding);
> +if (err < 0)
> +return err;
> +}
> +break;
>  default:
>  return AVERROR(ENOSYS);
>  }
> diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h
> index 71ceff9427..e799964b72 100644
> --- a/libavcodec/cbs_av1.h
> +++ b/libavcodec/cbs_av1.h
> @@ -364,6 +364,12 @@ typedef struct AV1RawMetadata {
>  } metadata;
>  } AV1RawMetadata;
>  
> +typedef struct AV1RawPadding {
> +uint8_t *payload;
> +size_t   payload_size;
> +AVBufferRef *payload_ref;
> +} AV1RawPadding;
> +
>  
>  typedef struct AV1RawOBU {
>  AV1RawOBUHeader header;
> @@ -377,6 +383,7 @@ typedef struct AV1RawOBU {
>  AV1RawTileGroup  tile_group;
>  AV1RawTileList   tile_list;
>  AV1RawMetadata   metadata;
> +AV1RawPaddingpadding;
>  } obu;
>  } AV1RawOBU;
>  
> diff --git a/libavcodec/cbs_av1_syntax_template.c 
> b/libavcodec/cbs_av1_syntax_template.c
> index 76eb90b279..a6cafdd99f 100644
> --- a/libavcodec/cbs_av1_syntax_template.c
> +++ b/libavcodec/cbs_av1_syntax_template.c
> @@ -1763,3 +1763,35 @@ static int FUNC(metadata_obu)(CodedBitstreamContext 
> *ctx, RWContext *rw,
>  
>  return 0;
>  }
> +
> +static int FUNC(padding)(CodedBitstreamContext *ctx, RWContext *rw,
> + AV1RawPadding *current)
> +{
> +int i, err;
> +
> +HEADER("Padding");
> +
> +#ifdef READ
> +// The payload runs up to the start of the trailing bits, but there might
> +// be arbitrarily many trailing zeroes so we need to read through twice.
> +{
> +GetBitContext tmp = *rw;
> +current->payload_size = 0;
> +for (i = 0; get_bits_left(rw) >= 8; i++) {
> +if (get_bits(rw, 8))
> +current->payload_size = i;
> +}
> +*rw = tmp;
> +
> +current->payload_ref = av_buffer_alloc(current->payload_size);
> +if (!current->payload_ref)
> +return AVERROR(ENOMEM);
> +current->payload = current->payload_ref->data;
> +}
> +#endif

That looks factorisable.  Can we make a "measure length of payload and allocate 
buffer for it" function and use it in metadata_itu_t35 as well?

> +
> +for (i = 0; i < current->payload_size; i++)
> +xf(8, obu_padding_byte[i], current->payload[i], 0x00, 0xff, 1, i);
> +
> +return 0;
> +}
> 

Code looks sensible, but could you explain a bit more about why this is 
helpful.  Is there a use-case for preserving the actual padding bytes?  If 
that's some sort of CBR application, is it actually going to need to preserve 
the trailing zeroes as well?

Thanks,

- Mark
___
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/cbs_av1: fix range of allowed values for obu_type

2019-04-01 Thread Mark Thompson
On 24/03/2019 22:28, James Almer wrote:
> 0 is a reserved value.
> 
> Signed-off-by: James Almer 
> ---
>  libavcodec/cbs_av1_syntax_template.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/cbs_av1_syntax_template.c 
> b/libavcodec/cbs_av1_syntax_template.c
> index 76eb90b279..35b030208b 100644
> --- a/libavcodec/cbs_av1_syntax_template.c
> +++ b/libavcodec/cbs_av1_syntax_template.c
> @@ -26,7 +26,7 @@ static int FUNC(obu_header)(CodedBitstreamContext *ctx, 
> RWContext *rw,
>  
>  fc(1, obu_forbidden_bit, 0, 0);
>  
> -fc(4, obu_type, 0, AV1_OBU_PADDING);
> +fc(4, obu_type, AV1_OBU_SEQUENCE_HEADER, AV1_OBU_PADDING);
>  flag(obu_extension_flag);
>  flag(obu_has_size_field);
>  
> 

Seems fine, but I'm not sure whether it is useful to distinguish 0 from the 
other reserved values (9-14) as invalid at this stage?  They will all pass 
through and return ENOSYS later when we come to read/write the content anyway.

(LGTM if you feel strongly.)

Thanks,

- Mark
___
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] lavc/hevc_ps: parse constraint flags for HEVC REXT

2019-04-01 Thread Mark Thompson
On 01/04/2019 22:38, James Almer wrote:
> On 4/1/2019 6:43 AM, Linjie Fu wrote:
>> Parse all the constraint flags.
>>
>> It can be passed to hw decoders to detemine the exact profile for Range
>> Extension HEVC.
>>
>> Signed-off-by: Linjie Fu 
>> ---
>>  libavcodec/hevc_ps.c | 18 +++---
>>  libavcodec/hevc_ps.h | 10 ++
>>  2 files changed, 25 insertions(+), 3 deletions(-)
>>
>> diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
>> index 80df417e4f..1365a9d640 100644
>> --- a/libavcodec/hevc_ps.c
>> +++ b/libavcodec/hevc_ps.c
>> @@ -295,9 +295,21 @@ static int decode_profile_tier_level(GetBitContext *gb, 
>> AVCodecContext *avctx,
>>  ptl->non_packed_constraint_flag = get_bits1(gb);
>>  ptl->frame_only_constraint_flag = get_bits1(gb);
>>  
>> -skip_bits(gb, 16); // XXX_reserved_zero_44bits[0..15]
>> -skip_bits(gb, 16); // XXX_reserved_zero_44bits[16..31]
>> -skip_bits(gb, 12); // XXX_reserved_zero_44bits[32..43]
>> +ptl->max_12bit_constraint_flag= get_bits1(gb);
>> +ptl->max_10bit_constraint_flag= get_bits1(gb);
>> +ptl->max_8bit_constraint_flag = get_bits1(gb);
>> +ptl->max_422chroma_constraint_flag= get_bits1(gb);
>> +ptl->max_420chroma_constraint_flag= get_bits1(gb);
>> +ptl->max_monochrome_constraint_flag   = get_bits1(gb);
>> +ptl->intra_constraint_flag= get_bits1(gb);
>> +ptl->one_picture_only_constraint_flag = get_bits1(gb);
>> +ptl->lower_bit_rate_constraint_flag   = get_bits1(gb);
>> +
>> +skip_bits(gb, 16); // XXX_reserved_zero_34bits[0..15]
> 
> The first of these bits can be general_max_14bit_constraint_flag. I
> suppose no hardware really supports it?

I think it's worth getting these right anyway.

From the set of flags you've ended up with here I'm guessing you're working 
from a pre-2018 version of the standard?  Try the 201802 version - 
.

>> +skip_bits(gb, 16); // XXX_reserved_zero_34bits[16..31]
>> +skip_bits(gb, 2);  // XXX_reserved_zero_34bits[32..33]
>> +
>> +ptl->inbld_flag = get_bits1(gb);
> 
> Strictly speaking, you should be checking ptl->profile_idc and
> ptl->profile_compatibility_flag to parse these, as per section 7.3.3 in
> the spec.
> Despite the amount of bits being fixed and the default value being 0, it
> would be ideal to prevent misparsing damaged samples.

+1.  Future profiles which could assign completely different meanings to these 
bits are also a possibility, though I would hope the standard people would 
avoid doing that.

Thanks,

- Mark
___
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] There may be a bug for .mp4 reader.

2019-04-01 Thread Hendrik Leppkes
On Mon, Apr 1, 2019 at 7:21 PM Yufei He  wrote:
>
> Hi
>
> There may be a bug for .mp4 reader.
>
> On decoding some ntsc mp4 files with my h.264 codec, from actvx I received,
>
> avctx->framerate.den is 100
>
> avctx->framerate.num is 2997
>
> avctx->pkt_timebase.num is 1
> avctx->pkt_timebase.den is 2997
>
> Duration of every packet I received from ff_decode_get_packet(avctx, ) is 
> 100, which means it's a encoded frame. But actually, it's a encoded field, 
> it's duration should be 50.
>

Bug reports should go on Trac or the API user mailing list.

- 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] configure: include pkgconfig path as vaapi header search

2019-04-01 Thread Mark Thompson
On 28/03/2019 05:17, Song, Ruiling wrote:

 Neo is the successor to Beignet, correct?
>>> Yes, that's the truth.
>>> Currently we simply checking against the specific header file of OpenCL,
>>> which is in-fact not accurate.
>>> I am not sure whether you would like to use Neo together with
>>> intel-media-driver, which is the most targeted opencl usage in FFmpeg.
>>> If that's the case, I think it may be hard to find a matching
>>> intel-media-driver to work with Neo release package.
>>> Because Neo release version depends on a very outdated libva revision.
>>> I just sent a patch to Neo to update libva revision dependency. Once they
>>> accept the patch and new Neo release package comes out,
>>> I think we can change to check against Neo package. People would not need
>>> to build Neo themselves then.
>>>
>>> Thanks!
>>> Ruiling

 Enabling similar functionality for Neo should allow for the same feature
 support for these not using Beignet.
>>>
>>>
>> Indeed, I'd want to use Neo + intel-media-driver.
>> Judging by the (relatively low) development activity on Beignet of late,
>> its' considered ready to deprecate in place of Neo, applicable on anything
>> newer than Kabylake.
> I think Mark don't have plan to deprecate Beignet now, and me too.
> FFmpeg-OpenCL currently use direct buffer sharing between OpenCL and vaapi 
> driver.
> One obvious limitation I didn't notice before is 10bit or 12bit buffer 
> sharing is not supported by Neo.
> I pinged the author of cl_intel_va_api_media_sharing, but got no response.
> Maybe I will take some effort to update the extension spec and implement them 
> in Neo myself.
> I am not sure any other Neo limitation that Mark wants to add?

For my point of view, the ideal thing to happen would be for Intel and AMD to 
work together to create a DRM object (kernel dma-buf) sharing extension for 
OpenCL which works on all of their platforms (especially the new ones, AMD ROCm 
and Intel NEO).

I don't think a VAAPI-specific extension is really the right way forward - as 
far as I can tell there is no good reason to tie it to that specific API (or, 
even worse, particular driver implementations thereof).  Compare Vulkan, which 
already does all of the interop on Linux via DRM object fds (and which 
therefore supports clean interop with Beignet, as well as with the Mesa and 
Intel VAAPI drivers themselves).

Thanks,

- Mark
___
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] apedec: add ability to check CRC

2019-04-01 Thread Lynne
Mar 6, 2019, 1:47 PM by d...@lynne.ee:

> 6 Mar 2019, 11:22 by > d...@lynne.ee > :
>
>> The CRC flag is only signalled once every few minutes but CRC is still
>> always present so the patch uses the file version instead.
>> CRC on 24-bit files wants non-padded samples so skip such files.
>> Some corrupt samples may have been output before the final check
>> depending on the -max_samples setting.
>>
> v2 attached
>

Ping? It hasn't had any objections yet.
___
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] lavc/hevc_ps: parse constraint flags for HEVC REXT

2019-04-01 Thread James Almer
On 4/1/2019 6:43 AM, Linjie Fu wrote:
> Parse all the constraint flags.
> 
> It can be passed to hw decoders to detemine the exact profile for Range
> Extension HEVC.
> 
> Signed-off-by: Linjie Fu 
> ---
>  libavcodec/hevc_ps.c | 18 +++---
>  libavcodec/hevc_ps.h | 10 ++
>  2 files changed, 25 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
> index 80df417e4f..1365a9d640 100644
> --- a/libavcodec/hevc_ps.c
> +++ b/libavcodec/hevc_ps.c
> @@ -295,9 +295,21 @@ static int decode_profile_tier_level(GetBitContext *gb, 
> AVCodecContext *avctx,
>  ptl->non_packed_constraint_flag = get_bits1(gb);
>  ptl->frame_only_constraint_flag = get_bits1(gb);
>  
> -skip_bits(gb, 16); // XXX_reserved_zero_44bits[0..15]
> -skip_bits(gb, 16); // XXX_reserved_zero_44bits[16..31]
> -skip_bits(gb, 12); // XXX_reserved_zero_44bits[32..43]
> +ptl->max_12bit_constraint_flag= get_bits1(gb);
> +ptl->max_10bit_constraint_flag= get_bits1(gb);
> +ptl->max_8bit_constraint_flag = get_bits1(gb);
> +ptl->max_422chroma_constraint_flag= get_bits1(gb);
> +ptl->max_420chroma_constraint_flag= get_bits1(gb);
> +ptl->max_monochrome_constraint_flag   = get_bits1(gb);
> +ptl->intra_constraint_flag= get_bits1(gb);
> +ptl->one_picture_only_constraint_flag = get_bits1(gb);
> +ptl->lower_bit_rate_constraint_flag   = get_bits1(gb);
> +
> +skip_bits(gb, 16); // XXX_reserved_zero_34bits[0..15]

The first of these bits can be general_max_14bit_constraint_flag. I
suppose no hardware really supports it?

> +skip_bits(gb, 16); // XXX_reserved_zero_34bits[16..31]
> +skip_bits(gb, 2);  // XXX_reserved_zero_34bits[32..33]
> +
> +ptl->inbld_flag = get_bits1(gb);

Strictly speaking, you should be checking ptl->profile_idc and
ptl->profile_compatibility_flag to parse these, as per section 7.3.3 in
the spec.
Despite the amount of bits being fixed and the default value being 0, it
would be ideal to prevent misparsing damaged samples.

>  
>  return 0;
>  }
> diff --git a/libavcodec/hevc_ps.h b/libavcodec/hevc_ps.h
> index bbaa9205ef..1c95a1848b 100644
> --- a/libavcodec/hevc_ps.h
> +++ b/libavcodec/hevc_ps.h
> @@ -182,6 +182,16 @@ typedef struct PTLCommon {
>  uint8_t interlaced_source_flag;
>  uint8_t non_packed_constraint_flag;
>  uint8_t frame_only_constraint_flag;
> +uint8_t max_12bit_constraint_flag;
> +uint8_t max_10bit_constraint_flag;
> +uint8_t max_8bit_constraint_flag;
> +uint8_t max_422chroma_constraint_flag;
> +uint8_t max_420chroma_constraint_flag;
> +uint8_t max_monochrome_constraint_flag;
> +uint8_t intra_constraint_flag;
> +uint8_t one_picture_only_constraint_flag;
> +uint8_t lower_bit_rate_constraint_flag;
> +uint8_t inbld_flag;
>  } PTLCommon;
>  
>  typedef struct PTL {
> 

___
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] prompeg_write() must report data all was written

2019-04-01 Thread Michael Niedermayer
On Sun, Mar 31, 2019 at 02:32:34AM +0100, David Holroyd wrote:
> Previously, prompeg_write() would only report to caller that bytes we
> written when a FEC packet was actually created.  Not all RTP packets are
> expected to generate a FEC packet however, so this behavior was causing
> avio to retry writing the RTP packet, eventually forcing the FEC state
> machine to send a FEC packet erroneously (and so breaking out of the
> retry loop).
> 
> This was resulting in incorrect FEC data being generated, and far too
> many FEC packets to be sent (~100% FEC overhead).
> ---
>  libavformat/prompeg.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)

this patch doesnt seem to apply automatically with git am

also no fate test changes, which indicates that this code is not tested.
I think it would be rather useful if there was a test that covers this,
otherwise any future change to thsís code could break it with the person
noticing 

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.


signature.asc
Description: PGP signature
___
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] lavc/hevc_ps: parse constraint flags for HEVC REXT

2019-04-01 Thread Michael Niedermayer
On Mon, Apr 01, 2019 at 05:43:20PM +0800, Linjie Fu wrote:
> Parse all the constraint flags.
> 
> It can be passed to hw decoders to detemine the exact profile for Range
> Extension HEVC.
> 
> Signed-off-by: Linjie Fu 
> ---
>  libavcodec/hevc_ps.c | 18 +++---
>  libavcodec/hevc_ps.h | 10 ++
>  2 files changed, 25 insertions(+), 3 deletions(-)

LGTM if this matches the spec

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data


signature.asc
Description: PGP signature
___
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] beautified + accelerated vf_fillborders – Please review

2019-04-01 Thread Carl Eugen Hoyos


> Am 01.04.2019 um 21:39 schrieb Ulf Zibis :
> 
> Hi Carl Eugen,
> 
> Am 28.03.19 um 22:45 schrieb Carl Eugen Hoyos:
>>> Here they are, my new set of patches.
>> Patch 1 is wrong.
> 
> Can you please tell me more detailed, what is wrong with the indentations?

It’s correct as it is now, please don’t change it.

Carl Eugen
___
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] There may be a bug for .mp4 reader.

2019-04-01 Thread Yufei He
On 04/01/2019 01:42 PM, Devin Heitmueller wrote:
> Hello Yufei,
>
>> On Apr 1, 2019, at 1:21 PM, Yufei He  wrote:
>>
>> Hi
>>
>> There may be a bug for .mp4 reader.
>>
>> On decoding some ntsc mp4 files with my h.264 codec, from actvx I received,
>>
>> avctx->framerate.den is 100
>>
>> avctx->framerate.num is 2997
>>
>> avctx->pkt_timebase.num is 1
>> avctx->pkt_timebase.den is 2997
>>
>> Duration of every packet I received from ff_decode_get_packet(avctx, ) 
>> is 100, which means it's a encoded frame. But actually, it's a encoded 
>> field, it's duration should be 50.
> Libavcodec doesn’t have any support for delivering individual fields.  
> Decoders are expected to reassemble fields into frames before providing them 
> back to callers.
>
> Presumably this is some sort of PAFF encoded stream?  Does it decode properly 
> when using the software h.264 decoder?
>
> Devin
Hi Devin

The data decoded is in frames, my problem is the source compressed data: 
it could be a field or a frame depending on files, every packet for 
compressed data has duration and it should be accurate, I use it 
directly instead of parsing it again. it seems it's not correct for some 
.mp4 files. and I find it's not correct for xavc mxf long gop files 
today, though xavc intra files are good.

Yufei.
> ---
> Devin Heitmueller - LTN Global Communications
> dheitmuel...@ltnglobal.com
>
>
>
>
>
> ___
> 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] beautified + accelerated vf_fillborders – Please review

2019-04-01 Thread Ulf Zibis
Hi Carl Eugen,

Am 28.03.19 um 22:45 schrieb Carl Eugen Hoyos:
>> Here they are, my new set of patches.
> Patch 1 is wrong.

Can you please tell me more detailed, what is wrong with the indentations?

-Ulf

___
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] lavf/mov: skip extradata check in esds for MPEG-1/2 audio

2019-04-01 Thread Gyan



On 01-04-2019 10:22 AM, Gyan wrote:



On 28-03-2019 11:04 PM, Gyan wrote:


0001-lavf-mov-skip-extradata-check-in-esds-for-MPEG-1-2-a.patch

 From 7e10e1c58e69137487ff0da85caf1c350b3262ae Mon Sep 17 00:00:00 2001
From: Gyan Doshi
Date: Thu, 28 Mar 2019 22:59:30 +0530
Subject: [PATCH] lavf/mov: skip extradata check in esds for MPEG-1/2 
audio


As per 14496-3 9.D.2.2, it's not defined for these audio object types.

Fixes #7817.
---
  libavformat/isom.c | 4 
  1 file changed, 4 insertions(+)

diff --git a/libavformat/isom.c b/libavformat/isom.c
index 0a4d901be5..4358dc4a6a 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -534,6 +534,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
  len = ff_mp4_read_descr(fc, pb, );
  if (tag == MP4DecSpecificDescrTag) {
  av_log(fc, AV_LOG_TRACE, "Specific MPEG-4 header len=%d\n", 
len);

+    /* As per 14496-3:2009 9.D.2.2, No decSpecificInfo is defined
+   for MPEG-1 Audio or MPEG-2 Audio; MPEG-2 AAC excluded. */
+    if (object_type_id == 0x69 || object_type_id == 0x6b)
+    return 0;
  if (!len || (uint64_t)len > (1<<30))
  return AVERROR_INVALIDDATA;
  if ((ret = ff_get_extradata(fc, st->codecpar, pb, len)) < 0)
-- 2.19.2


Will push soon.


Pushed as 8eca42e6320ebfc682a1309bb40d019b41a9dfd5

Gyan
___
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] There may be a bug for .mp4 reader.

2019-04-01 Thread Devin Heitmueller
Hello Yufei,

> On Apr 1, 2019, at 1:21 PM, Yufei He  wrote:
> 
> Hi
> 
> There may be a bug for .mp4 reader.
> 
> On decoding some ntsc mp4 files with my h.264 codec, from actvx I received,
> 
> avctx->framerate.den is 100
> 
> avctx->framerate.num is 2997
> 
> avctx->pkt_timebase.num is 1
> avctx->pkt_timebase.den is 2997
> 
> Duration of every packet I received from ff_decode_get_packet(avctx, ) is 
> 100, which means it's a encoded frame. But actually, it's a encoded field, 
> it's duration should be 50.

Libavcodec doesn’t have any support for delivering individual fields.  Decoders 
are expected to reassemble fields into frames before providing them back to 
callers.

Presumably this is some sort of PAFF encoded stream?  Does it decode properly 
when using the software h.264 decoder?

Devin

---
Devin Heitmueller - LTN Global Communications
dheitmuel...@ltnglobal.com





___
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] There may be a bug for .mp4 reader.

2019-04-01 Thread Yufei He
Hi

There may be a bug for .mp4 reader.

On decoding some ntsc mp4 files with my h.264 codec, from actvx I received,

avctx->framerate.den is 100

avctx->framerate.num is 2997

avctx->pkt_timebase.num is 1
avctx->pkt_timebase.den is 2997

Duration of every packet I received from ff_decode_get_packet(avctx, ) is 
100, which means it's a encoded frame. But actually, it's a encoded field, it's 
duration should be 50.

Regards.

Yufei
___
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] x11grab: fix vertical repositioning

2019-04-01 Thread Octavio Alvarez
On 4/1/19 7:41 AM, Carl Eugen Hoyos wrote:
>> The patch is untested, but it looks fairly straightforward.
> 
> How can this patch be tested?

ffmpeg -y -r 30 -f x11grab -show_region 1 -draw_mouse 0 -s 350x614
-follow_mouse 10 -i :0.0+0,0 -r 30 -preset ultrafast followcapture-test-.mkv

A dotted frame will appear. Try to move the mouse outside of the frame.
Cancel with Ctrl+C when needed.

Without the patch the frame follows the mouse in the up, left and right
direction 10 pixels before the mouse exits the frame. This is correct.
However, for the bottom direction, the frame follows 10 pixels *after*
the mouse exits the frame, which is wrong.

With the patch this should be fixed: for the bottom direction it should
also follow the mouse 10 pixels before the pointer exits the frame.

The "10" pixels can be adjusted in the -follow_mouse 10 argument.

Watching the output file should not be needed. It's the mouse-following
behavior that has the bug.

Octavio.
___
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] fftools/ffmpeg.c: allow forcing input framerate on streamcopy

2019-04-01 Thread Leo Izen
Bumping this? I'd like to request a review because I think being able to 
set the input framerate on streamcopy is worthwhile. In case of 
formatting issues with the reply email, I've attached the patch file as 
well.


In terms of testing, I've tested this with various input formats 
(matroska, mp4, avi, nut) and various output formats as well, both 
shrinking and growing the framerate.


On 1/9/19 5:26 PM, Leo Izen wrote:

---
  fftools/ffmpeg.c | 19 ++-
  1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 544f1a1cef..f4bd5d97b7 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2038,12 +2038,14 @@ static void do_streamcopy(InputStream *ist, 
OutputStream *ost, const AVPacket *p
  if (ost->enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO)
  ost->sync_opts++;
  
-if (pkt->pts != AV_NOPTS_VALUE)

+if (ist->framerate.num)
+opkt.pts = av_rescale_q(ist->pts, AV_TIME_BASE_Q, ost->mux_timebase) - 
ost_tb_start_time;
+else if (pkt->pts != AV_NOPTS_VALUE)
  opkt.pts = av_rescale_q(pkt->pts, ist->st->time_base, 
ost->mux_timebase) - ost_tb_start_time;
  else
  opkt.pts = AV_NOPTS_VALUE;
  
-if (pkt->dts == AV_NOPTS_VALUE)

+if (pkt->dts == AV_NOPTS_VALUE || ist->framerate.num)
  opkt.dts = av_rescale_q(ist->dts, AV_TIME_BASE_Q, ost->mux_timebase);
  else
  opkt.dts = av_rescale_q(pkt->dts, ist->st->time_base, 
ost->mux_timebase);
@@ -2597,7 +2599,7 @@ static int process_input_packet(InputStream *ist, const 
AVPacket *pkt, int no_eo
  avpkt = *pkt;
  }
  
-if (pkt && pkt->dts != AV_NOPTS_VALUE) {

+if (pkt && pkt->dts != AV_NOPTS_VALUE && !ist->framerate.num) {
  ist->next_dts = ist->dts = av_rescale_q(pkt->dts, ist->st->time_base, 
AV_TIME_BASE_Q);
  if (ist->dec_ctx->codec_type != AVMEDIA_TYPE_VIDEO || 
!ist->decoding_needed)
  ist->next_pts = ist->pts = ist->dts;
@@ -3153,8 +3155,15 @@ static int init_output_stream_streamcopy(OutputStream 
*ost)
  else
  sar = par_src->sample_aspect_ratio;
  ost->st->sample_aspect_ratio = par_dst->sample_aspect_ratio = sar;
-ost->st->avg_frame_rate = ist->st->avg_frame_rate;
-ost->st->r_frame_rate = ist->st->r_frame_rate;
+
+if (ist->framerate.num) {
+ost->st->avg_frame_rate = ist->framerate;
+ost->st->r_frame_rate = ist->framerate;
+} else {
+ost->st->avg_frame_rate = ist->st->avg_frame_rate;
+ost->st->r_frame_rate = ist->st->r_frame_rate;
+}
+
  break;
  }
  
>From 8338eb06ceb8e8f954a5e0740751106fb1f9ab44 Mon Sep 17 00:00:00 2001
From: Leo Izen 
Date: Fri, 19 Oct 2018 19:26:41 -0400
Subject: [PATCH] fftools/ffmpeg.c: allow forcing input framerate on streamcopy

---
 fftools/ffmpeg.c | 19 ++-
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 544f1a1cef..f4bd5d97b7 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2038,12 +2038,14 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
 if (ost->enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO)
 ost->sync_opts++;
 
-if (pkt->pts != AV_NOPTS_VALUE)
+if (ist->framerate.num)
+opkt.pts = av_rescale_q(ist->pts, AV_TIME_BASE_Q, ost->mux_timebase) - ost_tb_start_time;
+else if (pkt->pts != AV_NOPTS_VALUE)
 opkt.pts = av_rescale_q(pkt->pts, ist->st->time_base, ost->mux_timebase) - ost_tb_start_time;
 else
 opkt.pts = AV_NOPTS_VALUE;
 
-if (pkt->dts == AV_NOPTS_VALUE)
+if (pkt->dts == AV_NOPTS_VALUE || ist->framerate.num)
 opkt.dts = av_rescale_q(ist->dts, AV_TIME_BASE_Q, ost->mux_timebase);
 else
 opkt.dts = av_rescale_q(pkt->dts, ist->st->time_base, ost->mux_timebase);
@@ -2597,7 +2599,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
 avpkt = *pkt;
 }
 
-if (pkt && pkt->dts != AV_NOPTS_VALUE) {
+if (pkt && pkt->dts != AV_NOPTS_VALUE && !ist->framerate.num) {
 ist->next_dts = ist->dts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q);
 if (ist->dec_ctx->codec_type != AVMEDIA_TYPE_VIDEO || !ist->decoding_needed)
 ist->next_pts = ist->pts = ist->dts;
@@ -3153,8 +3155,15 @@ static int init_output_stream_streamcopy(OutputStream *ost)
 else
 sar = par_src->sample_aspect_ratio;
 ost->st->sample_aspect_ratio = par_dst->sample_aspect_ratio = sar;
-ost->st->avg_frame_rate = ist->st->avg_frame_rate;
-ost->st->r_frame_rate = ist->st->r_frame_rate;
+
+if (ist->framerate.num) {
+ost->st->avg_frame_rate = ist->framerate;
+ost->st->r_frame_rate = ist->framerate;
+} else {
+ost->st->avg_frame_rate = ist->st->avg_frame_rate;
+ost->st->r_frame_rate = 

Re: [FFmpeg-devel] [PATCH 4/5] x86/opusdsp: implement FMA3 accelerated postfilter and deemphasis

2019-04-01 Thread James Almer
On 4/1/2019 9:13 AM, Lynne wrote:
> Mar 31, 2019, 11:49 PM by jamr...@gmail.com:
> 
>> A float ret value needs to be in xmm0, and you swapped m0 with m2 on
>> Win64. This is the source of the fate failure.
>>
> Attached a patch to fix this.
> 
>> %if WIN64
>> -    SWAP 0, 2
>> -%endif
>> +    shufps m0, m2, 0
>> +%else
>>       shufps m0, m0, 0
>> +%endif
>> %endif
> 
> 0001-x86-opusdsp-fix-WIN64-return-value.patch
> 
> From 98e93b6f322a2a9dee7499fe87b74cf50a33b022 Mon Sep 17 00:00:00 2001
> From: Lynne 
> Date: Mon, 1 Apr 2019 13:06:34 +0100
> Subject: [PATCH] x86/opusdsp: fix WIN64 return value
> 
> ---
>  libavcodec/x86/opusdsp.asm | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/x86/opusdsp.asm b/libavcodec/x86/opusdsp.asm
> index ed65614e06..a7bff4f0b3 100644
> --- a/libavcodec/x86/opusdsp.asm
> +++ b/libavcodec/x86/opusdsp.asm
> @@ -40,9 +40,10 @@ cglobal opus_deemphasis, 4, 4, 8, out, in, coeff, len
>  VBROADCASTSS m0, coeffm
>  %else
>  %if WIN64
> -SWAP 0, 2
> -%endif
> +shufps m0, m2, 0

No, like this shufps will interleave the values from m2 and m0. The
correct instruction would be

shufps m0, m2, m2, 0

Where m2 is used for both input arguments, and the VEX encoding lets us
use another reg as output.
Tested and pushed it with that change. 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".

[FFmpeg-devel] [PATCH v2] Fix sdp size check on fmtp integer parameters

2019-04-01 Thread Olivier Maignial
RFC-4566 do not give any limit of size on interger parameters given in fmtp 
line.
By reading some more RFCs it is possible to find examples where some integers 
parameters are greater than 32 (see RFC-6416, 7.4)

Instead I propose to check just check the eventual integer overflow.
Using INT_MIN and INT_MAX ensure that it will work whatever the size of int 
given by compiler

Signed-off-by: Olivier Maignial 
---

Changes v1 -> v2:
- Removed line break at end of 'if' line before brace
- Added Signed-Off-By line

 libavformat/rtpdec_mpeg4.c | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/libavformat/rtpdec_mpeg4.c b/libavformat/rtpdec_mpeg4.c
index 994ab49..14caa0a 100644
--- a/libavformat/rtpdec_mpeg4.c
+++ b/libavformat/rtpdec_mpeg4.c
@@ -289,15 +289,23 @@ static int parse_fmtp(AVFormatContext *s,
 for (i = 0; attr_names[i].str; ++i) {
 if (!av_strcasecmp(attr, attr_names[i].str)) {
 if (attr_names[i].type == ATTR_NAME_TYPE_INT) {
-int val = atoi(value);
-if (val > 32) {
+char *end_ptr = NULL;
+long int val = strtol(value, _ptr, 10);
+if (value[0] == '\n' || end_ptr[0] != '\0') {
 av_log(s, AV_LOG_ERROR,
-   "The %s field size is invalid (%d)\n",
+   "The %s field value is not a number (%s)\n",
+   attr, value);
+return AVERROR_INVALIDDATA;
+}
+
+if (val > INT_MAX || val < INT_MIN) {
+av_log(s, AV_LOG_ERROR,
+   "The %s field size is invalid (%ld)\n",
attr, val);
 return AVERROR_INVALIDDATA;
 }
 *(int *)((char *)data+
-attr_names[i].offset) = val;
+attr_names[i].offset) = (int) val;
 } else if (attr_names[i].type == ATTR_NAME_TYPE_STR) {
 char *val = av_strdup(value);
 if (!val)
-- 
2.7.4

___
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] x11grab: fix vertical repositioning

2019-04-01 Thread Carl Eugen Hoyos
2019-03-28 5:52 GMT+01:00, Octavio Alvarez :
> There is a calculation error in xcbgrab_reposition() that breaks
> vertical repositioning on follow_mouse. It made the bottom
> reposition occur when moving the mouse lower than N pixels after
> the capture bottom edge, instead of before.
>
> This commit fixes the calculation to match the documentation.
>
> follow_mouse: centered or number of pixels. The documentation says:
>
> When it is specified with "centered", the grabbing region follows
> the mouse pointer and keeps the pointer at the center of region;
> otherwise, the region follows only when the mouse pointer reaches
> within PIXELS (greater than zero) to the edge of region.

> The patch is untested, but it looks fairly straightforward.

How can this patch be tested?

Carl Eugen
___
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/2] libavcodec/zmbv: change 24-bit decoder channel order, from RGB24 to BGR24

2019-04-01 Thread Tomas Härdin
mån 2019-04-01 klockan 13:29 +0100 skrev Matthew Fearnley:
> > On 1 Apr 2019, at 10:28, Tomas Härdin  wrote:
> > 
> > fre 2019-03-29 klockan 22:23 + skrev Matthew Fearnley:
> > > > > On Wed, 27 Mar 2019 at 09:42, Tomas Härdin  > > > > e> wrote:
> > > > > Additional minor fix: use PTRDIFF_SPECIFIER for `src - c-
> > > > > >decomp_buf`.
> > > > > Other bit depths saw this change in ced0d6c14d, but this
> > > > > instance was
> > > > > missed, presumably because of the #ifdef block.
> > > > 
> > > > I think it'd be best to split this off into its own patch, even
> > > > if it's
> > > > trivial
> > > > 
> > > 
> > > Yeah, I think you're right.
> > > I'm attaching two patches here, if that works..
> > 
> > You got the commit messages mixed up :) Otherwise they look OK
> 
> Doh!
> Do I need to correct that, or is it easy enough for you to fix up
> manually?

Easy enough to fix. I'll wait a day for more comments before pushing

/Tomas
___
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 for supporting m264 on h.264 decoding and encoding.

2019-04-01 Thread Nicolas George
Ronald S. Bultje (12019-04-01):
> I would like to propose that we delay further consideration of this patch
> until Thilo has organized the vote [1] on whether we want to allow
> closed-source software integration in FFmpeg.

Seconded.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature
___
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 for supporting m264 on h.264 decoding and encoding.

2019-04-01 Thread Ronald S. Bultje
Hi,

On Fri, Mar 29, 2019 at 12:15 PM Yufei He  wrote:

> Hi
>
> This is the fixed version of this patch that follows the way other
> companies do on supporting FFmpeg.


I would like to propose that we delay further consideration of this patch
until Thilo has organized the vote [1] on whether we want to allow
closed-source software integration in FFmpeg.

Ronald

[1] http://ffmpeg.org/pipermail/ffmpeg-devel/2019-March/241450.html
___
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/2] libavcodec/zmbv: change 24-bit decoder channel order, from RGB24 to BGR24

2019-04-01 Thread Matthew Fearnley


> On 1 Apr 2019, at 10:28, Tomas Härdin  wrote:
> 
> fre 2019-03-29 klockan 22:23 + skrev Matthew Fearnley:
 On Wed, 27 Mar 2019 at 09:42, Tomas Härdin  wrote:
 Additional minor fix: use PTRDIFF_SPECIFIER for `src - c->decomp_buf`.
 Other bit depths saw this change in ced0d6c14d, but this instance was
 missed, presumably because of the #ifdef block.
>>> 
>>> I think it'd be best to split this off into its own patch, even if it's
>>> trivial
>>> 
>> 
>> Yeah, I think you're right.
>> I'm attaching two patches here, if that works..
> 
> You got the commit messages mixed up :) Otherwise they look OK
Doh!
Do I need to correct that, or is it easy enough for you to fix up manually?
> 
> /Tomas
> ___
> 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 4/5] x86/opusdsp: implement FMA3 accelerated postfilter and deemphasis

2019-04-01 Thread Lynne
Mar 31, 2019, 11:49 PM by jamr...@gmail.com:

> A float ret value needs to be in xmm0, and you swapped m0 with m2 on
> Win64. This is the source of the fate failure.
>

Attached a patch to fix this.

> %if WIN64
> -    SWAP 0, 2
> -%endif
> +    shufps m0, m2, 0
> +%else
>      shufps m0, m0, 0
> +%endif
> %endif
>From 98e93b6f322a2a9dee7499fe87b74cf50a33b022 Mon Sep 17 00:00:00 2001
From: Lynne 
Date: Mon, 1 Apr 2019 13:06:34 +0100
Subject: [PATCH] x86/opusdsp: fix WIN64 return value

---
 libavcodec/x86/opusdsp.asm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/x86/opusdsp.asm b/libavcodec/x86/opusdsp.asm
index ed65614e06..a7bff4f0b3 100644
--- a/libavcodec/x86/opusdsp.asm
+++ b/libavcodec/x86/opusdsp.asm
@@ -40,9 +40,10 @@ cglobal opus_deemphasis, 4, 4, 8, out, in, coeff, len
 VBROADCASTSS m0, coeffm
 %else
 %if WIN64
-SWAP 0, 2
-%endif
+shufps m0, m2, 0
+%else
 shufps m0, m0, 0
+%endif
 %endif
 
 movaps m4, [tab_st]
-- 
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] lavfi: add nlmeans_opencl filter

2019-04-01 Thread myp...@gmail.com
On Mon, Apr 1, 2019 at 3:53 PM Ruiling Song  wrote:

> Signed-off-by: Ruiling Song 
> ---
> This filter runs about 2x faster on integrated GPU than nlmeans on my
> Skylake CPU.
> Anybody like to give some comments?
>
> Ruiling
>
>  configure   |   1 +
>  doc/filters.texi|   4 +
>  libavfilter/Makefile|   1 +
>  libavfilter/allfilters.c|   1 +
>  libavfilter/opencl/nlmeans.cl   | 108 +
>  libavfilter/opencl_source.h |   1 +
>  libavfilter/vf_nlmeans_opencl.c | 390 
>  7 files changed, 506 insertions(+)
>  create mode 100644 libavfilter/opencl/nlmeans.cl
>  create mode 100644 libavfilter/vf_nlmeans_opencl.c
>
> diff --git a/configure b/configure
> index f6123f53e5..a233512491 100755
> --- a/configure
> +++ b/configure
> @@ -3460,6 +3460,7 @@ mpdecimate_filter_select="pixelutils"
>  minterpolate_filter_select="scene_sad"
>  mptestsrc_filter_deps="gpl"
>  negate_filter_deps="lut_filter"
> +nlmeans_opencl_filter_deps="opencl"
>  nnedi_filter_deps="gpl"
>  ocr_filter_deps="libtesseract"
>  ocv_filter_deps="libopencv"
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 867607d870..21c2c1a4b5 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -19030,6 +19030,10 @@ Apply erosion filter with threshold0 set to 30,
> threshold1 set 40, threshold2 se
>  @end example
>  @end itemize
>
> +@section nlmeans_opencl
> +
> +Non-local Means denoise filter through OpenCL, this filter accepts same
> options as @ref{nlmeans}.
> +
>  @section overlay_opencl
>
>  Overlay one video on top of another.
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index fef6ec5c55..92039bfdcf 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -291,6 +291,7 @@ OBJS-$(CONFIG_MIX_FILTER)+=
> vf_mix.o
>  OBJS-$(CONFIG_MPDECIMATE_FILTER) += vf_mpdecimate.o
>  OBJS-$(CONFIG_NEGATE_FILTER) += vf_lut.o
>  OBJS-$(CONFIG_NLMEANS_FILTER)+= vf_nlmeans.o
> +OBJS-$(CONFIG_NLMEANS_OPENCL_FILTER) += vf_nlmeans_opencl.o
> opencl.o opencl/nlmeans.o
>  OBJS-$(CONFIG_NNEDI_FILTER)  += vf_nnedi.o
>  OBJS-$(CONFIG_NOFORMAT_FILTER)   += vf_format.o
>  OBJS-$(CONFIG_NOISE_FILTER)  += vf_noise.o
> diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> index c51ae0f3c7..2a6390c92d 100644
> --- a/libavfilter/allfilters.c
> +++ b/libavfilter/allfilters.c
> @@ -277,6 +277,7 @@ extern AVFilter ff_vf_mix;
>  extern AVFilter ff_vf_mpdecimate;
>  extern AVFilter ff_vf_negate;
>  extern AVFilter ff_vf_nlmeans;
> +extern AVFilter ff_vf_nlmeans_opencl;
>  extern AVFilter ff_vf_nnedi;
>  extern AVFilter ff_vf_noformat;
>  extern AVFilter ff_vf_noise;
> diff --git a/libavfilter/opencl/nlmeans.cl b/libavfilter/opencl/nlmeans.cl
> new file mode 100644
> index 00..dcb04834ca
> --- /dev/null
> +++ b/libavfilter/opencl/nlmeans.cl
> @@ -0,0 +1,108 @@
> +/*
> + * 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
> + */
> +
> +const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
> +   CLK_ADDRESS_CLAMP_TO_EDGE   |
> +   CLK_FILTER_NEAREST);
> +
> +kernel void horiz_sum(__global uint4 *ii,
> +  __read_only image2d_t src,
> +  int width,
> +  int height,
> +  int4 dx,
> +  int4 dy)
> +{
> +
> +int y = get_global_id(0);
> +int work_size = get_global_size(0);
> +
> +uint4 sum = (uint4)(0);
> +float4 s2;
> +for (int i = 0; i < width; i++) {
> +float s1 = read_imagef(src, sampler, (int2)(i, y)).x;
> +s2.x = read_imagef(src, sampler, (int2)(i+dx.x, y+dy.x)).x;
> +s2.y = read_imagef(src, sampler, (int2)(i+dx.y, y+dy.y)).x;
> +s2.z = read_imagef(src, sampler, (int2)(i+dx.z, y+dy.z)).x;
> +s2.w = read_imagef(src, sampler, (int2)(i+dx.w, y+dy.w)).x;
> +sum += convert_uint4((s1-s2)*(s1-s2) * 255*255);
> +ii[y * width + i] = sum;
> +}
> +}
> +
> +kernel void vert_sum(__global uint4 *ii,
> + int width,
> + int height)
> +{
> +  

[FFmpeg-devel] [PATCH] lavc/qsvenc: no need to include h264.h for jpeg encoder

2019-04-01 Thread Zhong Li
Signed-off-by: Zhong Li 
---
 libavcodec/qsvenc_jpeg.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/qsvenc_jpeg.c b/libavcodec/qsvenc_jpeg.c
index 1e7785a826..1619a335c7 100644
--- a/libavcodec/qsvenc_jpeg.c
+++ b/libavcodec/qsvenc_jpeg.c
@@ -29,7 +29,6 @@
 
 #include "avcodec.h"
 #include "internal.h"
-#include "h264.h"
 #include "qsv.h"
 #include "qsv_internal.h"
 #include "qsvenc.h"
-- 
2.17.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] lavc/qsvenc: expose low_power as a common option for QSV encoder

2019-04-01 Thread Li, Zhong
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Linjie Fu
> Sent: Friday, March 29, 2019 1:19 PM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Fu, Linjie 
> Subject: [FFmpeg-devel] [PATCH] lavc/qsvenc: expose low_power as a
> common option for QSV encoder
> 
> Always exposes low_power option for all qsv encoder, and reports a warning
> if VDENC is not supported in current version of MSDK.
> 
> Signed-off-by: Linjie Fu 
> ---
>  libavcodec/qsvenc.c  | 11 ++-
>  libavcodec/qsvenc.h  |  1 +
>  libavcodec/qsvenc_h264.c |  4 
>  3 files changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index
> 5aa020d47b..751b3028bf 100644
> --- a/libavcodec/qsvenc.c
> +++ b/libavcodec/qsvenc.c
> @@ -495,9 +495,18 @@ static int init_video_param(AVCodecContext *avctx,
> QSVEncContext *q)
>  }
>  }
> 
> +if (q->low_power) {
>  #if QSV_HAVE_VDENC
> -q->param.mfx.LowPower   = q->low_power ?
> MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
> +q->param.mfx.LowPower = MFX_CODINGOPTION_ON; #else
> +av_log(avctx, AV_LOG_WARNING, "The low_power option is "
> +"not supported with this MSDK
> version.\n");
> +q->low_power = 0;
> +q->param.mfx.LowPower = MFX_CODINGOPTION_OFF;
>  #endif
> +} else
> +q->param.mfx.LowPower = MFX_CODINGOPTION_OFF;
> +
>  q->param.mfx.CodecProfile   = q->profile;
>  q->param.mfx.TargetUsage= avctx->compression_level;
>  q->param.mfx.GopPicSize = FFMAX(0, avctx->gop_size);
> diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h index
> 00afbd80aa..0c9887753c 100644
> --- a/libavcodec/qsvenc.h
> +++ b/libavcodec/qsvenc.h
> @@ -89,6 +89,7 @@
>  { "adaptive_b", "Adaptive B-frame placement",
> OFFSET(qsv.adaptive_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1,
> 1, VE }, \
>  { "b_strategy", "Strategy to choose between I/P/B-frames",
> OFFSET(qsv.b_strategy),AV_OPT_TYPE_INT, { .i64 = -1 }, -1,
> 1, VE }, \
>  { "forced_idr", "Forcing I frames as IDR frames",
> OFFSET(qsv.forced_idr), AV_OPT_TYPE_BOOL,{ .i64 = 0  },  0,
> 1, VE }, \
> +{ "low_power", "enable low power mode(experimental: many limitations by
> +mfx version, BRC modes, etc.)", OFFSET(qsv.low_power),
> +AV_OPT_TYPE_BOOL, { .i64 = 0}, 0, 1, VE},\
> 
>  typedef int SetEncodeCtrlCB (AVCodecContext *avctx,
>   const AVFrame *frame,
> mfxEncodeCtrl* enc_ctrl); diff --git a/libavcodec/qsvenc_h264.c
> b/libavcodec/qsvenc_h264.c index f458137848..8e61826eef 100644
> --- a/libavcodec/qsvenc_h264.c
> +++ b/libavcodec/qsvenc_h264.c
> @@ -154,10 +154,6 @@ static const AVOption options[] = {
>  { "auto"   , NULL, 0, AV_OPT_TYPE_CONST, { .i64 =
> MFX_MF_AUTO }, INT_MIN, INT_MAX, VE, "mfmode" },
>  #endif
> 
> -#if QSV_HAVE_VDENC
> -{ "low_power", "enable low power mode(experimental: many
> limitations by mfx version, BRC modes, etc.)", OFFSET(qsv.low_power),
> AV_OPT_TYPE_BOOL, { .i64 =  0 }, 0, 1, VE},
> -#endif
> -
>  { "repeat_pps", "repeat pps for every frame", OFFSET(qsv.repeat_pps),
> AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
> 
>  { NULL },
> --
> 2.17.1

Applied.
___
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] swscale/ppc: VSX-optimize yuv2rgb_full_X

2019-04-01 Thread Lauri Kasanen
./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 \
-s 1200x720 -f null -vframes 100 -pix_fmt $i -nostats \
-cpuflags 0 -v error -

32-bit mul, power8 only.

~6.4x speedup:

rgb24
 214278 UNITS in yuv2packedX,   16384 runs,  0 skips
  33249 UNITS in yuv2packedX,   16384 runs,  0 skips
bgr24
 214616 UNITS in yuv2packedX,   16384 runs,  0 skips
  33233 UNITS in yuv2packedX,   16384 runs,  0 skips
rgba
 214517 UNITS in yuv2packedX,   16384 runs,  0 skips
  33271 UNITS in yuv2packedX,   16384 runs,  0 skips
bgra
 214973 UNITS in yuv2packedX,   16384 runs,  0 skips
  33397 UNITS in yuv2packedX,   16384 runs,  0 skips
argb
 214613 UNITS in yuv2packedX,   16384 runs,  0 skips
  33310 UNITS in yuv2packedX,   16384 runs,  0 skips
bgra
 214637 UNITS in yuv2packedX,   16384 runs,  0 skips
  0 UNITS in yuv2packedX,   16384 runs,  0 skips

Signed-off-by: Lauri Kasanen 
---
 libswscale/ppc/swscale_vsx.c | 160 +++
 1 file changed, 160 insertions(+)

diff --git a/libswscale/ppc/swscale_vsx.c b/libswscale/ppc/swscale_vsx.c
index 6ff8b62..e05f9ec 100644
--- a/libswscale/ppc/swscale_vsx.c
+++ b/libswscale/ppc/swscale_vsx.c
@@ -520,6 +520,139 @@ yuv2NBPSX(16, LE, 0, 16, int32_t)
 break; \
 }

+static av_always_inline void
+yuv2rgb_full_X_vsx_template(SwsContext *c, const int16_t *lumFilter,
+  const int16_t **lumSrc, int lumFilterSize,
+  const int16_t *chrFilter, const int16_t **chrUSrc,
+  const int16_t **chrVSrc, int chrFilterSize,
+  const int16_t **alpSrc, uint8_t *dest,
+  int dstW, int y, enum AVPixelFormat target, int 
hasAlpha)
+{
+vector int16_t vv;
+vector int32_t vy32_l, vy32_r, vu32_l, vu32_r, vv32_l, vv32_r, tmp32;
+vector int32_t R_l, R_r, G_l, G_r, B_l, B_r;
+vector int32_t tmp, tmp2, tmp3, tmp4;
+vector uint16_t rd16, gd16, bd16;
+vector uint8_t rd, bd, gd, ad, out0, out1, tmp8;
+vector int16_t vlumFilter[MAX_FILTER_SIZE], vchrFilter[MAX_FILTER_SIZE];
+const vector int32_t ystart = vec_splats(1 << 9);
+const vector int32_t uvstart = vec_splats((1 << 9) - (128 << 19));
+const vector uint16_t zero16 = vec_splat_u16(0);
+const vector int32_t y_offset = vec_splats(c->yuv2rgb_y_offset);
+const vector int32_t y_coeff = vec_splats(c->yuv2rgb_y_coeff);
+const vector int32_t y_add = vec_splats(1 << 21);
+const vector int32_t v2r_coeff = vec_splats(c->yuv2rgb_v2r_coeff);
+const vector int32_t v2g_coeff = vec_splats(c->yuv2rgb_v2g_coeff);
+const vector int32_t u2g_coeff = vec_splats(c->yuv2rgb_u2g_coeff);
+const vector int32_t u2b_coeff = vec_splats(c->yuv2rgb_u2b_coeff);
+const vector int32_t rgbclip = vec_splats(1 << 30);
+const vector int32_t zero32 = vec_splat_s32(0);
+const vector uint32_t shift22 = vec_splats(22U);
+const vector uint32_t shift10 = vec_splat_u32(10);
+int i, j;
+
+// Various permutations
+const vector uint8_t perm3rg0 = (vector uint8_t) {0x0, 0x10, 0,
+  0x1, 0x11, 0,
+  0x2, 0x12, 0,
+  0x3, 0x13, 0,
+  0x4, 0x14, 0,
+  0x5 };
+const vector uint8_t perm3rg1 = (vector uint8_t) { 0x15, 0,
+  0x6, 0x16, 0,
+  0x7, 0x17, 0 };
+const vector uint8_t perm3tb0 = (vector uint8_t) {0x0, 0x1, 0x10,
+  0x3, 0x4, 0x11,
+  0x6, 0x7, 0x12,
+  0x9, 0xa, 0x13,
+  0xc, 0xd, 0x14,
+  0xf };
+const vector uint8_t perm3tb1 = (vector uint8_t) { 0x0, 0x15,
+  0x2, 0x3, 0x16,
+  0x5, 0x6, 0x17 };
+
+ad = vec_splats((uint8_t) 255);
+
+for (i = 0; i < lumFilterSize; i++)
+vlumFilter[i] = vec_splats(lumFilter[i]);
+for (i = 0; i < chrFilterSize; i++)
+vchrFilter[i] = vec_splats(chrFilter[i]);
+
+for (i = 0; i < dstW; i += 8) {
+vy32_l =
+vy32_r = ystart;
+vu32_l =
+vu32_r =
+vv32_l =
+vv32_r = uvstart;
+
+for (j = 0; j < lumFilterSize; j++) {
+vv = vec_ld(0, [j][i]);
+tmp = vec_mule(vv, vlumFilter[j]);
+tmp2 = vec_mulo(vv, vlumFilter[j]);
+tmp3 = vec_mergeh(tmp, tmp2);
+tmp4 = 

Re: [FFmpeg-devel] [PATCH] avcodec/rscc: Check that the to be uncompressed input is large enough

2019-04-01 Thread Michael Niedermayer
On Mon, Apr 01, 2019 at 10:08:10AM +0200, Paul B Mahol wrote:
> On 4/1/19, Michael Niedermayer  wrote:
> > On Sun, Mar 31, 2019 at 05:35:33PM +0200, Paul B Mahol wrote:
> >> On 3/31/19, Michael Niedermayer  wrote:
> >> > Fixes: Out of array access
> >> > Fixes:
> >> > 13984/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-5734128093233152
> >> >
> >> > Found-by: continuous fuzzing process
> >> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> >> > Signed-off-by: Michael Niedermayer 
> >> > ---
> >> >  libavcodec/rscc.c | 7 +++
> >> >  1 file changed, 7 insertions(+)
> >> >
> >> > diff --git a/libavcodec/rscc.c b/libavcodec/rscc.c
> >> > index 7d4e842cd3..4adee9d7d4 100644
> >> > --- a/libavcodec/rscc.c
> >> > +++ b/libavcodec/rscc.c
> >> > @@ -199,6 +199,13 @@ static int rscc_decode_frame(AVCodecContext
> >> > *avctx,
> >> > void *data,
> >> >  /* If necessary, uncompress tiles, and hijack the bytestream
> >> > reader
> >> > */
> >> >  if (packed_tiles_size != tiles_nb * TILE_SIZE) {
> >> >  uLongf length = tiles_nb * TILE_SIZE;
> >> > +
> >> > +if (bytestream2_get_bytes_left(gbc) < packed_tiles_size) {
> >> > +av_log(avctx, AV_LOG_ERROR, "compressed input
> >> > truncated\n");
> >> > +ret = AVERROR_INVALIDDATA;
> >> > +goto end;
> >> > +}
> >> > +
> >> >  inflated_tiles = av_malloc(length);
> >> >  if (!inflated_tiles) {
> >> >  ret = AVERROR(ENOMEM);
> >> > --
> >> > 2.21.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".
> >>
> >> Please commit without log message.
> >
> > if you prefer that, sure, will do.
> > this will be the only AVERROR_INVALIDDATA case in that file without a log
> > message though.
> 
> Yes, I prefer without log message.
> Printing log messages is also slow.

applied

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Does the universe only have a finite lifespan? No, its going to go on
forever, its just that you wont like living in it. -- Hiranya Peiri


signature.asc
Description: PGP signature
___
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] swscale/ppc: VSX-optimize yuv2rgb_full_2

2019-04-01 Thread Lauri Kasanen
./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 -sws_flags area \
-s 1200x720 -f null -vframes 100 -pix_fmt $i -nostats \
-cpuflags 0 -v error -

32-bit mul, power8 only.

~4x speedup:

rgb24
  52763 UNITS in yuv2packed2,   16384 runs,  0 skips
  13453 UNITS in yuv2packed2,   16384 runs,  0 skips
bgr24
  53144 UNITS in yuv2packed2,   16384 runs,  0 skips
  13616 UNITS in yuv2packed2,   16384 runs,  0 skips
rgba
  52796 UNITS in yuv2packed2,   16384 runs,  0 skips
  12904 UNITS in yuv2packed2,   16384 runs,  0 skips
bgra
  52732 UNITS in yuv2packed2,   16384 runs,  0 skips
  13262 UNITS in yuv2packed2,   16384 runs,  0 skips
argb
  52661 UNITS in yuv2packed2,   16384 runs,  0 skips
  12879 UNITS in yuv2packed2,   16384 runs,  0 skips
bgra
  52662 UNITS in yuv2packed2,   16384 runs,  0 skips
  12932 UNITS in yuv2packed2,   16384 runs,  0 skips

Signed-off-by: Lauri Kasanen 
---
 libswscale/ppc/swscale_vsx.c | 166 +++
 1 file changed, 166 insertions(+)

diff --git a/libswscale/ppc/swscale_vsx.c b/libswscale/ppc/swscale_vsx.c
index 0ac8cac..6ff8b62 100644
--- a/libswscale/ppc/swscale_vsx.c
+++ b/libswscale/ppc/swscale_vsx.c
@@ -520,6 +520,148 @@ yuv2NBPSX(16, LE, 0, 16, int32_t)
 break; \
 }

+#define SETUP(x, buf0, alpha1, buf1, alpha) { \
+x = vec_ld(0, buf0); \
+tmp = vec_mule(x, alpha1); \
+tmp2 = vec_mulo(x, alpha1); \
+tmp3 = vec_mergeh(tmp, tmp2); \
+tmp4 = vec_mergel(tmp, tmp2); \
+\
+x = vec_ld(0, buf1); \
+tmp = vec_mule(x, alpha); \
+tmp2 = vec_mulo(x, alpha); \
+tmp5 = vec_mergeh(tmp, tmp2); \
+tmp6 = vec_mergel(tmp, tmp2); \
+\
+tmp3 = vec_add(tmp3, tmp5); \
+tmp4 = vec_add(tmp4, tmp6); \
+}
+
+
+static av_always_inline void
+yuv2rgb_full_2_vsx_template(SwsContext *c, const int16_t *buf[2],
+ const int16_t *ubuf[2], const int16_t *vbuf[2],
+ const int16_t *abuf[2], uint8_t *dest, int dstW,
+ int yalpha, int uvalpha, int y,
+ enum AVPixelFormat target, int hasAlpha)
+{
+const int16_t *buf0  = buf[0],  *buf1  = buf[1],
+  *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
+  *vbuf0 = vbuf[0], *vbuf1 = vbuf[1],
+  *abuf0 = hasAlpha ? abuf[0] : NULL,
+  *abuf1 = hasAlpha ? abuf[1] : NULL;
+const int16_t  yalpha1 = 4096 - yalpha;
+const int16_t uvalpha1 = 4096 - uvalpha;
+vector int16_t vy, vu, vv, A = vec_splat_s16(0);
+vector int32_t vy32_l, vy32_r, vu32_l, vu32_r, vv32_l, vv32_r, tmp32;
+vector int32_t R_l, R_r, G_l, G_r, B_l, B_r;
+vector int32_t tmp, tmp2, tmp3, tmp4, tmp5, tmp6;
+vector uint16_t rd16, gd16, bd16;
+vector uint8_t rd, bd, gd, ad, out0, out1, tmp8;
+const vector int16_t vyalpha1 = vec_splats(yalpha1);
+const vector int16_t vuvalpha1 = vec_splats(uvalpha1);
+const vector int16_t vyalpha = vec_splats((int16_t) yalpha);
+const vector int16_t vuvalpha = vec_splats((int16_t) uvalpha);
+const vector uint16_t zero16 = vec_splat_u16(0);
+const vector int32_t y_offset = vec_splats(c->yuv2rgb_y_offset);
+const vector int32_t y_coeff = vec_splats(c->yuv2rgb_y_coeff);
+const vector int32_t y_add = vec_splats(1 << 21);
+const vector int32_t v2r_coeff = vec_splats(c->yuv2rgb_v2r_coeff);
+const vector int32_t v2g_coeff = vec_splats(c->yuv2rgb_v2g_coeff);
+const vector int32_t u2g_coeff = vec_splats(c->yuv2rgb_u2g_coeff);
+const vector int32_t u2b_coeff = vec_splats(c->yuv2rgb_u2b_coeff);
+const vector int32_t rgbclip = vec_splats(1 << 30);
+const vector int32_t zero32 = vec_splat_s32(0);
+const vector uint32_t shift19 = vec_splats(19U);
+const vector uint32_t shift22 = vec_splats(22U);
+const vector uint32_t shift10 = vec_splat_u32(10);
+const vector int32_t dec128 = vec_splats(128 << 19);
+const vector int32_t add18 = vec_splats(1 << 18);
+int i;
+
+// Various permutations
+const vector uint8_t perm3rg0 = (vector uint8_t) {0x0, 0x10, 0,
+  0x1, 0x11, 0,
+  0x2, 0x12, 0,
+  0x3, 0x13, 0,
+  0x4, 0x14, 0,
+  0x5 };
+const vector uint8_t perm3rg1 = (vector uint8_t) { 0x15, 0,
+  0x6, 0x16, 0,
+  0x7, 0x17, 0 };
+const vector uint8_t perm3tb0 = (vector uint8_t) {0x0, 0x1, 0x10,
+  0x3, 0x4, 0x11,
+  0x6, 0x7, 0x12,
+  0x9, 0xa, 0x13,
+ 

[FFmpeg-devel] [PATCH] lavc/hevc_ps: parse constraint flags for HEVC REXT

2019-04-01 Thread Linjie Fu
Parse all the constraint flags.

It can be passed to hw decoders to detemine the exact profile for Range
Extension HEVC.

Signed-off-by: Linjie Fu 
---
 libavcodec/hevc_ps.c | 18 +++---
 libavcodec/hevc_ps.h | 10 ++
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index 80df417e4f..1365a9d640 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -295,9 +295,21 @@ static int decode_profile_tier_level(GetBitContext *gb, 
AVCodecContext *avctx,
 ptl->non_packed_constraint_flag = get_bits1(gb);
 ptl->frame_only_constraint_flag = get_bits1(gb);
 
-skip_bits(gb, 16); // XXX_reserved_zero_44bits[0..15]
-skip_bits(gb, 16); // XXX_reserved_zero_44bits[16..31]
-skip_bits(gb, 12); // XXX_reserved_zero_44bits[32..43]
+ptl->max_12bit_constraint_flag= get_bits1(gb);
+ptl->max_10bit_constraint_flag= get_bits1(gb);
+ptl->max_8bit_constraint_flag = get_bits1(gb);
+ptl->max_422chroma_constraint_flag= get_bits1(gb);
+ptl->max_420chroma_constraint_flag= get_bits1(gb);
+ptl->max_monochrome_constraint_flag   = get_bits1(gb);
+ptl->intra_constraint_flag= get_bits1(gb);
+ptl->one_picture_only_constraint_flag = get_bits1(gb);
+ptl->lower_bit_rate_constraint_flag   = get_bits1(gb);
+
+skip_bits(gb, 16); // XXX_reserved_zero_34bits[0..15]
+skip_bits(gb, 16); // XXX_reserved_zero_34bits[16..31]
+skip_bits(gb, 2);  // XXX_reserved_zero_34bits[32..33]
+
+ptl->inbld_flag = get_bits1(gb);
 
 return 0;
 }
diff --git a/libavcodec/hevc_ps.h b/libavcodec/hevc_ps.h
index bbaa9205ef..1c95a1848b 100644
--- a/libavcodec/hevc_ps.h
+++ b/libavcodec/hevc_ps.h
@@ -182,6 +182,16 @@ typedef struct PTLCommon {
 uint8_t interlaced_source_flag;
 uint8_t non_packed_constraint_flag;
 uint8_t frame_only_constraint_flag;
+uint8_t max_12bit_constraint_flag;
+uint8_t max_10bit_constraint_flag;
+uint8_t max_8bit_constraint_flag;
+uint8_t max_422chroma_constraint_flag;
+uint8_t max_420chroma_constraint_flag;
+uint8_t max_monochrome_constraint_flag;
+uint8_t intra_constraint_flag;
+uint8_t one_picture_only_constraint_flag;
+uint8_t lower_bit_rate_constraint_flag;
+uint8_t inbld_flag;
 } PTLCommon;
 
 typedef struct PTL {
-- 
2.17.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 1/2] libavcodec/zmbv: change 24-bit decoder channel order, from RGB24 to BGR24

2019-04-01 Thread Tomas Härdin
fre 2019-03-29 klockan 22:23 + skrev Matthew Fearnley:
> > On Wed, 27 Mar 2019 at 09:42, Tomas Härdin  wrote:
> > > Additional minor fix: use PTRDIFF_SPECIFIER for `src - c->decomp_buf`.
> > > Other bit depths saw this change in ced0d6c14d, but this instance was
> > > missed, presumably because of the #ifdef block.
> > 
> > I think it'd be best to split this off into its own patch, even if it's
> > trivial
> > 
> 
> Yeah, I think you're right.
> I'm attaching two patches here, if that works..

You got the commit messages mixed up :) Otherwise they look OK

/Tomas
___
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] avformat/mxfenc: support XAVC long gop

2019-04-01 Thread Tomas Härdin
fre 2019-03-29 klockan 08:30 -0700 skrev Baptiste Coudurier:
> Hey Tomas, I hope you are doing well
> 
> > > > On Mar 29, 2019, at 2:41 AM, Tomas Härdin  wrote:
> > 
> > tor 2019-03-28 klockan 08:50 -0700 skrev Baptiste Coudurier:
> > > ---
> > >  libavformat/mxf.h|   1 +
> > >  libavformat/mxfenc.c | 194 ---
> > >  2 files changed, 145 insertions(+), 50 deletions(-)
> > > 
> > > diff --git a/libavformat/mxf.h b/libavformat/mxf.h
> > > index 4394450dea..f32124f772 100644
> > > --- a/libavformat/mxf.h
> > > +++ b/libavformat/mxf.h
> > > @@ -1317,6 +1330,13 @@ static int64_t 
> > > mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID
> > >  avio_w8(pb, sc->field_dominance);
> > >  }
> > > 
> > > +if (st->codecpar->codec_id == AV_CODEC_ID_H264 && !sc->avc_intra) {
> > > +// write avc sub descriptor ref
> > > +mxf_write_local_tag(pb, 8 + 16, 0x8100);
> > > +mxf_write_refs_count(pb, 1);
> > > +mxf_write_uuid(pb, AVCSubDescriptor, 0);
> > > +}
> > 
> > Should this always be written for long gop AVC? Not just XAVC? Same
> > goes for mxf_write_avc_subdesc() I think, unless I'm reading this 
> > incorrectly..
> 
> The code will write always write it for AV_CODEC_ID_H264 except if it is 
> avc_intra (it uses the legacy mpegvideo desc),
> so it will always be written for long gop as well. There is no check for XAVC 
> technically.
> 
> > >  static void mxf_write_s436m_anc_desc(AVFormatContext *s, AVStream *st)
> > > @@ -2136,30 +2196,30 @@ static const struct {
> > >  int frame_size;
> > >  int profile;
> > >  uint8_t interlaced;
> > > -int long_gop; // 1 or 0 when there are separate UIDs for Long GOP 
> > > and Intra, -1 when Intra/LGOP detection can be ignored
> > > +int intra_only; // 1 or 0 when there are separate UIDs for Long GOP 
> > > and Intra, -1 when Intra/LGOP detection can be ignored
> > 
> > Any particular reason for inverting this logic? Leaving it as is would
> > make the patch smaller..
> > 
> > /Tomas
> 
> Checking long gop looks weird to me since the specs don’t make that 
> distinction, they do however make the explicit distinction for intra only
> profile, so it feels more intuitive to mark them intra only. No strong 
> opinion though.

I guess that's fair. If I were feeling super-nitpicky I'd suggest
putting the flip in a separate patch

/Tomas
___
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] lavf/movenc: fix tmcd writing for non-MP4/MOV modes

2019-04-01 Thread Tomas Härdin
sön 2019-03-31 klockan 00:11 +0530 skrev Gyan:
> Regression since, I believe, 42cb050a05

Sounds like there should be a test case to go along with it so it
doesn't re-regress in the future :)

/Tomas
___
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 for supporting m264 on h.264 decoding and encoding.

2019-04-01 Thread Tomas Härdin
fre 2019-03-29 klockan 16:14 + skrev Yufei He:
diff --git a/Changelog b/Changelog
> index 4d80e5b..ce0daf8 100644
> --- a/Changelog
> +++ b/Changelog
> @@ -2753,6 +2757,7 @@ msmpeg4v3_decoder_select="h263_decoder"
>  msmpeg4v3_encoder_select="h263_encoder"
>  mss2_decoder_select="mpegvideo qpeldsp vc1_decoder"
>  mts2_decoder_select="mss34dsp"
> +mvm264_deps_any="libdl LoadLibrary"

These aren't needed

/Tomas
___
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/rscc: Check that the to be uncompressed input is large enough

2019-04-01 Thread Paul B Mahol
On 4/1/19, Michael Niedermayer  wrote:
> On Sun, Mar 31, 2019 at 05:35:33PM +0200, Paul B Mahol wrote:
>> On 3/31/19, Michael Niedermayer  wrote:
>> > Fixes: Out of array access
>> > Fixes:
>> > 13984/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-5734128093233152
>> >
>> > Found-by: continuous fuzzing process
>> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
>> > Signed-off-by: Michael Niedermayer 
>> > ---
>> >  libavcodec/rscc.c | 7 +++
>> >  1 file changed, 7 insertions(+)
>> >
>> > diff --git a/libavcodec/rscc.c b/libavcodec/rscc.c
>> > index 7d4e842cd3..4adee9d7d4 100644
>> > --- a/libavcodec/rscc.c
>> > +++ b/libavcodec/rscc.c
>> > @@ -199,6 +199,13 @@ static int rscc_decode_frame(AVCodecContext
>> > *avctx,
>> > void *data,
>> >  /* If necessary, uncompress tiles, and hijack the bytestream
>> > reader
>> > */
>> >  if (packed_tiles_size != tiles_nb * TILE_SIZE) {
>> >  uLongf length = tiles_nb * TILE_SIZE;
>> > +
>> > +if (bytestream2_get_bytes_left(gbc) < packed_tiles_size) {
>> > +av_log(avctx, AV_LOG_ERROR, "compressed input
>> > truncated\n");
>> > +ret = AVERROR_INVALIDDATA;
>> > +goto end;
>> > +}
>> > +
>> >  inflated_tiles = av_malloc(length);
>> >  if (!inflated_tiles) {
>> >  ret = AVERROR(ENOMEM);
>> > --
>> > 2.21.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".
>>
>> Please commit without log message.
>
> if you prefer that, sure, will do.
> this will be the only AVERROR_INVALIDDATA case in that file without a log
> message though.

Yes, I prefer without log message.
Printing log messages is also slow.

>
> Thanks
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> It is dangerous to be right in matters on which the established authorities
> are wrong. -- Voltaire
>
___
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] lavfi: add nlmeans_opencl filter

2019-04-01 Thread Ruiling Song
Signed-off-by: Ruiling Song 
---
This filter runs about 2x faster on integrated GPU than nlmeans on my Skylake 
CPU.
Anybody like to give some comments?

Ruiling

 configure   |   1 +
 doc/filters.texi|   4 +
 libavfilter/Makefile|   1 +
 libavfilter/allfilters.c|   1 +
 libavfilter/opencl/nlmeans.cl   | 108 +
 libavfilter/opencl_source.h |   1 +
 libavfilter/vf_nlmeans_opencl.c | 390 
 7 files changed, 506 insertions(+)
 create mode 100644 libavfilter/opencl/nlmeans.cl
 create mode 100644 libavfilter/vf_nlmeans_opencl.c

diff --git a/configure b/configure
index f6123f53e5..a233512491 100755
--- a/configure
+++ b/configure
@@ -3460,6 +3460,7 @@ mpdecimate_filter_select="pixelutils"
 minterpolate_filter_select="scene_sad"
 mptestsrc_filter_deps="gpl"
 negate_filter_deps="lut_filter"
+nlmeans_opencl_filter_deps="opencl"
 nnedi_filter_deps="gpl"
 ocr_filter_deps="libtesseract"
 ocv_filter_deps="libopencv"
diff --git a/doc/filters.texi b/doc/filters.texi
index 867607d870..21c2c1a4b5 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -19030,6 +19030,10 @@ Apply erosion filter with threshold0 set to 30, 
threshold1 set 40, threshold2 se
 @end example
 @end itemize
 
+@section nlmeans_opencl
+
+Non-local Means denoise filter through OpenCL, this filter accepts same 
options as @ref{nlmeans}.
+
 @section overlay_opencl
 
 Overlay one video on top of another.
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index fef6ec5c55..92039bfdcf 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -291,6 +291,7 @@ OBJS-$(CONFIG_MIX_FILTER)+= vf_mix.o
 OBJS-$(CONFIG_MPDECIMATE_FILTER) += vf_mpdecimate.o
 OBJS-$(CONFIG_NEGATE_FILTER) += vf_lut.o
 OBJS-$(CONFIG_NLMEANS_FILTER)+= vf_nlmeans.o
+OBJS-$(CONFIG_NLMEANS_OPENCL_FILTER) += vf_nlmeans_opencl.o opencl.o 
opencl/nlmeans.o
 OBJS-$(CONFIG_NNEDI_FILTER)  += vf_nnedi.o
 OBJS-$(CONFIG_NOFORMAT_FILTER)   += vf_format.o
 OBJS-$(CONFIG_NOISE_FILTER)  += vf_noise.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index c51ae0f3c7..2a6390c92d 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -277,6 +277,7 @@ extern AVFilter ff_vf_mix;
 extern AVFilter ff_vf_mpdecimate;
 extern AVFilter ff_vf_negate;
 extern AVFilter ff_vf_nlmeans;
+extern AVFilter ff_vf_nlmeans_opencl;
 extern AVFilter ff_vf_nnedi;
 extern AVFilter ff_vf_noformat;
 extern AVFilter ff_vf_noise;
diff --git a/libavfilter/opencl/nlmeans.cl b/libavfilter/opencl/nlmeans.cl
new file mode 100644
index 00..dcb04834ca
--- /dev/null
+++ b/libavfilter/opencl/nlmeans.cl
@@ -0,0 +1,108 @@
+/*
+ * 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
+ */
+
+const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
+   CLK_ADDRESS_CLAMP_TO_EDGE   |
+   CLK_FILTER_NEAREST);
+
+kernel void horiz_sum(__global uint4 *ii,
+  __read_only image2d_t src,
+  int width,
+  int height,
+  int4 dx,
+  int4 dy)
+{
+
+int y = get_global_id(0);
+int work_size = get_global_size(0);
+
+uint4 sum = (uint4)(0);
+float4 s2;
+for (int i = 0; i < width; i++) {
+float s1 = read_imagef(src, sampler, (int2)(i, y)).x;
+s2.x = read_imagef(src, sampler, (int2)(i+dx.x, y+dy.x)).x;
+s2.y = read_imagef(src, sampler, (int2)(i+dx.y, y+dy.y)).x;
+s2.z = read_imagef(src, sampler, (int2)(i+dx.z, y+dy.z)).x;
+s2.w = read_imagef(src, sampler, (int2)(i+dx.w, y+dy.w)).x;
+sum += convert_uint4((s1-s2)*(s1-s2) * 255*255);
+ii[y * width + i] = sum;
+}
+}
+
+kernel void vert_sum(__global uint4 *ii,
+ int width,
+ int height)
+{
+int x = get_global_id(0);
+uint4 sum = 0;
+for (int i = 0; i < height; i++) {
+ii[i * width + x] += sum;
+sum = ii[i * width + x];
+}
+}
+
+kernel void weight_accum(global float *sum, global float *weight,
+ global uint4 *ii, __read_only image2d_t 

Re: [FFmpeg-devel] [PATCH] This patch addresses Trac ticket #5570. The optimized functions are in file libswscale/ppc/input_vsx.c. Each optimized function name is a concatenation of the corresponding

2019-04-01 Thread Lauri Kasanen
On Mon, 1 Apr 2019 09:07:48 +0300
slava  wrote:

> Sorry for title. It is my first experience in git send-email. Can I make
> a benchmark with handwritten tests or have some standard tool in ffmeg?
> And will the benchmark on x86-64 be informative?

We have standard bench macros, START_TIMER and STOP_TIMER. Put those
around the function's callsite, then do some ffmpeg run that calls that
specific function. Then add "-cpuflags 0" to the call to get the C
results, and from the numbers you can calculate the speedup.

Both the C and VSX runs should be done on the POWER machine. A Qemu VM,
emulating POWER instructions on x86-64, would probably be useless for
benchmark purposes. There are free POWER VMs available for testing from
a few places.

- Lauri
___
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] [fixme] avformat/hlsenc.c miss pat info

2019-04-01 Thread myp...@gmail.com
On Mon, Apr 1, 2019 at 12:02 PM lmzeng(曾令明)  wrote:
>
> When I try use ffmpeg 4.1 concat some mp3 files like this:
>
> >>ffconcat version 1.0
> >>
> >>file
http://1251953721.vod2.myqcloud.com/0ec02e46vodcq1251953721/8e15b6325285890787361152529/f0.mp3
> >>file
http://1251953721.vod2.myqcloud.com/0ec02e46vodcq1251953721/ee02b7825285890787362994665/f0.mp3
> >>file
http://1251953721.vod2.myqcloud.com/0ec02e46vodcq1251953721/726920765285890787364016855/f0.mp3
>
> >>ffmpeg -safe 0 -protocol_whitelist "file,tcp,http,hls" -i mp3.txt -vn
-map 0:a? -acodec copy -hls_list_size 0 -hls_ts_options mpegts_copyts=1
 -hls_time 10 -hls_flags single_file -f hls 26374_2256155.f3.m3u8
>
> VlC player can’t seek, here miss add PAT at per segment(except the
first segment)?
>
> hlsenc.c:2281
> >>>if (use_temp_file) {
> >>>if (!(hls->flags & HLS_SINGLE_FILE) || (hls->max_seg_size <= 0))
> >>>if ((vs->avf->oformat->priv_class && vs->avf->priv_data) &&
hls->segment_type != SEGMENT_TYPE_FMP4)
> >>>av_opt_set(vs->avf->priv_data, "mpegts_flags",
"resend_headers", 0);
> >>>}

I think you need to create a bug in trac if it's a issue, more information
you can refer to https://trac.ffmpeg.org/ticket/7820, tks
___
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] This patch addresses Trac ticket #5570. The optimized functions are in file libswscale/ppc/input_vsx.c. Each optimized function name is a concatenation of the corresponding

2019-04-01 Thread slava
Sorry for title. It is my first experience in git send-email. Can I make 
a benchmark with handwritten tests or have some standard tool in ffmeg? 
And will the benchmark on x86-64 be informative?



On 03/29/2019 06:02 PM, Lauri Kasanen wrote:

On Fri, 29 Mar 2019 17:00:38 +0300
Вячеслав  wrote:


---
  libswscale/ppc/Makefile   |3 +-
  libswscale/ppc/input_vsx.c| 3801 +
  libswscale/swscale.c  |3 +
  libswscale/swscale_internal.h |1 +
  4 files changed, 3807 insertions(+), 1 deletion(-)
  create mode 100644 libswscale/ppc/input_vsx.c

Please include performance benchmarks for each function. The
description should go in the patch main part, not in the title.

- Lauri
___
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".