Mercurial > libavcodec.hg
diff svq3.c @ 10852:86d7ab878805 libavcodec
Get rid of #include "svq3.c"
functions called more than per mb are moved into the header, scan8 is also
as it must be known at compiletime.
The code after this patch duplicates h264data.h, this has been done to minimize
the changes in this step and allow more fine grained benchmarking.
Speedwise this is 1% faster on my pentium dual core with diegos cursed cathedral
sample.
author | michael |
---|---|
date | Tue, 12 Jan 2010 05:30:31 +0000 |
parents | abf5c20eebf4 |
children | 974ac220c93a |
line wrap: on
line diff
--- a/svq3.c Tue Jan 12 04:49:18 2010 +0000 +++ b/svq3.c Tue Jan 12 05:30:31 2010 +0000 @@ -39,6 +39,21 @@ * correctly decodes this file: * http://samples.mplayerhq.hu/V-codecs/SVQ3/Vertical400kbit.sorenson3.mov */ +#include "internal.h" +#include "dsputil.h" +#include "avcodec.h" +#include "mpegvideo.h" +#include "h264.h" + +#include "h264data.h" //FIXME FIXME FIXME + +#include "golomb.h" +#include "rectangle.h" +#include "vdpau_internal.h" + +#if ARCH_X86 +#include "x86/h264_i386.h" +#endif #if CONFIG_ZLIB #include <zlib.h> @@ -114,7 +129,7 @@ }; -static void svq3_luma_dc_dequant_idct_c(DCTELEM *block, int qp) +void svq3_luma_dc_dequant_idct_c(DCTELEM *block, int qp) { const int qmul = svq3_dequant_coeff[qp]; #define stride 16 @@ -151,7 +166,7 @@ } #undef stride -static void svq3_add_idct_c(uint8_t *dst, DCTELEM *block, int stride, int qp, +void svq3_add_idct_c(uint8_t *dst, DCTELEM *block, int stride, int qp, int dc) { const int qmul = svq3_dequant_coeff[qp]; @@ -571,7 +586,7 @@ } } - write_back_intra_pred_mode(h); + ff_h264_write_back_intra_pred_mode(h); if (mb_type == 8) { check_intra4x4_pred_mode(h); @@ -592,7 +607,7 @@ dir = i_mb_type_info[mb_type - 8].pred_mode; dir = (dir >> 1) ^ 3*(dir & 1) ^ 1; - if ((h->intra16x16_pred_mode = check_intra_pred_mode(h, dir)) == -1){ + if ((h->intra16x16_pred_mode = ff_h264_check_intra_pred_mode(h, dir)) == -1){ av_log(h->s.avctx, AV_LOG_ERROR, "check_intra_pred_mode = -1\n"); return -1; } @@ -685,7 +700,7 @@ s->current_picture.mb_type[mb_xy] = mb_type; if (IS_INTRA(mb_type)) { - h->chroma_pred_mode = check_intra_pred_mode(h, DC_PRED8x8); + h->chroma_pred_mode = ff_h264_check_intra_pred_mode(h, DC_PRED8x8); } return 0; @@ -789,7 +804,7 @@ return -1; } - if (decode_init(avctx) < 0) + if (ff_h264_decode_init(avctx) < 0) return -1; s->flags = avctx->flags; @@ -811,7 +826,7 @@ h->b_stride = 4*s->mb_width; - alloc_tables(h); + ff_h264_alloc_tables(h); /* prowl for the "SEQH" marker in the extradata */ extradata = (unsigned char *)avctx->extradata; @@ -965,7 +980,7 @@ s->next_p_frame_damaged = 0; } - if (frame_start(h) < 0) + if (ff_h264_frame_start(h) < 0) return -1; if (s->pict_type == FF_B_TYPE) { @@ -1028,7 +1043,7 @@ } if (mb_type != 0) { - hl_decode_mb (h); + ff_h264_hl_decode_mb (h); } if (s->pict_type != FF_B_TYPE && !s->low_delay) { @@ -1064,7 +1079,7 @@ sizeof(H264Context), svq3_decode_init, NULL, - decode_end, + ff_h264_decode_end, svq3_decode_frame, CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_DELAY, .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 3 / Sorenson Video 3 / SVQ3"),