Commit e1e3ec9b authored by Mickaël Raulet's avatar Mickaël Raulet Committed by Michael Niedermayer

hevc: fix transquant_bypass

cherry picked from commit 4a16cb2c70728a55d2fd723aff01b13ea259c4df
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent fdb20db6
...@@ -158,7 +158,8 @@ static void restore_tqb_pixels(HEVCContext *s, int x0, int y0, int width, int he ...@@ -158,7 +158,8 @@ static void restore_tqb_pixels(HEVCContext *s, int x0, int y0, int width, int he
if ( s->pps->transquant_bypass_enable_flag || if ( s->pps->transquant_bypass_enable_flag ||
(s->sps->pcm.loop_filter_disable_flag && s->sps->pcm_enabled_flag)) { (s->sps->pcm.loop_filter_disable_flag && s->sps->pcm_enabled_flag)) {
int x, y; int x, y;
ptrdiff_t stride = s->frame->linesize[c_idx]; ptrdiff_t stride_dst = s->sao_frame->linesize[c_idx];
ptrdiff_t stride_src = s->frame->linesize[c_idx];
int min_pu_size = 1 << s->sps->log2_min_pu_size; int min_pu_size = 1 << s->sps->log2_min_pu_size;
int hshift = s->sps->hshift[c_idx]; int hshift = s->sps->hshift[c_idx];
int vshift = s->sps->vshift[c_idx]; int vshift = s->sps->vshift[c_idx];
...@@ -171,12 +172,12 @@ static void restore_tqb_pixels(HEVCContext *s, int x0, int y0, int width, int he ...@@ -171,12 +172,12 @@ static void restore_tqb_pixels(HEVCContext *s, int x0, int y0, int width, int he
for (x = x_min; x < x_max; x++) { for (x = x_min; x < x_max; x++) {
if (s->is_pcm[y * s->sps->min_pu_width + x]) { if (s->is_pcm[y * s->sps->min_pu_width + x]) {
int n; int n;
uint8_t *src = &s->frame->data[c_idx][ ((y << s->sps->log2_min_pu_size) >> vshift) * stride + (((x << s->sps->log2_min_pu_size) >> hshift) << s->sps->pixel_shift)]; uint8_t *src = &s->frame->data[c_idx][ ((y << s->sps->log2_min_pu_size) >> vshift) * stride_src + (((x << s->sps->log2_min_pu_size) >> hshift) << s->sps->pixel_shift)];
uint8_t *dst = &s->sao_frame->data[c_idx][((y << s->sps->log2_min_pu_size) >> vshift) * stride + (((x << s->sps->log2_min_pu_size) >> hshift) << s->sps->pixel_shift)]; uint8_t *dst = &s->sao_frame->data[c_idx][((y << s->sps->log2_min_pu_size) >> vshift) * stride_dst + (((x << s->sps->log2_min_pu_size) >> hshift) << s->sps->pixel_shift)];
for (n = 0; n < (min_pu_size >> vshift); n++) { for (n = 0; n < (min_pu_size >> vshift); n++) {
memcpy(src, dst, len); memcpy(src, dst, len);
src += stride; src += stride_src;
dst += stride; dst += stride_dst;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment