diff options
author | Seppo Tomperi <seppo.tomperi@vtt.fi> | 2015-02-04 04:34:52 +0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2015-02-04 23:52:49 +0300 |
commit | 74d7faf4001e74c54f81000e521cef8e9965c80b (patch) | |
tree | 8ad56aac45e1ae7fc73c8eabbc2b05c220338754 /libavcodec/hevcdsp_template.c | |
parent | fabbfaa095660982cc0bc63242c459561fa37037 (diff) |
hevcdsp: separated sao edge filter and pixel restore funcs
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Reviewed-by: Mickaƫl Raulet <mraulet@insa-rennes.fr>
Diffstat (limited to 'libavcodec/hevcdsp_template.c')
-rw-r--r-- | libavcodec/hevcdsp_template.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/libavcodec/hevcdsp_template.c b/libavcodec/hevcdsp_template.c index 23fdb102b9..37c30b93a2 100644 --- a/libavcodec/hevcdsp_template.c +++ b/libavcodec/hevcdsp_template.c @@ -344,8 +344,8 @@ static void FUNC(sao_edge_filter)(uint8_t *_dst, uint8_t *_src, pixel *dst = (pixel *)_dst; pixel *src = (pixel *)_src; - int y_stride_src = init_y * stride_src; - int y_stride_dst = init_y * stride_dst; + int y_stride_src = init_y * (stride_src /= sizeof(pixel)); + int y_stride_dst = init_y * (stride_dst /= sizeof(pixel)); int pos_0_0 = pos[sao_eo_class][0][0]; int pos_0_1 = pos[sao_eo_class][0][1]; int pos_1_0 = pos[sao_eo_class][1][0]; @@ -368,7 +368,7 @@ static void FUNC(sao_edge_filter)(uint8_t *_dst, uint8_t *_src, } } -static void FUNC(sao_edge_filter_0)(uint8_t *_dst, uint8_t *_src, +static void FUNC(sao_edge_restore_0)(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, ptrdiff_t stride_src, SAOParams *sao, int *borders, int _width, int _height, int c_idx, uint8_t *vert_edge, @@ -379,7 +379,7 @@ static void FUNC(sao_edge_filter_0)(uint8_t *_dst, uint8_t *_src, pixel *src = (pixel *)_src; int16_t *sao_offset_val = sao->offset_val[c_idx]; int sao_eo_class = sao->eo_class[c_idx]; - int init_x = 0, init_y = 0, width = _width, height = _height; + int init_x = 0, width = _width, height = _height; stride_dst /= sizeof(pixel); stride_src /= sizeof(pixel); @@ -406,7 +406,6 @@ static void FUNC(sao_edge_filter_0)(uint8_t *_dst, uint8_t *_src, int offset_val = sao_offset_val[0]; for (x = init_x; x < width; x++) dst[x] = av_clip_pixel(src[x] + offset_val); - init_y = 1; } if (borders[3]) { int offset_val = sao_offset_val[0]; @@ -417,11 +416,9 @@ static void FUNC(sao_edge_filter_0)(uint8_t *_dst, uint8_t *_src, height--; } } - - FUNC(sao_edge_filter)((uint8_t *)dst, (uint8_t *)src, stride_dst, stride_src, sao, width, height, c_idx, init_x, init_y); } -static void FUNC(sao_edge_filter_1)(uint8_t *_dst, uint8_t *_src, +static void FUNC(sao_edge_restore_1)(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, ptrdiff_t stride_src, SAOParams *sao, int *borders, int _width, int _height, int c_idx, uint8_t *vert_edge, @@ -471,8 +468,6 @@ static void FUNC(sao_edge_filter_1)(uint8_t *_dst, uint8_t *_src, } } - FUNC(sao_edge_filter)((uint8_t *)dst, (uint8_t *)src, stride_dst, stride_src, sao, width, height, c_idx, init_x, init_y); - { int save_upper_left = !diag_edge[0] && sao_eo_class == SAO_EO_135D && !borders[0] && !borders[1]; int save_upper_right = !diag_edge[1] && sao_eo_class == SAO_EO_45D && !borders[1] && !borders[2]; |