[FFmpeg-devel] [PATCH] lavc,lavf: add libdavs2 decoder

hwren hwrenx at 126.com
Mon May 28 14:06:02 EEST 2018

Thanks for your patience, we've amended some of our patches add resent them.

At 2018-05-26 22:28:27, "Mark Thompson" <sw at jkqxz.net> wrote:
>On 26/05/18 05:41, hwren wrote:
>> Add Chinese AVS2 video decoder, FFmpeg can make use of the libdavs2 library for AVS2 decoding.
>> Signed-off-by: hwren <hwrenx at 126.com>
>> ---
>> [...] 
>> +static int DumpFrames(AVCodecContext *avctx, davs2_picture_t *pic, davs2_seq_info_t *headerset, AVFrame *frm) 
>> +{ 
>> + DAVS2Context *cad = avctx->priv_data; 
>> + avctx->flags |= AV_CODEC_FLAG_TRUNCATED; 
>Why this line?

we won't send a complete frame to our decoder, so we need to chage the flag. if not, we may get error info.

>> [...] 
>> + frm->data[i] = frm->buf[i]->data; 
>> + frm->linesize[i] = pic->width[i] * bytes_per_sample; 
>> + memcpy(frm->data[i], pic->planes[i], size_plane); 
>This is the same format as libavcodec wants, so is there any way to keep a reference to it so we can avoid this copy?  

We've tried to make it, while it did not work well. May avoid this copy in the future.

>> [...] 
>> + buf_ptr += len; 
>> + buf_size -= len; 
>Can you explain how the consuming partial packets works? It looks like if this consumes part of a packet and they returns a frame, the rest of the packet will be discarded (because the next call will be given a new packet).

Once we decode a frame, indeed, there are still some data left in the packet. so we just move the pointer and decode the next part (decode until our flag turns or out of buf_size range).


More information about the ffmpeg-devel mailing list