aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/hevcdsp_template.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/hevcdsp_template.c')
-rw-r--r--libavcodec/hevcdsp_template.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/libavcodec/hevcdsp_template.c b/libavcodec/hevcdsp_template.c
index 027b77c7c7..a11ddfdc38 100644
--- a/libavcodec/hevcdsp_template.c
+++ b/libavcodec/hevcdsp_template.c
@@ -3,20 +3,20 @@
*
* Copyright (C) 2012 - 2013 Guillaume Martres
*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@@ -24,6 +24,8 @@
#include "hevc.h"
#include "bit_depth_template.c"
+#include "hevcdsp.h"
+
static void FUNC(put_pcm)(uint8_t *_dst, ptrdiff_t stride, int size,
GetBitContext *gb, int pcm_bit_depth)
@@ -50,7 +52,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 +69,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 +86,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 +103,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;
@@ -393,7 +395,7 @@ static void FUNC(sao_band_filter)(uint8_t *_dst, uint8_t *_src,
offset_table[(k + sao_left_class) & 31] = sao_offset_val[k + 1];
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++)
- dst[x] = av_clip_pixel(src[x] + offset_table[av_clip_pixel(src[x] >> shift)]);
+ dst[x] = av_clip_pixel(src[x] + offset_table[src[x] >> shift]);
dst += stride;
src += stride;
}