summaryrefslogtreecommitdiff
path: root/libavcodec/hevc_filter.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-07-12 08:36:03 +0000
committerAnton Khirnov <anton@khirnov.net>2014-07-26 15:00:11 +0000
commit73bb8f61d48dbf7237df2e9cacd037f12b84b00a (patch)
treebe31373d956bb43258a2152b110606529f8c6216 /libavcodec/hevc_filter.c
parent56f98e340fca894a76d1ddbe33118b8d8c4db34a (diff)
hevcdsp: remove an unneeded variable in the loop filter
beta0 and beta1 will always be the same
Diffstat (limited to 'libavcodec/hevc_filter.c')
-rw-r--r--libavcodec/hevc_filter.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c
index eb3f5f3eda..eb5594cecf 100644
--- a/libavcodec/hevc_filter.c
+++ b/libavcodec/hevc_filter.c
@@ -339,7 +339,7 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0)
{
uint8_t *src;
int x, y, x_end, y_end, chroma;
- int c_tc[2], beta[2], tc[2];
+ int c_tc[2], tc[2], beta;
uint8_t no_p[2] = { 0 };
uint8_t no_q[2] = { 0 };
@@ -375,13 +375,12 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0)
const int bs0 = s->vertical_bs[(x >> 3) + (y >> 2) * s->bs_width];
const int bs1 = s->vertical_bs[(x >> 3) + ((y + 4) >> 2) * s->bs_width];
if (bs0 || bs1) {
- const int qp0 = (get_qPy(s, x - 1, y) + get_qPy(s, x, y) + 1) >> 1;
- const int qp1 = (get_qPy(s, x - 1, y + 4) + get_qPy(s, x, y + 4) + 1) >> 1;
+ const int qp = (get_qPy(s, x - 1, y) + get_qPy(s, x, y) + 1) >> 1;
- beta[0] = betatable[av_clip(qp0 + beta_offset, 0, MAX_QP)];
- beta[1] = betatable[av_clip(qp1 + beta_offset, 0, MAX_QP)];
- tc[0] = bs0 ? TC_CALC(qp0, bs0) : 0;
- tc[1] = bs1 ? TC_CALC(qp1, bs1) : 0;
+ beta = betatable[av_clip(qp + beta_offset, 0, MAX_QP)];
+
+ tc[0] = bs0 ? TC_CALC(qp, bs0) : 0;
+ tc[1] = bs1 ? TC_CALC(qp, bs1) : 0;
src = &s->frame->data[LUMA][y * s->frame->linesize[LUMA] + (x << s->sps->pixel_shift)];
if (pcmf) {
no_p[0] = get_pcm(s, x - 1, y);
@@ -437,16 +436,14 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0)
const int bs0 = s->horizontal_bs[(x + y * s->bs_width) >> 2];
const int bs1 = s->horizontal_bs[(x + 4 + y * s->bs_width) >> 2];
if (bs0 || bs1) {
- const int qp0 = (get_qPy(s, x, y - 1) + get_qPy(s, x, y) + 1) >> 1;
- const int qp1 = (get_qPy(s, x + 4, y - 1) + get_qPy(s, x + 4, y) + 1) >> 1;
+ const int qp = (get_qPy(s, x, y - 1) + get_qPy(s, x, y) + 1) >> 1;
tc_offset = x >= x0 ? cur_tc_offset : left_tc_offset;
beta_offset = x >= x0 ? cur_beta_offset : left_beta_offset;
- beta[0] = betatable[av_clip(qp0 + beta_offset, 0, MAX_QP)];
- beta[1] = betatable[av_clip(qp1 + beta_offset, 0, MAX_QP)];
- tc[0] = bs0 ? TC_CALC(qp0, bs0) : 0;
- tc[1] = bs1 ? TC_CALC(qp1, bs1) : 0;
+ beta = betatable[av_clip(qp + beta_offset, 0, MAX_QP)];
+ tc[0] = bs0 ? TC_CALC(qp, bs0) : 0;
+ tc[1] = bs1 ? TC_CALC(qp, bs1) : 0;
src = &s->frame->data[LUMA][y * s->frame->linesize[LUMA] + (x << s->sps->pixel_shift)];
if (pcmf) {
no_p[0] = get_pcm(s, x, y - 1);