1 #include "video_quantizer_p6.h"
2 #include "video_utils_p6.h"
3 #include "video_config.h"
5 #ifdef HAS_DO_QUANTIZE_INTRA_MB
6 // when quantization is done by P6 hardware, do_quantize_intra_mb just count the number of coefficient and find the last one
7 int16_t* do_quantize_intra_mb(int16_t* ptr, int32_t invQuant, int32_t* last_ptr)
11 uint32_t* ptr32 = (uint32_t*)ptr;
13 for( i = 6; i > 0; i-- )
16 ptr = (int16_t*)ptr32;
22 num_coeff = MCU_BLOCK_SIZE/4;
24 while( num_coeff > 0 )
26 // we load 2 coeff at a time
27 uint32_t coeff2 = *ptr32++;
29 if (coeff2 > 0x0000FFFF)
31 if ((coeff2<<16) > 0x0000FFFF)
33 // next 2 coeffs (gcc will unroll the loop)
35 if (coeff2 > 0x0000FFFF)
37 if ((coeff2<<16) > 0x0000FFFF)
45 return (int16_t*)ptr32;
47 #endif // HAS_DO_QUANTIZE_INTRA_MB