#define CABAC(h) 1
+#include "libavutil/attributes.h"
+#include "libavutil/timer.h"
#include "config.h"
#include "cabac.h"
#include "cabac_functions.h"
#include "h264data.h"
#include "h264_mvpred.h"
#include "golomb.h"
+#include "mpegutils.h"
#if ARCH_X86
#include "x86/h264_i386.h"
#endif
-//#undef NDEBUG
#include <assert.h>
/* Cabac pre state table */
}
-static void decode_cabac_residual_dc_internal(H264Context *h, int16_t *block,
- int cat, int n,
- const uint8_t *scantable,
- int max_coeff)
+static av_noinline void decode_cabac_residual_dc_internal(H264Context *h,
+ int16_t *block,
+ int cat, int n,
+ const uint8_t *scantable,
+ int max_coeff)
{
decode_cabac_residual_internal(h, block, cat, n, scantable, NULL, max_coeff, 1, 0);
}
-static void decode_cabac_residual_dc_internal_422(H264Context *h, int16_t *block,
- int cat, int n, const uint8_t *scantable,
- int max_coeff)
+static av_noinline void decode_cabac_residual_dc_internal_422(H264Context *h,
+ int16_t *block,
+ int cat, int n,
+ const uint8_t *scantable,
+ int max_coeff)
{
decode_cabac_residual_internal(h, block, cat, n, scantable, NULL, max_coeff, 1, 1);
}
-static void decode_cabac_residual_nondc_internal(H264Context *h, int16_t *block,
- int cat, int n,
- const uint8_t *scantable,
- const uint32_t *qmul,
- int max_coeff)
+static av_noinline void decode_cabac_residual_nondc_internal(H264Context *h,
+ int16_t *block,
+ int cat, int n,
+ const uint8_t *scantable,
+ const uint32_t *qmul,
+ int max_coeff)
{
decode_cabac_residual_internal(h, block, cat, n, scantable, qmul, max_coeff, 0, 0);
}
int max_coeff)
{
/* read coded block flag */
- if( (cat != 5 || CHROMA444) && get_cabac( &h->cabac, &h->cabac_state[get_cabac_cbf_ctx( h, cat, n, max_coeff, 0 ) ] ) == 0 ) {
+ if( (cat != 5 || CHROMA444(h)) && get_cabac( &h->cabac, &h->cabac_state[get_cabac_cbf_ctx( h, cat, n, max_coeff, 0 ) ] ) == 0 ) {
if( max_coeff == 64 ) {
fill_rectangle(&h->non_zero_count_cache[scan8[n]], 2, 2, 8, 0, 1);
} else {
/* It would be better to do this in fill_decode_caches, but we don't know
* the transform mode of the current macroblock there. */
- if (CHROMA444 && IS_8x8DCT(mb_type)){
+ if (CHROMA444(h) && IS_8x8DCT(mb_type)){
int i;
uint8_t *nnz_cache = h->non_zero_count_cache;
for (i = 0; i < 2; i++){
h->last_qscale_diff=0;
decode_cabac_luma_residual(h, scan, scan8x8, pixel_shift, mb_type, cbp, 0);
- if(CHROMA444){
+ if (CHROMA444(h)) {
decode_cabac_luma_residual(h, scan, scan8x8, pixel_shift, mb_type, cbp, 1);
decode_cabac_luma_residual(h, scan, scan8x8, pixel_shift, mb_type, cbp, 2);
- } else if (CHROMA422) {
+ } else if (CHROMA422(h)) {
if( cbp&0x30 ){
int c;
for (c = 0; c < 2; c++)