[FFmpeg-devel] [PATCH 2/5] vp56rac: Replace /256 with >>8

Aurelien Jacobs aurel
Tue Jun 15 17:01:05 CEST 2010


On Tue, Jun 15, 2010 at 09:02:15AM -0400, David Conrad wrote:
> ---
>  libavcodec/vp56.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/libavcodec/vp56.h b/libavcodec/vp56.h
> index 3d98b9e..edbdcdd 100644
> --- a/libavcodec/vp56.h
> +++ b/libavcodec/vp56.h
> @@ -192,7 +192,7 @@ static inline void vp56_init_range_decoder(VP56RangeCoder *c,
>  
>  static inline int vp56_rac_get_prob(VP56RangeCoder *c, uint8_t prob)
>  {
> -    unsigned int low = 1 + (((c->high - 1) * prob) / 256);
> +    unsigned int low = 1 + (((c->high - 1) * prob) >> 8);
>      unsigned int low_shift = low << 8;
>      int bit = c->code_word >= low_shift;

OK.

Aurel



More information about the ffmpeg-devel mailing list