Commit 606a2561 by John Koleszar Committed by Gerrit Code Review

### Merge "Code cleanup." into experimental

parents c67a2099 548b4dd5
 ... ... @@ -16,8 +16,8 @@ // Constants and Macros used by all idct/dct functions #define DCT_CONST_BITS 14 #define DCT_CONST_ROUNDING (1 << (DCT_CONST_BITS - 1)) // Constants are 16384 * cos(kPi/64) where k = 1 to 31. // Note: sin(kPi/64) = cos((32-k)Pi/64) // Constants are round(16384 * cos(k*Pi/64)) where k = 1 to 31. // Note: sin(k*Pi/64) = cos((32-k)*Pi/64) static const int cospi_1_64 = 16364; static const int cospi_2_64 = 16305; static const int cospi_3_64 = 16207; ... ...
 ... ... @@ -530,8 +530,8 @@ void vp9_short_idct8x8_c(int16_t *input, int16_t *output, int pitch) { temp_in[j] = out[j * 8 + i]; idct8_1d(temp_in, temp_out); for (j = 0; j < 8; ++j) output[j * short_pitch + i] = (temp_out[j] + 16) >> 5; } output[j * short_pitch + i] = (temp_out[j] + 16) >> 5; } } #if CONFIG_INTHT4X4 ... ... @@ -782,18 +782,14 @@ void vp9_short_idct10_8x8_c(int16_t *input, int16_t *output, int pitch) { temp_in[j] = out[j * 8 + i]; idct8_1d(temp_in, temp_out); for (j = 0; j < 8; ++j) output[j * short_pitch + i] = (temp_out[j] + 16) >> 5; } output[j * short_pitch + i] = (temp_out[j] + 16) >> 5; } } void vp9_short_idct1_8x8_c(int16_t *input, int16_t *output) { int tmp; int16_t out; tmp = input[0] * cospi_16_64; out = dct_const_round_shift(tmp); tmp = out * cospi_16_64; out = dct_const_round_shift(tmp); *output = (out + 16) >> 5; int16_t out = dct_const_round_shift(input[0] * cospi_16_64); out = dct_const_round_shift(out * cospi_16_64); output[0] = (out + 16) >> 5; } void idct16_1d(int16_t *input, int16_t *output) { ... ... @@ -980,8 +976,8 @@ void vp9_short_idct16x16_c(int16_t *input, int16_t *output, int pitch) { temp_in[j] = out[j * 16 + i]; idct16_1d(temp_in, temp_out); for (j = 0; j < 16; ++j) output[j * 16 + i] = (temp_out[j] + 32) >> 6; } output[j * 16 + i] = (temp_out[j] + 32) >> 6; } } #if CONFIG_INTHT16X16 ... ... @@ -1638,11 +1634,7 @@ void vp9_short_idct32x32_c(int16_t *input, int16_t *output, int pitch) { } void vp9_short_idct1_32x32_c(int16_t *input, int16_t *output) { int tmp; int16_t out; tmp = input[0] * cospi_16_64; out = dct_const_round_shift(tmp); tmp = out * cospi_16_64; out = dct_const_round_shift(tmp); *output = (out + 32) >> 6; int16_t out = dct_const_round_shift(input[0] * cospi_16_64); out = dct_const_round_shift(out * cospi_16_64); output[0] = (out + 32) >> 6; }
 ... ... @@ -11,9 +11,9 @@ #ifndef VP9_COMMON_VP9_TEXTBLIT_H_ #define VP9_COMMON_VP9_TEXTBLIT_H_ extern void vp9_blit_text(const char *msg, unsigned char *address, const int pitch); extern void vp9_blit_line(int x0, int x1, int y0, int y1, unsigned char *image, const int pitch); void vp9_blit_text(const char *msg, unsigned char *address, int pitch); void vp9_blit_line(int x0, int x1, int y0, int y1, unsigned char *image, int pitch); #endif // VP9_COMMON_VP9_TEXTBLIT_H_
 ... ... @@ -16,11 +16,11 @@ #define MIN_TILE_WIDTH 256 #define MAX_TILE_WIDTH 4096 extern void vp9_get_tile_col_offsets(VP9_COMMON *cm, int tile_col_idx); void vp9_get_tile_col_offsets(VP9_COMMON *cm, int tile_col_idx); extern void vp9_get_tile_row_offsets(VP9_COMMON *cm, int tile_row_idx); void vp9_get_tile_row_offsets(VP9_COMMON *cm, int tile_row_idx); extern void vp9_get_tile_n_bits(VP9_COMMON *cm, int *min_log2_n_tiles, int *delta_log2_n_tiles); void vp9_get_tile_n_bits(VP9_COMMON *cm, int *min_log2_n_tiles, int *delta_log2_n_tiles); #endif // VP9_COMMON_VP9_TILE_COMMON_H_
 ... ... @@ -63,7 +63,9 @@ void vp9_bool_decoder_fill(BOOL_DECODER *br) { static int get_unsigned_bits(unsigned num_values) { int cat = 0; if ((num_values--) <= 1) return 0; if (num_values <= 1) return 0; num_values--; while (num_values > 0) { cat++; num_values >>= 1; ... ... @@ -72,9 +74,12 @@ static int get_unsigned_bits(unsigned num_values) { } int vp9_inv_recenter_nonneg(int v, int m) { if (v > (m << 1)) return v; else if ((v & 1) == 0) return (v >> 1) + m; else return m - ((v + 1) >> 1); if (v > (m << 1)) return v; else if ((v & 1) == 0) return (v >> 1) + m; else return m - ((v + 1) >> 1); } int vp9_decode_uniform(BOOL_DECODER *br, int n) { ... ...
 ... ... @@ -45,46 +45,13 @@ int vp9_decode_uniform(BOOL_DECODER *br, int n); int vp9_decode_term_subexp(BOOL_DECODER *br, int k, int num_syms); int vp9_inv_recenter_nonneg(int v, int m); /*The refill loop is used in several places, so define it in a macro to make sure they're all consistent. An inline function would be cleaner, but has a significant penalty, because multiple BOOL_DECODER fields must be modified, and the compiler is not smart enough to eliminate the stores to those fields and the subsequent reloads from them when inlining the function.*/ #define VP9DX_BOOL_DECODER_FILL(_count,_value,_bufptr,_bufend) \ do \ { \ int shift = VP9_BD_VALUE_SIZE - 8 - ((_count) + 8); \ int loop_end, x; \ int bits_left = (int)(((_bufend)-(_bufptr))*CHAR_BIT); \ \ x = shift + CHAR_BIT - bits_left; \ loop_end = 0; \ if(x >= 0) \ { \ (_count) += VP9_LOTS_OF_BITS; \ loop_end = x; \ if(!bits_left) break; \ } \ while(shift >= loop_end) \ { \ (_count) += CHAR_BIT; \ (_value) |= (VP9_BD_VALUE)*(_bufptr)++ << shift; \ shift -= CHAR_BIT; \ } \ } \ while(0) \ static int decode_bool(BOOL_DECODER *br, int probability) { unsigned int bit = 0; VP9_BD_VALUE value; unsigned int split; VP9_BD_VALUE bigsplit; int count; unsigned int range; split = 1 + (((br->range - 1) * probability) >> 8); unsigned int split = 1 + (((br->range - 1) * probability) >> 8); if (br->count < 0) vp9_bool_decoder_fill(br); ... ...