[FFmpeg-devel] [PATCH] H.264/AVCHD interlaced fixes

Michael Niedermayer michaelni
Thu Feb 19 23:22:50 CET 2009


On Thu, Feb 19, 2009 at 11:10:07PM +0100, Ivan Schreter wrote:
> Michael Niedermayer wrote:
>> On Thu, Feb 19, 2009 at 05:43:14PM +0100, Ivan Schreter wrote:
>>   [...]
>>
>>   
>>> -/**
>>> - * identifies the exact end of the bitstream
>>> - * @return the length of the trailing, or 0 if damaged
>>> - */
>>> -static int decode_rbsp_trailing(H264Context *h, const uint8_t *src){
>>> -    int v= *src;
>>> -    int r;
>>> -
>>> -    tprintf(h->s.avctx, "rbsp trailing %X\n", v);
>>> -
>>> -    for(r=1; r<9; r++){
>>> -        if(v&1) return r;
>>> -        v>>=1;
>>>     
>>
>> moving code must be in a seperate patch, or actually cosmetics and 
>> functional
>> changes should be in seperate patches.
>>
>>   
> I've split it to two patches. OK now?
>
> Regards,
>
> Ivan
>

> Index: libavcodec/h264.c
> ===================================================================
> --- libavcodec/h264.c	(revision 17452)
> +++ libavcodec/h264.c	(working copy)
> @@ -1360,6 +1360,23 @@
>  }
>  
>  /**
> + * identifies the exact end of the bitstream
> + * @return the length of the trailing, or 0 if damaged
> + */
> +static int decode_rbsp_trailing(H264Context *h, const uint8_t *src){
> +    int v= *src;
> +    int r;
> +
> +    tprintf(h->s.avctx, "rbsp trailing %X\n", v);
> +
> +    for(r=1; r<9; r++){
> +        if(v&1) return r;
> +        v>>=1;
> +    }
> +    return 0;
> +}
> +
> +/**
>   * Decodes a network abstraction layer unit.
>   * @param consumed is the number of bytes used as input
>   * @param length is the length of the array
> @@ -1457,23 +1474,6 @@
>  }
>  
>  /**
> - * identifies the exact end of the bitstream
> - * @return the length of the trailing, or 0 if damaged
> - */
> -static int decode_rbsp_trailing(H264Context *h, const uint8_t *src){
> -    int v= *src;
> -    int r;
> -
> -    tprintf(h->s.avctx, "rbsp trailing %X\n", v);
> -
> -    for(r=1; r<9; r++){
> -        if(v&1) return r;
> -        v>>=1;
> -    }
> -    return 0;
> -}
> -
> -/**
>   * IDCT transforms the 16 dc values and dequantizes them.
>   * @param qp quantization parameter
>   */

ok

second patch is not ok, same issue you change decode_nal() behavior
you cant do that, it will not work, we need to decode just the header
with decode_nal later it will not have a rbsp trailing byte at the end
because where we stop is not the end, we cannot decode the whole slice.

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

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090219/f3745523/attachment.pgp>



More information about the ffmpeg-devel mailing list