diff options
author | Mickaël Raulet <mraulet@insa-rennes.fr> | 2016-07-05 19:52:38 +0300 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2016-07-18 16:27:13 +0300 |
commit | cc16da75c2f99d92f7a6461100f041352deb6d88 (patch) | |
tree | 9070fd589edb428c50dc51467d2609e06b2b48c0 /libavcodec/hevc.c | |
parent | a92fd8a06256e71a0be87b03751ec3c2a4a8aa21 (diff) |
hevc: Add coefficient limiting to speed up IDCT
Integrated to libav by Josh de Kock <josh@itanimul.li>.
Signed-off-by: Alexandra Hájková <alexandra@khirnov.net>
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r-- | libavcodec/hevc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index d8c707b3c6..5d58b5212a 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -1218,8 +1218,16 @@ static void hls_residual_coding(HEVCContext *s, int x0, int y0, int max_xy = FFMAX(last_significant_coeff_x, last_significant_coeff_y); if (max_xy == 0) s->hevcdsp.idct_dc[log2_trafo_size - 2](coeffs); - else - s->hevcdsp.idct[log2_trafo_size - 2](coeffs); + else { + int col_limit = last_significant_coeff_x + last_significant_coeff_y + 4; + if (max_xy < 4) + col_limit = FFMIN(4, col_limit); + else if (max_xy < 8) + col_limit = FFMIN(8, col_limit); + else if (max_xy < 12) + col_limit = FFMIN(24, col_limit); + s->hevcdsp.idct[log2_trafo_size - 2](coeffs, col_limit); + } } } s->hevcdsp.add_residual[log2_trafo_size - 2](dst, coeffs, stride); |