[FFmpeg-devel] [PATCH] smacker: read escape codes in single get_bits() call

Michael Niedermayer michaelni at gmx.at
Sun Sep 30 20:07:39 CEST 2012


On Sun, Sep 30, 2012 at 05:31:23PM +0000, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavcodec/smacker.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
> index 4913625..e02c76c 100644
> --- a/libavcodec/smacker.c
> +++ b/libavcodec/smacker.c
> @@ -231,12 +231,9 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int
>          av_log(smk->avctx, AV_LOG_ERROR, "Skipping high bytes tree\n");
>      }
>  
> -    escapes[0]  = get_bits(gb, 8);
> -    escapes[0] |= get_bits(gb, 8) << 8;
> -    escapes[1]  = get_bits(gb, 8);
> -    escapes[1] |= get_bits(gb, 8) << 8;
> -    escapes[2]  = get_bits(gb, 8);
> -    escapes[2] |= get_bits(gb, 8) << 8;
> +    escapes[0]  = get_bits(gb, 16);
> +    escapes[1]  = get_bits(gb, 16);
> +    escapes[2]  = get_bits(gb, 16);

LGTM

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

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120930/67b773f8/attachment.asc>


More information about the ffmpeg-devel mailing list