summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorJason Garrett-Glaser <darkshikari@gmail.com>2008-12-19 14:49:17 +0000
committerJason Garrett-Glaser <darkshikari@gmail.com>2008-12-19 14:49:17 +0000
commitaac8b76983e340bc744d3542d676f72efa3b474f (patch)
treec659bf08f5470d908d893f7aa63a0ae4968519c3 /libavcodec/h264.c
parenta22eff36f95237147c47462c1aa356e3430c5f9f (diff)
H.264 loopfilter speed tweaks
Originally committed as revision 16240 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index ec199335c5..5a2bb7f5c2 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -5848,8 +5848,10 @@ static void filter_mb_edgev( H264Context *h, uint8_t *pix, int stride, int16_t b
if( bS[0] < 4 ) {
int8_t tc[4];
- for(i=0; i<4; i++)
- tc[i] = bS[i] ? (tc0_table+52)[index_a][bS[i] - 1] : -1;
+ tc[0] = (tc0_table+52)[index_a][bS[0]];
+ tc[1] = (tc0_table+52)[index_a][bS[1]];
+ tc[2] = (tc0_table+52)[index_a][bS[2]];
+ tc[3] = (tc0_table+52)[index_a][bS[3]];
h->s.dsp.h264_h_loop_filter_luma(pix, stride, alpha, beta, tc);
} else {
h->s.dsp.h264_h_loop_filter_luma_intra(pix, stride, alpha, beta);
@@ -5863,8 +5865,10 @@ static void filter_mb_edgecv( H264Context *h, uint8_t *pix, int stride, int16_t
if( bS[0] < 4 ) {
int8_t tc[4];
- for(i=0; i<4; i++)
- tc[i] = bS[i] ? (tc0_table+52)[index_a][bS[i] - 1] + 1 : 0;
+ tc[0] = (tc0_table+52)[index_a][bS[0]]+1;
+ tc[1] = (tc0_table+52)[index_a][bS[1]]+1;
+ tc[2] = (tc0_table+52)[index_a][bS[2]]+1;
+ tc[3] = (tc0_table+52)[index_a][bS[3]]+1;
h->s.dsp.h264_h_loop_filter_chroma(pix, stride, alpha, beta, tc);
} else {
h->s.dsp.h264_h_loop_filter_chroma_intra(pix, stride, alpha, beta);
@@ -5895,7 +5899,7 @@ static void filter_mb_mbaff_edgev( H264Context *h, uint8_t *pix, int stride, int
beta = (beta_table+52)[qp[qp_index] + h->slice_beta_offset];
if( bS[bS_index] < 4 ) {
- const int tc0 = (tc0_table+52)[index_a][bS[bS_index] - 1];
+ const int tc0 = (tc0_table+52)[index_a][bS[bS_index]];
const int p0 = pix[-1];
const int p1 = pix[-2];
const int p2 = pix[-3];
@@ -5989,7 +5993,7 @@ static void filter_mb_mbaff_edgecv( H264Context *h, uint8_t *pix, int stride, in
beta = (beta_table+52)[qp[qp_index] + h->slice_beta_offset];
if( bS[bS_index] < 4 ) {
- const int tc = (tc0_table+52)[index_a][bS[bS_index] - 1] + 1;
+ const int tc = (tc0_table+52)[index_a][bS[bS_index]] + 1;
const int p0 = pix[-1];
const int p1 = pix[-2];
const int q0 = pix[0];
@@ -6031,8 +6035,10 @@ static void filter_mb_edgeh( H264Context *h, uint8_t *pix, int stride, int16_t b
if( bS[0] < 4 ) {
int8_t tc[4];
- for(i=0; i<4; i++)
- tc[i] = bS[i] ? (tc0_table+52)[index_a][bS[i] - 1] : -1;
+ tc[0] = (tc0_table+52)[index_a][bS[0]];
+ tc[1] = (tc0_table+52)[index_a][bS[1]];
+ tc[2] = (tc0_table+52)[index_a][bS[2]];
+ tc[3] = (tc0_table+52)[index_a][bS[3]];
h->s.dsp.h264_v_loop_filter_luma(pix, stride, alpha, beta, tc);
} else {
h->s.dsp.h264_v_loop_filter_luma_intra(pix, stride, alpha, beta);
@@ -6047,8 +6053,10 @@ static void filter_mb_edgech( H264Context *h, uint8_t *pix, int stride, int16_t
if( bS[0] < 4 ) {
int8_t tc[4];
- for(i=0; i<4; i++)
- tc[i] = bS[i] ? (tc0_table+52)[index_a][bS[i] - 1] + 1 : 0;
+ tc[0] = (tc0_table+52)[index_a][bS[0]]+1;
+ tc[1] = (tc0_table+52)[index_a][bS[1]]+1;
+ tc[2] = (tc0_table+52)[index_a][bS[2]]+1;
+ tc[3] = (tc0_table+52)[index_a][bS[3]]+1;
h->s.dsp.h264_v_loop_filter_chroma(pix, stride, alpha, beta, tc);
} else {
h->s.dsp.h264_v_loop_filter_chroma_intra(pix, stride, alpha, beta);