Re: [FFmpeg-devel] [PATCH v2 3/3] lavc/libdavs2: correct frame type setting

2018-10-31 Thread Huiwen Ren









At 2018-11-01 08:40:50, "Carl Eugen Hoyos"  wrote:
>2018-10-31 23:15 GMT+01:00, Mark Thompson :
>> On 31/10/18 10:23, hwren wrote:
>
>>> +switch (pic->type) {
>>> +case DAVS2_PIC_I:
>>> +frame->pict_type = AV_PICTURE_TYPE_I;
>>> +break;
>>> +case DAVS2_PIC_P:
>>> +frame->pict_type = AV_PICTURE_TYPE_P;
>>> +break;
>>> +case DAVS2_PIC_B:
>>> +case DAVS2_PIC_F:
>>> +frame->pict_type = AV_PICTURE_TYPE_B;
>>> +break;
>>> +default:
>>> +frame->pict_type = AV_PICTURE_TYPE_NONE;
>>
>> Are there any types which aren't already handled?  If there aren't
>> then this would probably be better as an assert.
>
>Since this is an external library, an assert would be wrong.
>
>I wanted to suggest an error message or a negative return value.

Actually, there are six types of frames defined by AVS2 standard: 

DAVS2_PIC_I , DAVS2_PIC_P, DAVS2_PIC_B
DAVS2_PIC_G, DAVS2_PIC_F ,DAVS2_PIC_S
(the DAVS2_PIC_S is not exactly the same thing as AV_PICTURE_TYPE_S)

While in this patch I may make a wrong classification. Every frame in davs2 has 
its same/similar type in ffmpeg.
So maybe it's better to set the  unhandled-type to an error assert.

Thanks :-)

>
>Carl Eugen
>___
>ffmpeg-devel mailing list
>ffmpeg-devel@ffmpeg.org
>http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v7 1/2] lavc, doc, configure: add libxavs2 video encoder wrapper

2018-09-09 Thread Huiwen Ren
planes[k][j * 
>> i_stride];
>> +int i;
>> +uint8_t *p_buffer = frame->data[k] + frame->linesize[k] * j;
>> +memset(p_plane, 0, i_stride);
>> +for (i = 0; i < pic->img.i_width[k]; i++) {
>> +p_plane[i] = p_buffer[i] << shift_in;
>> +}
>> +}
>> +}
>> +}
>> +
>> +static void xavs2_copy_frame(xavs2_picture_t *pic, AVFrame *frame)
>
>Also here.

Fixed, thanks.

>
>> +{
>> +int j, k;
>> +for (k = 0; k < 3; k++) {
>> +for (j = 0; j < pic->img.i_lines[k]; j++) {
>> +memcpy( pic->img.img_planes[k] + pic->img.i_stride[k] * j,
>> +frame->data[k]+frame->linesize[k] * j,
>> +pic->img.i_width[k] * pic->img.in_sample_size);
>> +}
>> +}
>> +}
>> +
>> ...
>> +
>> +static const AVOption options[] = {
>> +{ "lcu_row_threads" ,   "number of parallel threads for rows" , 
>> OFFSET(lcu_row_threads) , AV_OPT_TYPE_INT, {.i64 =  5 },  0, INT_MAX,  VE },
>
>Did you explain what the reason for the default of five was?  If you did I 
>might have missed it.  (In particular, I'm wondering what happens if you run 
>it on a processor with fewer than five real threads.)

Should be 0(auto) and fixed, thanks.

>
>> +{ "initial_qp"  ,   "Quantization parameter"  , 
>> OFFSET(initial_qp)  , AV_OPT_TYPE_INT, {.i64 = 34 },  1,  63,  VE },
>> +{ "max_qp"  ,   "max qp for rate control" , 
>> OFFSET(max_qp)  , AV_OPT_TYPE_INT, {.i64 = 55 },  0,  63,  VE },
>> +{ "min_qp"  ,   "min qp for rate control" , 
>> OFFSET(min_qp)  , AV_OPT_TYPE_INT, {.i64 = 20 },  0,  63,  VE },
>> +{ "speed_level" ,   "Speed level, higher is better but slower", 
>> OFFSET(preset_level), AV_OPT_TYPE_INT, {.i64 =  0 },  0,   9,  VE },
>> +{ "hierarchical_ref",   "hierarchical reference" ,  
>> OFFSET(hierarchical_reference), AV_OPT_TYPE_BOOL,{.i64 =  1 }, 0, 1, 
>>  VE },
>> +{ "xavs2-params",   "set the xavs2 configuration using a 
>> :-separated list of key=value parameters", OFFSET(xavs2_opts), 
>> AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
>> +{ NULL },
>> +};
>> +
...

Also added log_level and qp, and moved min_qp/max_qp/initial_qp to the case 
with no bit_rate. Hope this version looks better :)

