diff options
author | Mickaël Raulet <mraulet@insa-rennes.fr> | 2016-07-04 15:37:52 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2016-07-18 15:27:13 +0200 |
commit | a92fd8a06256e71a0be87b03751ec3c2a4a8aa21 (patch) | |
tree | 107afc227b94776a8b834fa21acd169bdf2d6435 /libavcodec/hevcdsp_template.c | |
parent | 4f247de3b797cdc9d243d26534412f81c306e5b5 (diff) | |
download | ffmpeg-a92fd8a06256e71a0be87b03751ec3c2a4a8aa21.tar.gz |
hevc: Add DC IDCT
Integrated to Libav by Josh de Kock <josh@itanimul.li>.
Signed-off-by: Alexandra Hájková <alexandra@khirnov.net>
Diffstat (limited to 'libavcodec/hevcdsp_template.c')
-rw-r--r-- | libavcodec/hevcdsp_template.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libavcodec/hevcdsp_template.c b/libavcodec/hevcdsp_template.c index 2cde5a8132..81e3ea5d59 100644 --- a/libavcodec/hevcdsp_template.c +++ b/libavcodec/hevcdsp_template.c @@ -223,10 +223,29 @@ static void FUNC(idct_ ## H ## x ## H )(int16_t *coeffs) \ } \ } +#define IDCT_DC(H) \ +static void FUNC(idct_ ## H ## x ## H ## _dc)(int16_t *coeffs) \ +{ \ + int i, j; \ + int shift = 14 - BIT_DEPTH; \ + int add = 1 << (shift - 1); \ + int coeff = (((coeffs[0] + 1) >> 1) + add) >> shift; \ + \ + for (j = 0; j < H; j++) { \ + for (i = 0; i < H; i++) { \ + coeffs[i + j * H] = coeff; \ + } \ + } \ +} + IDCT( 4) IDCT( 8) IDCT(16) IDCT(32) +IDCT_DC( 4) +IDCT_DC( 8) +IDCT_DC(16) +IDCT_DC(32) #undef TR_4 #undef TR_8 #undef TR_16 |