Commit 7505c8df authored by Anton Khirnov's avatar Anton Khirnov

h264_cavlc: constify all uses of H264Context

All the variables modified by this code are either per-MB arrays or have
been moved to the per-slice context
parent ba7e165b
...@@ -814,7 +814,7 @@ void ff_h264_decode_init_vlc(void); ...@@ -814,7 +814,7 @@ void ff_h264_decode_init_vlc(void);
* Decode a macroblock * Decode a macroblock
* @return 0 if OK, ER_AC_ERROR / ER_DC_ERROR / ER_MV_ERROR on error * @return 0 if OK, ER_AC_ERROR / ER_DC_ERROR / ER_MV_ERROR on error
*/ */
int ff_h264_decode_mb_cavlc(H264Context *h, H264SliceContext *sl); int ff_h264_decode_mb_cavlc(const H264Context *h, H264SliceContext *sl);
/** /**
* Decode a CABAC coded macroblock * Decode a CABAC coded macroblock
......
...@@ -283,7 +283,7 @@ static int8_t cavlc_level_tab[7][1<<LEVEL_TAB_BITS][2]; ...@@ -283,7 +283,7 @@ static int8_t cavlc_level_tab[7][1<<LEVEL_TAB_BITS][2];
* Get the predicted number of non-zero coefficients. * Get the predicted number of non-zero coefficients.
* @param n block index * @param n block index
*/ */
static inline int pred_non_zero_count(H264Context *h, H264SliceContext *sl, int n) static inline int pred_non_zero_count(const H264Context *h, H264SliceContext *sl, int n)
{ {
const int index8= scan8[n]; const int index8= scan8[n];
const int left = sl->non_zero_count_cache[index8 - 1]; const int left = sl->non_zero_count_cache[index8 - 1];
...@@ -442,7 +442,7 @@ static inline int get_level_prefix(GetBitContext *gb){ ...@@ -442,7 +442,7 @@ static inline int get_level_prefix(GetBitContext *gb){
* @param max_coeff number of coefficients in the block * @param max_coeff number of coefficients in the block
* @return <0 if an error occurred * @return <0 if an error occurred
*/ */
static int decode_residual(H264Context *h, H264SliceContext *sl, static int decode_residual(const H264Context *h, H264SliceContext *sl,
GetBitContext *gb, int16_t *block, int n, GetBitContext *gb, int16_t *block, int n,
const uint8_t *scantable, const uint32_t *qmul, const uint8_t *scantable, const uint32_t *qmul,
int max_coeff) int max_coeff)
...@@ -628,7 +628,12 @@ static int decode_residual(H264Context *h, H264SliceContext *sl, ...@@ -628,7 +628,12 @@ static int decode_residual(H264Context *h, H264SliceContext *sl,
return 0; return 0;
} }
static av_always_inline int decode_luma_residual(H264Context *h, H264SliceContext *sl, GetBitContext *gb, const uint8_t *scan, const uint8_t *scan8x8, int pixel_shift, int mb_type, int cbp, int p){ static av_always_inline
int decode_luma_residual(const H264Context *h, H264SliceContext *sl,
GetBitContext *gb, const uint8_t *scan,
const uint8_t *scan8x8, int pixel_shift,
int mb_type, int cbp, int p)
{
int i4x4, i8x8; int i4x4, i8x8;
int qscale = p == 0 ? sl->qscale : sl->chroma_qp[p - 1]; int qscale = p == 0 ? sl->qscale : sl->chroma_qp[p - 1];
if(IS_INTRA16x16(mb_type)){ if(IS_INTRA16x16(mb_type)){
...@@ -694,7 +699,7 @@ static av_always_inline int decode_luma_residual(H264Context *h, H264SliceContex ...@@ -694,7 +699,7 @@ static av_always_inline int decode_luma_residual(H264Context *h, H264SliceContex
} }
} }
int ff_h264_decode_mb_cavlc(H264Context *h, H264SliceContext *sl) int ff_h264_decode_mb_cavlc(const H264Context *h, H264SliceContext *sl)
{ {
int mb_xy; int mb_xy;
int partition_count; int partition_count;
......
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