Cheers,
Huiwen Ren

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v6 1/2] lavc, doc, configure: add libxavs2 video encoder wrapper

2018-09-06 Thread Huiwen Ren









At 2018-09-06 08:43:05, "Mark Thompson"  wrote:
>On 05/09/18 14:38, hwren wrote:
>> Signed-off-by: hwren 
[...]
>> +if (cae->xavs2_opts) {
>> +AVDictionary *dict= NULL;
>> +AVDictionaryEntry *en = NULL;
>> +
>> +if (!av_dict_parse_string(&dict, cae->xavs2_opts, "=", ":", 0)) {
>> +while ((en = av_dict_get(dict, "", en, AV_DICT_IGNORE_SUFFIX))) 
>> {
>> +xavs2_opt_set2(en->key, "%s", en->value);
>
>Should you check the result of this one?  The user might pass soemthing 
>completely invalid, which probably wants a warning at least.

Added into the macro function :)

[...]
>> +{ "i_initial_qp",   "Quantization parameter" ,  
>> OFFSET(i_initial_qp), AV_OPT_TYPE_INT, {.i64 = 34 }, 1,  63,  VE },
>
>If I understand what you said previously correctly, this is only used in 
>constant-QP mode, and there it is used as the QP for every frame (not just the 
>initial one)?
>
>If that's the case then it should probably not say "initial" - I would read 
>"initial_qp" as meaning the QP used for the first frame only, so probably in 
>modes with a bitrate target.  Maybe change it to just be "qp"?  That name is 
>used by several other encoders, including libx264 and libxavs.

If "RateControl" is opened, the "initial_qp" will be used for the first frame 
and kept for all the other frames (constant-QP) and if there is no rate 
control, the initial_qp will only work for the first frame (xavs2 will always 
initial the qp for the first frame). So...maybe better with "initial"?

Thanks,
Huiwen Ren
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v4 1/2] lavc, doc, configure: add libxavs2 video encoder wrapper

2018-09-05 Thread Huiwen Ren









At 2018-09-05 19:52:23, "Mark Thompson"  wrote:
>On 05/09/18 08:19, Huiwen Ren wrote:
>> At 2018-09-05 08:46:18, "Mark Thompson"  wrote:
>>> On 03/09/18 03:42, hwren wrote:
>>>> Signed-off-by: hwren 
>>>> ---
>> [...]
>>>> +
>>>> +int i_lcurow_threads;
>>>> +int i_initial_qp;
>>>> +int preset_level;
>>>> +int intra_period;
>>>
>>> There is a common option AVCodecContext.gop_size (-g) which should probably 
>>> be used rather than inventing a new private option with the same meaning.
>> 
>> intra_period in xavs2 seems not equals to gop_size in ffmpeg, intra period 
>> here is calculated by (actul_intra_period/gop_size).
>
>I'm not entirely sure what you mean here.  Let me try to explain what I think 
>this doing, please correct me if I'm getting anything wrong.
>
>The intra frames sent in a stream are arranged something like (xxx 
>representing any sequence of non-intra frames):
>
>IDR xxx  I  xxx  I  xxx  I  ...  I  xxx IDR
>
> | <-A-> | <-A-> | <-A-> |  ...  | <-A-> |
> ^   ^ B instances of A ...  ^
> | < C > |
>
>Both I and IDR frames are recovery points.
>
>Then, with your naming:
>
>A = GOP size
>B = Intra period
>C = what you've called "actul intra period" above and in the docs
>
>and A * B = C
>
>Only being able to set B, though, seems insufficient to control this?  Any one 
>variable is determined by the other two, but you need at least two of them.
>

You are right. Sorry, I may mistakenly assume the meaning of  gop_size. It 
should be the "A" above and I've replaced intra_period with AVContext->gop_size.

>
>Aside: the libmfx code calls the B variable "IDR interval", which I think is 
>slightly clearer (see 
><http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/qsvenc_h264.c;h=06fa0ebf065b2426b9f77aeaef3a20f41466ee1c;hb=HEAD#l109>).
>
>>>> +if (avctx->bit_rate > 0) {
>>>> +cae->api->opt_set2(cae->param, "RateControl",  "1");
>>>> +av_strlcatf(str_TBR, sizeof(str_TBR), "%d", avctx->bit_rate);
>>>> +cae->api->opt_set2(cae->param, "TargetBitRate", str_TBR);
>>>> +}
>>>
>>> What happens if there is no bitrate target?  Some sort of constant-quality 
>>> mode?  Are there any parameters for that?
>> 
>> Rate control in xavs2 will only work if given bit_rate and the speed(preset) 
>> level is used to control quality.
>
>Please do correct me if this is wrong, but I thought the speed/preset value 
>was the encoding-time against quality tradeoff?  When bitrate is not set I 
>would expect there to be a parameter for the size against quality tradeoff as 
>well (e.g. a fixed QP value that will be used for every frame - in 
>AVCodecContext this generally maps to global_quality, though not all encoders 
>use it).

Sorry again. It should be the i_initial_qp which could control the initial qp 
for first frame,  instead of speed_level.

Thanks for correction,
Huiwen Ren
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v4 1/2] lavc, doc, configure: add libxavs2 video encoder wrapper

2018-09-05 Thread Huiwen Ren









At 2018-09-05 08:46:18, "Mark Thompson"  wrote:
>On 03/09/18 03:42, hwren wrote:
>> Signed-off-by: hwren 
>> ---
[...]
>> +
>> +int i_lcurow_threads;
>> +int i_initial_qp;
>> +int preset_level;
>> +int intra_period;
>
>There is a common option AVCodecContext.gop_size (-g) which should probably be 
>used rather than inventing a new private option with the same meaning.

intra_period in xavs2 seems not equals to gop_size in ffmpeg, intra period here 
is calculated by (actul_intra_period/gop_size).

[...]

>> +if (avctx->bit_rate > 0) {
>> +cae->api->opt_set2(cae->param, "RateControl",  "1");
>> +av_strlcatf(str_TBR, sizeof(str_TBR), "%d", avctx->bit_rate);
>> +cae->api->opt_set2(cae->param, "TargetBitRate", str_TBR);
>> +}
>
>What happens if there is no bitrate target?  Some sort of constant-quality 
>mode?  Are there any parameters for that?

Rate control in xavs2 will only work if given bit_rate and the speed(preset) 
level is used to control quality.

[...]
>> +} else {
>> +cae->api->encoder_encode(cae->encoder, NULL, &cae->packet);
>> +}
>> +
>> +if ((cae->packet.len) && (cae->packet.state != XAVS2_STATE_FLUSH_END)){
>
>Is there any particular reason why the packet is in the context structure but 
>the picture is on the stack?  They look like they should have effectively 
>equivalent lifetime and therefore be treated in the same way.
>

The xavs2 picture is under control of xavs2 encoder while the packet should be 
handle in the wrapper.

>> +
>> +if (av_new_packet(pkt, cae->packet.len) < 0){
>> +av_log(avctx, AV_LOG_ERROR, "packet alloc failed\n");
>> +return AVERROR(EINVAL);
>
>ENOMEM.  You probably need to unref the xavs2 packet as well if this happens?
>

Will unref  by the encoder.

[...]
>> +} ;
>
>Thanks,
>
>- Mark

Thanks for  patience and advice,

Huiwen Ren

>___
>ffmpeg-devel mailing list
>ffmpeg-devel@ffmpeg.org
>http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavc/extract_extradata_bsf.c: add AVS2

2018-08-21 Thread Huiwen Ren
ping




On 08/06/2018 21:42, hwren wrote:
Signed-off-by: hwren 
---
libavcodec/extract_extradata_bsf.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/libavcodec/extract_extradata_bsf.c 
b/libavcodec/extract_extradata_bsf.c
index 6deb663..f37427c 100644
--- a/libavcodec/extract_extradata_bsf.c
+++ b/libavcodec/extract_extradata_bsf.c
@@ -331,6 +331,7 @@ static const struct {
   uint8_t **data, int *size);
} extract_tab[] = {
{ AV_CODEC_ID_AV1,extract_extradata_av1 },
+{ AV_CODEC_ID_AVS2,   extract_extradata_mpeg4   },
{ AV_CODEC_ID_CAVS,   extract_extradata_mpeg4   },
{ AV_CODEC_ID_H264,   extract_extradata_h2645   },
{ AV_CODEC_ID_HEVC,   extract_extradata_h2645   },
@@ -397,6 +398,7 @@ static void extract_extradata_close(AVBSFContext *ctx)

static const enum AVCodecID codec_ids[] = {
AV_CODEC_ID_AV1,
+AV_CODEC_ID_AVS2,
AV_CODEC_ID_CAVS,
AV_CODEC_ID_H264,
AV_CODEC_ID_HEVC,
--
2.7.4
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v2] lavf: add raw AVS2 demuxer

2018-08-21 Thread Huiwen Ren
ping




On 08/03/2018 19:25, hwren wrote:
Signed-off-by: hwren 
---
libavformat/Makefile |  1 +
libavformat/allformats.c |  1 +
libavformat/davs2.c  | 71 
3 files changed, 73 insertions(+)
create mode 100644 libavformat/davs2.c

diff --git a/libavformat/Makefile b/libavformat/Makefile
index f2f3aab..c4534b8 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -110,6 +110,7 @@ OBJS-$(CONFIG_AST_DEMUXER)   += ast.o astdec.o
OBJS-$(CONFIG_AST_MUXER) += ast.o astenc.o
OBJS-$(CONFIG_AU_DEMUXER)+= au.o pcm.o
OBJS-$(CONFIG_AU_MUXER)  += au.o rawenc.o
+OBJS-$(CONFIG_AVS2_DEMUXER)  += davs2.o rawdec.o
OBJS-$(CONFIG_AVI_DEMUXER)   += avidec.o
OBJS-$(CONFIG_AVI_MUXER) += avienc.o mpegtsenc.o avlanguage.o 
rawutils.o
OBJS-$(CONFIG_AVM2_MUXER)+= swfenc.o swf.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index adcc8d9..38eaeea 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -76,6 +76,7 @@ extern AVInputFormat  ff_avisynth_demuxer;
extern AVOutputFormat ff_avm2_muxer;
extern AVInputFormat  ff_avr_demuxer;
extern AVInputFormat  ff_avs_demuxer;
+extern AVInputFormat  ff_avs2_demuxer;
extern AVInputFormat  ff_bethsoftvid_demuxer;
extern AVInputFormat  ff_bfi_demuxer;
extern AVInputFormat  ff_bintext_demuxer;
diff --git a/libavformat/davs2.c b/libavformat/davs2.c
new file mode 100644
index 000..73daa69
--- /dev/null
+++ b/libavformat/davs2.c
@@ -0,0 +1,71 @@
+/*
+ * AVS2 video stream probe.
+ *
+ * Copyright (C) 2018 Huiwen Ren, 
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avformat.h"
+#include "rawdec.h"
+#include "libavcodec/internal.h"
+#include "libavutil/intreadwrite.h"
+
+#define ISSQH(x)  ((x) == 0xB0 )
+#define ISEND(x)  ((x) == 0xB1 )
+#define ISPIC(x)  ((x) == 0xB3 || (x) == 0xB6)
+#define ISUNIT(x) ( ISSQH(x) || ISEND(x) || (x) == 0xB2 || ISPIC(x) || (x) == 
0xB5 || (x) == 0xB7 )
+#define ISAVS2(x) ((x) == 0x20 || (x) == 0x22 || (x) == 0x30 || (x) == 0x32 )
+
+static int avs2_probe(AVProbeData *p)
+{
+if (AV_RB32(p->buf) != 0x1B0){
+return 0;
+}
+uint32_t code= -1, hds=0, pic=0, seq=0;
+uint8_t state=0;
+const uint8_t *ptr = p->buf, *end = p->buf + p->buf_size, *sqb=0;
+
+while (ptr < end) {
+ptr = avpriv_find_start_code(ptr, end, &code);
+state = code & 0xFF;
+if ((code & 0xff00) == 0x100) {
+if (ISUNIT(state)) {
+if (sqb && !hds) {
+hds = ptr - sqb;
+}
+if (ISSQH(state)) {
+if (!ISAVS2(*ptr))
+return 0;
+sqb = ptr;
+seq++;
+} else if (ISPIC(state)) {
+pic++;
+} else if (ISEND(state)) {
+break;
+}
+}
+}
+}
+if (seq && hds >= 21 && pic){
+return AVPROBE_SCORE_EXTENSION + 2; // more than cavs
+}
+
+return 0;
+}
+
+FF_DEF_RAWVIDEO_DEMUXER(avs2, "raw AVS2-P2/IEEE1857.4", avs2_probe, 
"avs,avs2", AV_CODEC_ID_AVS2)
--
2.7.4
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v3] avs2: Correct expression error and simplify log

2018-08-07 Thread Huiwen Ren







在 2018-08-08 06:59:52,"Michael Niedermayer"  写道:
>On Tue, Aug 07, 2018 at 05:37:30PM +0800, hwren wrote:
>> Signed-off-by: hwren 
>> ---
>>  doc/decoders.texi| 2 +-
>>  doc/general.texi | 2 +-
>>  libavcodec/avs2_parser.c | 2 +-
>>  libavcodec/codec_desc.c  | 2 +-
>>  libavcodec/libdavs2.c| 5 ++---
>>  5 files changed, 6 insertions(+), 7 deletions(-)
>>
>> diff --git a/doc/decoders.texi b/doc/decoders.texi
>> index 9439b7b..31e96fb 100644
>> --- a/doc/decoders.texi
>> +++ b/doc/decoders.texi
>> @@ -49,7 +49,7 @@ top-field-first is assumed
>>  
>>  @section libdavs2
>>  
>> -AVS2/IEEE 1857.4 video decoder wrapper.
>> +AVS2-P2/IEEE1857.4 video decoder wrapper.
>>  
>>  This decoder allows libavcodec to decode AVS2 streams with davs2 library.
>>  
>> diff --git a/doc/general.texi b/doc/general.texi
>> index cd725bb..3d15840 100644
>> --- a/doc/general.texi
>> +++ b/doc/general.texi
>> @@ -19,7 +19,7 @@ explicitly requested by passing the appropriate flags to
>>  
>>  @section libdavs2
>>  
>> -FFmpeg can make use of the davs2 library for AVS2/IEEE 1857.4 video 
>> decoding.
>> +FFmpeg can make use of the davs2 library for AVS2-P2/IEEE1857.4 video 
>> decoding.
>>  
>>  Go to @url{https://github.com/pkuvcl/davs2} and follow the instructions for
>>  installing the library. Then pass @code{--enable-libdavs2} to configure to
>> diff --git a/libavcodec/avs2_parser.c b/libavcodec/avs2_parser.c
>> index 520e98a..1c9b342 100644
>> --- a/libavcodec/avs2_parser.c
>> +++ b/libavcodec/avs2_parser.c
>> @@ -1,5 +1,5 @@
>>  /*
>> - * AVS2/IEEE 1857.4 video parser.
>> + * AVS2-P2/IEEE1857.4 video parser.
>>   * Copyright (c) 2018  Huiwen Ren 
>>   *
>>   * This file is part of FFmpeg.
>> diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
>> index 2fe4aaa..1cbb241 100644
>> --- a/libavcodec/codec_desc.c
>> +++ b/libavcodec/codec_desc.c
>> @@ -1398,7 +1398,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
>>  .id= AV_CODEC_ID_AVS2,
>>  .type  = AVMEDIA_TYPE_VIDEO,
>>  .name  = "avs2",
>> -.long_name = NULL_IF_CONFIG_SMALL("AVS2/IEEE 1857.4"),
>> +.long_name = NULL_IF_CONFIG_SMALL("AVS2-P2/IEEE1857.4"),
>>  .props = AV_CODEC_PROP_LOSSY,
>>  },
>>  {
>> diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
>> index 12db1f9..9cc86a2 100644
>> --- a/libavcodec/libdavs2.c
>> +++ b/libavcodec/libdavs2.c
>
>> @@ -51,7 +51,7 @@ static av_cold int davs2_init(AVCodecContext *avctx)
>>  
>>  /* init the decoder */
>>  cad->param.threads  = avctx->thread_count;
>> -cad->param.info_level   = 0;
>> +cad->param.info_level   = DAVS2_LOG_WARNING;
>>  cad->decoder= davs2_decoder_open(&cad->param);
>>  
>>  if (!cad->decoder) {
>
>> @@ -59,7 +59,6 @@ static av_cold int davs2_init(AVCodecContext *avctx)
>>  return AVERROR(EINVAL);
>>  }
>>  
>> -av_log(avctx, AV_LOG_VERBOSE, "decoder created. %p\n", cad->decoder);
>>  return 0;
>>  }
>
>these things look unrelated to the other changes, they should be in
>seperate patches
>
>thx

