Commit 05018c2c authored by Clément Bœsch's avatar Clément Bœsch

Merge commit 'cc16da75'

* commit 'cc16da75':
  hevc: Add coefficient limiting to speed up IDCT

Noop again as we have these changes already, only random spacing
changes.
Merged-by: 's avatarClément Bœsch <cboesch@gopro.com>
parents a604115f cc16da75
...@@ -1490,7 +1490,7 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, ...@@ -1490,7 +1490,7 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
} else { } else {
int max_xy = FFMAX(last_significant_coeff_x, last_significant_coeff_y); int max_xy = FFMAX(last_significant_coeff_x, last_significant_coeff_y);
if (max_xy == 0) if (max_xy == 0)
s->hevcdsp.idct_dc[log2_trafo_size-2](coeffs); s->hevcdsp.idct_dc[log2_trafo_size - 2](coeffs);
else { else {
int col_limit = last_significant_coeff_x + last_significant_coeff_y + 4; int col_limit = last_significant_coeff_x + last_significant_coeff_y + 4;
if (max_xy < 4) if (max_xy < 4)
...@@ -1499,7 +1499,7 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, ...@@ -1499,7 +1499,7 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
col_limit = FFMIN(8, col_limit); col_limit = FFMIN(8, col_limit);
else if (max_xy < 12) else if (max_xy < 12)
col_limit = FFMIN(24, col_limit); col_limit = FFMIN(24, col_limit);
s->hevcdsp.idct[log2_trafo_size-2](coeffs, col_limit); s->hevcdsp.idct[log2_trafo_size - 2](coeffs, col_limit);
} }
} }
} }
......
...@@ -223,7 +223,7 @@ static void FUNC(transform_4x4_luma)(int16_t *coeffs) ...@@ -223,7 +223,7 @@ static void FUNC(transform_4x4_luma)(int16_t *coeffs)
for (i = 0; i < 16; i++) \ for (i = 0; i < 16; i++) \
for (j = 1; j < end; j += 2) \ for (j = 1; j < end; j += 2) \
o_32[i] += transform[j][i] * src[j * sstep]; \ o_32[i] += transform[j][i] * src[j * sstep]; \
TR_16(e_32, src, 1, 2 * sstep, SET, end/2); \ TR_16(e_32, src, 1, 2 * sstep, SET, end / 2); \
\ \
for (i = 0; i < 16; i++) { \ for (i = 0; i < 16; i++) { \
assign(dst[i * dstep], e_32[i] + o_32[i]); \ assign(dst[i * dstep], e_32[i] + o_32[i]); \
...@@ -232,21 +232,22 @@ static void FUNC(transform_4x4_luma)(int16_t *coeffs) ...@@ -232,21 +232,22 @@ static void FUNC(transform_4x4_luma)(int16_t *coeffs)
} while (0) } while (0)
#define IDCT_VAR4(H) \ #define IDCT_VAR4(H) \
int limit2 = FFMIN(col_limit + 4, H) int limit2 = FFMIN(col_limit + 4, H)
#define IDCT_VAR8(H) \ #define IDCT_VAR8(H) \
int limit = FFMIN(col_limit, H); \ int limit = FFMIN(col_limit, H); \
int limit2 = FFMIN(col_limit + 4, H) int limit2 = FFMIN(col_limit + 4, H)
#define IDCT_VAR16(H) IDCT_VAR8(H) #define IDCT_VAR16(H) IDCT_VAR8(H)
#define IDCT_VAR32(H) IDCT_VAR8(H) #define IDCT_VAR32(H) IDCT_VAR8(H)
#define IDCT(H) \ #define IDCT(H) \
static void FUNC(idct_ ## H ## x ## H )(int16_t *coeffs, \ static void FUNC(idct_ ## H ## x ## H )(int16_t *coeffs, \
int col_limit) { \ int col_limit) \
{ \
int i; \ int i; \
int shift = 7; \ int shift = 7; \
int add = 1 << (shift - 1); \ int add = 1 << (shift - 1); \
int16_t *src = coeffs; \ int16_t *src = coeffs; \
IDCT_VAR ##H(H); \ IDCT_VAR ## H(H); \
\ \
for (i = 0; i < H; i++) { \ for (i = 0; i < H; i++) { \
TR_ ## H(src, src, H, H, SCALE, limit2); \ TR_ ## H(src, src, H, H, SCALE, limit2); \
......
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