comparison h264.c @ 8405:f94a6d6df87e libavcodec

H.264 loopfilter speed tweaks
author darkshikari
date Fri, 19 Dec 2008 14:49:17 +0000
parents 0199857f9000
children b749b637ecfa
comparison
equal deleted inserted replaced
8404:60b6a780100b 8405:f94a6d6df87e
5846 const int alpha = (alpha_table+52)[index_a]; 5846 const int alpha = (alpha_table+52)[index_a];
5847 const int beta = (beta_table+52)[qp + h->slice_beta_offset]; 5847 const int beta = (beta_table+52)[qp + h->slice_beta_offset];
5848 5848
5849 if( bS[0] < 4 ) { 5849 if( bS[0] < 4 ) {
5850 int8_t tc[4]; 5850 int8_t tc[4];
5851 for(i=0; i<4; i++) 5851 tc[0] = (tc0_table+52)[index_a][bS[0]];
5852 tc[i] = bS[i] ? (tc0_table+52)[index_a][bS[i] - 1] : -1; 5852 tc[1] = (tc0_table+52)[index_a][bS[1]];
5853 tc[2] = (tc0_table+52)[index_a][bS[2]];
5854 tc[3] = (tc0_table+52)[index_a][bS[3]];
5853 h->s.dsp.h264_h_loop_filter_luma(pix, stride, alpha, beta, tc); 5855 h->s.dsp.h264_h_loop_filter_luma(pix, stride, alpha, beta, tc);
5854 } else { 5856 } else {
5855 h->s.dsp.h264_h_loop_filter_luma_intra(pix, stride, alpha, beta); 5857 h->s.dsp.h264_h_loop_filter_luma_intra(pix, stride, alpha, beta);
5856 } 5858 }
5857 } 5859 }
5861 const int alpha = (alpha_table+52)[index_a]; 5863 const int alpha = (alpha_table+52)[index_a];
5862 const int beta = (beta_table+52)[qp + h->slice_beta_offset]; 5864 const int beta = (beta_table+52)[qp + h->slice_beta_offset];
5863 5865
5864 if( bS[0] < 4 ) { 5866 if( bS[0] < 4 ) {
5865 int8_t tc[4]; 5867 int8_t tc[4];
5866 for(i=0; i<4; i++) 5868 tc[0] = (tc0_table+52)[index_a][bS[0]]+1;
5867 tc[i] = bS[i] ? (tc0_table+52)[index_a][bS[i] - 1] + 1 : 0; 5869 tc[1] = (tc0_table+52)[index_a][bS[1]]+1;
5870 tc[2] = (tc0_table+52)[index_a][bS[2]]+1;
5871 tc[3] = (tc0_table+52)[index_a][bS[3]]+1;
5868 h->s.dsp.h264_h_loop_filter_chroma(pix, stride, alpha, beta, tc); 5872 h->s.dsp.h264_h_loop_filter_chroma(pix, stride, alpha, beta, tc);
5869 } else { 5873 } else {
5870 h->s.dsp.h264_h_loop_filter_chroma_intra(pix, stride, alpha, beta); 5874 h->s.dsp.h264_h_loop_filter_chroma_intra(pix, stride, alpha, beta);
5871 } 5875 }
5872 } 5876 }
5893 index_a = qp[qp_index] + h->slice_alpha_c0_offset; 5897 index_a = qp[qp_index] + h->slice_alpha_c0_offset;
5894 alpha = (alpha_table+52)[index_a]; 5898 alpha = (alpha_table+52)[index_a];
5895 beta = (beta_table+52)[qp[qp_index] + h->slice_beta_offset]; 5899 beta = (beta_table+52)[qp[qp_index] + h->slice_beta_offset];
5896 5900
5897 if( bS[bS_index] < 4 ) { 5901 if( bS[bS_index] < 4 ) {
5898 const int tc0 = (tc0_table+52)[index_a][bS[bS_index] - 1]; 5902 const int tc0 = (tc0_table+52)[index_a][bS[bS_index]];
5899 const int p0 = pix[-1]; 5903 const int p0 = pix[-1];
5900 const int p1 = pix[-2]; 5904 const int p1 = pix[-2];
5901 const int p2 = pix[-3]; 5905 const int p2 = pix[-3];
5902 const int q0 = pix[0]; 5906 const int q0 = pix[0];
5903 const int q1 = pix[1]; 5907 const int q1 = pix[1];
5987 index_a = qp[qp_index] + h->slice_alpha_c0_offset; 5991 index_a = qp[qp_index] + h->slice_alpha_c0_offset;
5988 alpha = (alpha_table+52)[index_a]; 5992 alpha = (alpha_table+52)[index_a];
5989 beta = (beta_table+52)[qp[qp_index] + h->slice_beta_offset]; 5993 beta = (beta_table+52)[qp[qp_index] + h->slice_beta_offset];
5990 5994
5991 if( bS[bS_index] < 4 ) { 5995 if( bS[bS_index] < 4 ) {
5992 const int tc = (tc0_table+52)[index_a][bS[bS_index] - 1] + 1; 5996 const int tc = (tc0_table+52)[index_a][bS[bS_index]] + 1;
5993 const int p0 = pix[-1]; 5997 const int p0 = pix[-1];
5994 const int p1 = pix[-2]; 5998 const int p1 = pix[-2];
5995 const int q0 = pix[0]; 5999 const int q0 = pix[0];
5996 const int q1 = pix[1]; 6000 const int q1 = pix[1];
5997 6001
6029 const int beta = (beta_table+52)[qp + h->slice_beta_offset]; 6033 const int beta = (beta_table+52)[qp + h->slice_beta_offset];
6030 const int pix_next = stride; 6034 const int pix_next = stride;
6031 6035
6032 if( bS[0] < 4 ) { 6036 if( bS[0] < 4 ) {
6033 int8_t tc[4]; 6037 int8_t tc[4];
6034 for(i=0; i<4; i++) 6038 tc[0] = (tc0_table+52)[index_a][bS[0]];
6035 tc[i] = bS[i] ? (tc0_table+52)[index_a][bS[i] - 1] : -1; 6039 tc[1] = (tc0_table+52)[index_a][bS[1]];
6040 tc[2] = (tc0_table+52)[index_a][bS[2]];
6041 tc[3] = (tc0_table+52)[index_a][bS[3]];
6036 h->s.dsp.h264_v_loop_filter_luma(pix, stride, alpha, beta, tc); 6042 h->s.dsp.h264_v_loop_filter_luma(pix, stride, alpha, beta, tc);
6037 } else { 6043 } else {
6038 h->s.dsp.h264_v_loop_filter_luma_intra(pix, stride, alpha, beta); 6044 h->s.dsp.h264_v_loop_filter_luma_intra(pix, stride, alpha, beta);
6039 } 6045 }
6040 } 6046 }
6045 const int alpha = (alpha_table+52)[index_a]; 6051 const int alpha = (alpha_table+52)[index_a];
6046 const int beta = (beta_table+52)[qp + h->slice_beta_offset]; 6052 const int beta = (beta_table+52)[qp + h->slice_beta_offset];
6047 6053
6048 if( bS[0] < 4 ) { 6054 if( bS[0] < 4 ) {
6049 int8_t tc[4]; 6055 int8_t tc[4];
6050 for(i=0; i<4; i++) 6056 tc[0] = (tc0_table+52)[index_a][bS[0]]+1;
6051 tc[i] = bS[i] ? (tc0_table+52)[index_a][bS[i] - 1] + 1 : 0; 6057 tc[1] = (tc0_table+52)[index_a][bS[1]]+1;
6058 tc[2] = (tc0_table+52)[index_a][bS[2]]+1;
6059 tc[3] = (tc0_table+52)[index_a][bS[3]]+1;
6052 h->s.dsp.h264_v_loop_filter_chroma(pix, stride, alpha, beta, tc); 6060 h->s.dsp.h264_v_loop_filter_chroma(pix, stride, alpha, beta, tc);
6053 } else { 6061 } else {
6054 h->s.dsp.h264_v_loop_filter_chroma_intra(pix, stride, alpha, beta); 6062 h->s.dsp.h264_v_loop_filter_chroma_intra(pix, stride, alpha, beta);
6055 } 6063 }
6056 } 6064 }