Seperated and committed in another patch.

>
>[...]
>
>--
>Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
>What does censorship reveal? It reveals fear. -- Julian Assange
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avs2: Correct expression error and simplify log

2018-08-06 Thread Huiwen Ren

在 2018-08-07 02:09:34,"James Almer"  写道:
>On 8/6/2018 11:21 AM, Gyan Doshi wrote:
>> 
>> 
>> On 06-08-2018 07:13 PM, hwren wrote:
>> 
>>> -    .long_name  = NULL_IF_CONFIG_SMALL("Decoder for AVS2/IEEE
>>> 1857.4"),
>>> +    .long_name  = NULL_IF_CONFIG_SMALL("Decoder for
>>> AVS2-P2/IEEE1857.4"),
>> 
>> "Decoder for" is not needed. The flag indicates its role in `ffmpeg
>> -codecs`.
>
>The correct string considering this is a decoder using an external
>library would be something like "libdavs2 AVS2-P2/IEEE1857.4"

"AVS2-P2/IEEE1857.4 external decoder wrapper"?

>
>> 
>> Rest docs LGTM
>> 
>> 
>> Thanks,
>> Gyan
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>___
>ffmpeg-devel mailing list
>ffmpeg-devel@ffmpeg.org
>http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] fate: add decoder test for avs2

2018-07-31 Thread Huiwen Ren
The avs2 sample used in this patch could be temporary found in

https://gitee.com/hwren/avs2_samples/blob/master/ES/BasketballPass_416x240_50_ai/test.avs2

please download test.avs2 and put it as fate-suite/avs2/test.avs2









At 2018-07-31 20:17:12, "hwren"  wrote:
>Signed-off-by: hwren 
>---
> tests/Makefile|  1 +
> tests/fate/avs2.mak   |  9 +
> tests/ref/fate/avs2-davs2 | 98 +++
> 3 files changed, 108 insertions(+)
> create mode 100644 tests/fate/avs2.mak
> create mode 100644 tests/ref/fate/avs2-davs2
>
>diff --git a/tests/Makefile b/tests/Makefile
>index 24680b8..5ded6a4 100644
>--- a/tests/Makefile
>+++ b/tests/Makefile
>@@ -102,6 +102,7 @@ include $(SRC_PATH)/tests/fate/api.mak
> include $(SRC_PATH)/tests/fate/apng.mak
> include $(SRC_PATH)/tests/fate/atrac.mak
> include $(SRC_PATH)/tests/fate/audio.mak
>+include $(SRC_PATH)/tests/fate/avs2.mak
> include $(SRC_PATH)/tests/fate/bmp.mak
> include $(SRC_PATH)/tests/fate/build.mak
> include $(SRC_PATH)/tests/fate/canopus.mak
>diff --git a/tests/fate/avs2.mak b/tests/fate/avs2.mak
>new file mode 100644
>index 000..dd08e4a
>--- /dev/null
>+++ b/tests/fate/avs2.mak
>@@ -0,0 +1,9 @@
>+FATE_LIBDAVS2 = davs2
>+
>+FATE_LIBDAVS2  := $(FATE_LIBDAVS2:%=fate-avs2-%)
>+
>+FATE_SAMPLES_AVCONV += $(FATE_LIBDAVS2)
>+FATE_SAMPLES_FFPROBE += $(FATE_LIBDAVS2_FFPROBE-yes)
>+fate-libdavs2: $(FATE_LIBDAVS2) $(FATE_LIBDAVS2_FFPROBE-yes)
>+
>+fate-avs2-davs2: CMD = framecrc -vsync drop -vcodec libdavs2 
>-i $(TARGET_SAMPLES)/avs2/test.avs2 -flags +bitexact
>diff --git a/tests/ref/fate/avs2-davs2 b/tests/ref/fate/avs2-davs2
>new file mode 100644
>index 000..45448bf
>--- /dev/null
>+++ b/tests/ref/fate/avs2-davs2
>@@ -0,0 +1,98 @@
>+#tb 0: 1/50
>+#media_type 0: video
>+#codec_id 0: rawvideo
>+#dimensions 0: 416x240
>+#sar 0: 0/1
>+0,  0,  0,1,   149760, 0xe846980b
>+0,  1,  1,1,   149760, 0x8da0b6a5
>+0,  2,  2,1,   149760, 0x4e870abb
>+0,  3,  3,1,   149760, 0x9b6319c7
>+0,  4,  4,1,   149760, 0xf6406852
>+0,  5,  5,1,   149760, 0xf114c48b
>+0,  6,  6,1,   149760, 0xf687e7cc
>+0,  7,  7,1,   149760, 0x7fe42bbd
>+0,  8,  8,1,   149760, 0x6bf62c4e
>+0,  9,  9,1,   149760, 0xd73466dc
>+0, 10, 10,1,   149760, 0x90dca2b4
>+0, 11, 11,1,   149760, 0x8debab8e
>+0, 12, 12,1,   149760, 0x417ca7ad
>+0, 13, 13,1,   149760, 0xf553a64a
>+0, 14, 14,1,   149760, 0x7d22e5b3
>+0, 15, 15,1,   149760, 0x34700a54
>+0, 16, 16,1,   149760, 0xed001612
>+0, 17, 17,1,   149760, 0xfeab6089
>+0, 18, 18,1,   149760, 0x4cb26215
>+0, 19, 19,1,   149760, 0x4edf76c3
>+0, 20, 20,1,   149760, 0xabad8cb7
>+0, 21, 21,1,   149760, 0x7e909e0a
>+0, 22, 22,1,   149760, 0xf401c95e
>+0, 23, 23,1,   149760, 0x116ad718
>+0, 24, 24,1,   149760, 0xe1dae8a3
>+0, 25, 25,1,   149760, 0xf2d218f7
>+0, 26, 26,1,   149760, 0xb71f22e3
>+0, 27, 27,1,   149760, 0xd17d3435
>+0, 28, 28,1,   149760, 0x70de3926
>+0, 29, 29,1,   149760, 0x17b05086
>+0, 30, 30,1,   149760, 0x07526799
>+0, 31, 31,1,   149760, 0x74165cef
>+0, 32, 32,1,   149760, 0x162c7875
>+0, 33, 33,1,   149760, 0xf05c7f17
>+0, 34, 34,1,   149760, 0xaa16880b
>+0, 35, 35,1,   149760, 0xb5bb91ea
>+0, 36, 36,1,   149760, 0xfa42af20
>+0, 37, 37,1,   149760, 0xa044b73b
>+0, 38, 38,1,   149760, 0xc527cdf0
>+0, 39, 39,1,   149760, 0x1aa4c33d
>+0, 40, 40,1,   149760, 0x7a4502ad
>+0, 41, 41,1,   149760, 0xfea42c93
>+0, 42, 42,1,   149760, 0x8f675f4d
>+0, 43, 43,1,   149760, 0xd0a560d8
>+0, 44, 44,1,   149760, 0xa10a5b1e
>+0, 45, 45,1,   149760, 0x9b2f71be
>+0, 46, 46,1,   149760, 0x475b6478
>+0, 47, 47,1,   149760, 0xf0046092
>+0, 48, 48,1,   149760, 0x1e035e28
>+0, 49, 49,1,   149760, 0xc8706662
>+0, 50, 50,1,   149760, 0x666a9752
>+0, 51, 51,1,   149760, 0x55ada842