[FFmpeg-devel] [PATCH v8 2/3] avcodec/bitpacked: add interlace support

Michael Niedermayer michael at niedermayer.cc
Wed Jul 11 12:36:05 EEST 2018


On Tue, Jul 10, 2018 at 05:52:00PM -0400, Patrick Keroulas wrote:
> This codec is already capable of depacking some combinations of pixel
> formats and depth as defined in the RFC4175. The only difference between
> progressive and interlace is that either a packet will contain the whole
> frame, or only a field of the frame.
> 
> There is no mechanism for interlaced frames reconstruction at the rtp
> demux level, so it has to be handled by the codec which needs to
> partially recompose an AVFrame with every incoming field AVPacket.
> A frame is ouput only when the frame is completed with the 2nd field
> (bottom).
> 
> The AVAncillary Data carried by AVPacket side data allows the decoder to
> dynamically determine the frame format, i.e. progressive or interlaced.
> 
> Signed-off-by: Patrick Keroulas <patrick.keroulas at savoirfairelinux.com>
> Signed-off-by: Damien Riegel <damien.riegel at savoirfairelinux.com>
> ---
> 
> Changes v7 -> v8: style
> 
> ---
> ---
>  libavcodec/bitpacked.c | 140 +++++++++++++++++++++++++++++++++++++++++--------
>  1 file changed, 117 insertions(+), 23 deletions(-)

Do i understand correctly that this design takes data from the network
copies it then copies it again and then copies the bits again ?

IMHO you should decide if the production of rawvideo should happen in the
decoder or demuxer and then NOT mess with the data in the other lib but just
pass it without copying as far as possible.

if i look at the decoder i see in bitpacked_decode_yuv422p10() some rather
unoptimized looking bit unpack code.
And looking at rtpdec_rfc4175.c i see
"/* and now iterate over every scan lines */" and a memcpy()

With rawvideo its quite likely that you are limited by main memory speed
and 2 passes could make it half speed.
If this is the case and my quick look didnt miss something (please correct
me if i did) then this is possibly something that should be changed

thanks

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

Modern terrorism, a quick summary: Need oil, start war with country that
has oil, kill hundread thousand in war. Let country fall into chaos,
be surprised about raise of fundamantalists. Drop more bombs, kill more
people, be surprised about them taking revenge and drop even more bombs
and strip your own citizens of their rights and freedoms. to be continued
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180711/1d0962ca/attachment.sig>


More information about the ffmpeg-devel mailing list