diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2014-01-11 22:46:24 +0100 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2014-01-21 11:58:37 +0100 |
commit | a246d06fe0dc6c2ea65e95327624b4537ff9bd0d (patch) | |
tree | 288aafee8f05b767b8b018037794ddae196c0246 /libavcodec | |
parent | b37e796082b2d787aff3cd5631bb89c4fd374708 (diff) | |
download | ffmpeg-a246d06fe0dc6c2ea65e95327624b4537ff9bd0d.tar.gz |
hevc: clip pixels when transquant bypass is used
The reconstructed picture should always be clipped (see section 8.6.5),
previously we did not clip coding units where
cu_transquant_bypass_flag == 1.
Sample-Id: 00001325-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/hevcdsp_template.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/hevcdsp_template.c b/libavcodec/hevcdsp_template.c index 027b77c7c7..7ebe490cc4 100644 --- a/libavcodec/hevcdsp_template.c +++ b/libavcodec/hevcdsp_template.c @@ -50,7 +50,7 @@ static void FUNC(transquant_bypass4x4)(uint8_t *_dst, int16_t *coeffs, for (y = 0; y < 4; y++) { for (x = 0; x < 4; x++) { - dst[x] += *coeffs; + dst[x] = av_clip_pixel(dst[x] + *coeffs); coeffs++; } dst += stride; @@ -67,7 +67,7 @@ static void FUNC(transquant_bypass8x8)(uint8_t *_dst, int16_t *coeffs, for (y = 0; y < 8; y++) { for (x = 0; x < 8; x++) { - dst[x] += *coeffs; + dst[x] = av_clip_pixel(dst[x] + *coeffs); coeffs++; } dst += stride; @@ -84,7 +84,7 @@ static void FUNC(transquant_bypass16x16)(uint8_t *_dst, int16_t *coeffs, for (y = 0; y < 16; y++) { for (x = 0; x < 16; x++) { - dst[x] += *coeffs; + dst[x] = av_clip_pixel(dst[x] + *coeffs); coeffs++; } dst += stride; @@ -101,7 +101,7 @@ static void FUNC(transquant_bypass32x32)(uint8_t *_dst, int16_t *coeffs, for (y = 0; y < 32; y++) { for (x = 0; x < 32; x++) { - dst[x] += *coeffs; + dst[x] = av_clip_pixel(dst[x] + *coeffs); coeffs++; } dst += stride; |