Commit 99c5ac20 authored by Wan-Teh Chang's avatar Wan-Teh Chang Committed by Michael Niedermayer

avcodec/h264: Declare the local variable decode_chroma as const.

ff_h264_decode_mb_cabac() and ff_h264_decode_mb_cavlc() are very long
functions. Declaring decode_chroma as const makes it clear the variable
doesn't change after initialization.
Signed-off-by: 's avatarWan-Teh Chang <wtc@google.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent b77e26b2
...@@ -1916,8 +1916,8 @@ int ff_h264_decode_mb_cabac(const H264Context *h, H264SliceContext *sl) ...@@ -1916,8 +1916,8 @@ int ff_h264_decode_mb_cabac(const H264Context *h, H264SliceContext *sl)
const SPS *sps = h->ps.sps; const SPS *sps = h->ps.sps;
int mb_xy; int mb_xy;
int mb_type, partition_count, cbp = 0; int mb_type, partition_count, cbp = 0;
int dct8x8_allowed= h->ps.pps->transform_8x8_mode; int dct8x8_allowed = h->ps.pps->transform_8x8_mode;
int decode_chroma = sps->chroma_format_idc == 1 || sps->chroma_format_idc == 2; const int decode_chroma = sps->chroma_format_idc == 1 || sps->chroma_format_idc == 2;
const int pixel_shift = h->pixel_shift; const int pixel_shift = h->pixel_shift;
mb_xy = sl->mb_xy = sl->mb_x + sl->mb_y*h->mb_stride; mb_xy = sl->mb_xy = sl->mb_x + sl->mb_y*h->mb_stride;
......
...@@ -704,8 +704,8 @@ int ff_h264_decode_mb_cavlc(const H264Context *h, H264SliceContext *sl) ...@@ -704,8 +704,8 @@ int ff_h264_decode_mb_cavlc(const H264Context *h, H264SliceContext *sl)
int mb_xy; int mb_xy;
int partition_count; int partition_count;
unsigned int mb_type, cbp; unsigned int mb_type, cbp;
int dct8x8_allowed= h->ps.pps->transform_8x8_mode; int dct8x8_allowed = h->ps.pps->transform_8x8_mode;
int decode_chroma = h->ps.sps->chroma_format_idc == 1 || h->ps.sps->chroma_format_idc == 2; const int decode_chroma = h->ps.sps->chroma_format_idc == 1 || h->ps.sps->chroma_format_idc == 2;
const int pixel_shift = h->pixel_shift; const int pixel_shift = h->pixel_shift;
mb_xy = sl->mb_xy = sl->mb_x + sl->mb_y*h->mb_stride; mb_xy = sl->mb_xy = sl->mb_x + sl->mb_y*h->mb_stride;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment