[FFmpeg-devel] [PATCH] avcodec/clearvideo: add inter-frame decoding

Michael Niedermayer michael at niedermayer.cc
Tue Apr 3 03:39:19 EEST 2018


On Mon, Apr 02, 2018 at 08:18:02PM +0200, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavcodec/clearvideo.c | 2394 ++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 2378 insertions(+), 16 deletions(-)
> 
[...]

> @@ -271,6 +2022,332 @@ static int decode_mb(CLVContext *c, int x, int y)
>      return 0;
>  }
>  
> +static MV pred(MV a, MV b, MV c)
> +{
> +    MV mv;
> +
> +    if (a.x < b.x) {
> +        if (b.x < c.x) {
> +            mv.x = b.x;
> +        } else {
> +            if (a.x < c.x) {
> +                mv.x = c.x;
> +            } else {
> +                mv.x = a.x;
> +            }
> +        }
> +    } else {
> +        if (b.x < c.x) {
> +            if (a.x < c.x) {
> +                mv.x = a.x;
> +            } else {
> +                mv.x = c.x;
> +            }
> +        } else {
> +            mv.x = b.x;
> +        }
> +    }
> +
> +    if (a.y < b.y) {
> +        if (b.y < c.y) {
> +            mv.y = b.y;
> +        } else {
> +            if (a.y < c.y) {
> +                mv.y = c.y;
> +            } else {
> +                mv.y = a.y;
> +            }
> +        }
> +    } else {
> +        if (b.y < c.y) {
> +            if (a.y < c.y) {
> +                mv.y = a.y;
> +            } else {
> +                mv.y = c.y;
> +            }
> +        } else {
> +            mv.y = b.y;
> +        }
> +    }

is this mid_pred() ?


[...]
> @@ -290,7 +2367,13 @@ static int clv_decode_frame(AVCodecContext *avctx, void *data,
>  
>      frame_type = bytestream2_get_byte(&gb);
>  
> -    if (frame_type & 0x2) {

> +    if (frame_type & 0x7f == 0x30) {

missing ()


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

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- 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/20180403/1dc2959e/attachment.sig>


More information about the ffmpeg-devel mailing list