summaryrefslogtreecommitdiff
path: root/libavcodec/hevc_filter.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2015-02-04 20:21:56 -0300
committerJames Almer <jamrial@gmail.com>2015-02-05 15:02:27 -0300
commit042c1159fcf8431725c718a504b1fb40364bf434 (patch)
treef80a1ec51d5d10feccdbcc6be4cc1a652c26e4ce /libavcodec/hevc_filter.c
parent1f1c7c8a57e81803a034b00077bd43e7a6e4ed82 (diff)
downloadffmpeg-042c1159fcf8431725c718a504b1fb40364bf434.tar.gz
x86/hevcdsp: add ff_hevc_sao_edge_filter_8_{ssse3,avx2}
Original x86 intrinsics code and initial yasm port by Pierre-Edouard Lepere. Refactoring and optimizations by James Almer. Benchmarks of BQTerrace_1920x1080_60_qp22.bin with an Intel Core i5-4200U Width 32 158583 decicycles in edge, sao_edge_filter_8 runs, 0 skips 5205 decicycles in ff_hevc_sao_edge_filter_32_8_ssse3, 32767 runs, 1 skips 2942 decicycles in ff_hevc_sao_edge_filter_32_8_avx2, 32767 runs, 1 skips Width 64 705639 decicycles in sao_edge_filter_8, 262144 runs, 0 skips 19224 decicycles in ff_hevc_sao_edge_filter_64_8_ssse3, 262111 runs, 33 skips 10433 decicycles in ff_hevc_sao_edge_filter_64_8_avx2, 262115 runs, 29 skips Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/hevc_filter.c')
-rw-r--r--libavcodec/hevc_filter.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c
index cea975da79..54dc708e2c 100644
--- a/libavcodec/hevc_filter.c
+++ b/libavcodec/hevc_filter.c
@@ -246,7 +246,7 @@ static void restore_tqb_pixels(HEVCContext *s,
static void sao_filter_CTB(HEVCContext *s, int x, int y)
{
- static const uint8_t band_tab[8] = { 0, 1, 2, 2, 3, 3, 4, 4 };
+ static const uint8_t sao_tab[8] = { 0, 1, 2, 2, 3, 3, 4, 4 };
HEVCLocalContext *lc = s->HEVClc;
int c_idx;
int edges[4]; // 0 left 1 top 2 right 3 bottom
@@ -312,7 +312,7 @@ static void sao_filter_CTB(HEVCContext *s, int x, int y)
int ctb_size_v = (1 << (s->sps->log2_ctb_size)) >> s->sps->vshift[c_idx];
int width = FFMIN(ctb_size_h, (s->sps->width >> s->sps->hshift[c_idx]) - x0);
int height = FFMIN(ctb_size_v, (s->sps->height >> s->sps->vshift[c_idx]) - y0);
- int tab = band_tab[(FFALIGN(width, 8) >> 3) - 1];
+ int tab = sao_tab[(FFALIGN(width, 8) >> 3) - 1];
uint8_t *src = &s->frame->data[c_idx][y0 * stride_src + (x0 << s->sps->pixel_shift)];
int stride_dst;
uint8_t *dst;
@@ -427,8 +427,8 @@ static void sao_filter_CTB(HEVCContext *s, int x, int y)
copy_CTB_to_hv(s, src, stride_src, x0, y0, width, height, c_idx,
x_ctb, y_ctb);
- s->hevcdsp.sao_edge_filter(src, dst, stride_src, sao->offset_val[c_idx],
- sao->eo_class[c_idx], width, height);
+ s->hevcdsp.sao_edge_filter[tab](src, dst, stride_src, sao->offset_val[c_idx],
+ sao->eo_class[c_idx], width, height);
s->hevcdsp.sao_edge_restore[restore](src, dst,
stride_src, stride_dst,
sao,