aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-01-12 21:17:26 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-01-12 21:17:26 +0000
commit2bedc0e85499c6d05c230626e22fa9d0c2e511e6 (patch)
treea8a66fb962271b5e225b1c9e0658a740121913da /libavcodec/h264.h
parentea6f00c448beb212c80ebc7d4555a8aa7160fdb9 (diff)
downloadffmpeg-2bedc0e85499c6d05c230626e22fa9d0c2e511e6.tar.gz
Move check_intra4x4_pred_mode() back from h264.h to h264.c, the function is just
called once per MB in worst case and doesnt seem to benefit from static inline. Actually the code might be a hair faster now (0.1% according to my benchmark but this could be random noise) Originally committed as revision 21173 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.h')
-rw-r--r--libavcodec/h264.h44
1 files changed, 5 insertions, 39 deletions
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 16bf9aed73..883012159d 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -630,6 +630,11 @@ int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb);
/**
* checks if the top & left blocks are available if needed & changes the dc mode so it only uses the available blocks.
*/
+int ff_h264_check_intra4x4_pred_mode(H264Context *h);
+
+/**
+ * checks if the top & left blocks are available if needed & changes the dc mode so it only uses the available blocks.
+ */
int ff_h264_check_intra_pred_mode(H264Context *h, int mode);
void ff_h264_write_back_intra_pred_mode(H264Context *h);
@@ -683,45 +688,6 @@ static av_always_inline uint32_t pack16to32(int a, int b){
}
/**
- * checks if the top & left blocks are available if needed & changes the dc mode so it only uses the available blocks.
- */
-static inline int check_intra4x4_pred_mode(H264Context *h){
- MpegEncContext * const s = &h->s;
- static const int8_t top [12]= {-1, 0,LEFT_DC_PRED,-1,-1,-1,-1,-1, 0};
- static const int8_t left[12]= { 0,-1, TOP_DC_PRED, 0,-1,-1,-1, 0,-1,DC_128_PRED};
- int i;
-
- if(!(h->top_samples_available&0x8000)){
- for(i=0; i<4; i++){
- int status= top[ h->intra4x4_pred_mode_cache[scan8[0] + i] ];
- if(status<0){
- av_log(h->s.avctx, AV_LOG_ERROR, "top block unavailable for requested intra4x4 mode %d at %d %d\n", status, s->mb_x, s->mb_y);
- return -1;
- } else if(status){
- h->intra4x4_pred_mode_cache[scan8[0] + i]= status;
- }
- }
- }
-
- if((h->left_samples_available&0x8888)!=0x8888){
- static const int mask[4]={0x8000,0x2000,0x80,0x20};
- for(i=0; i<4; i++){
- if(!(h->left_samples_available&mask[i])){
- int status= left[ h->intra4x4_pred_mode_cache[scan8[0] + 8*i] ];
- if(status<0){
- av_log(h->s.avctx, AV_LOG_ERROR, "left block unavailable for requested intra4x4 mode %d at %d %d\n", status, s->mb_x, s->mb_y);
- return -1;
- } else if(status){
- h->intra4x4_pred_mode_cache[scan8[0] + 8*i]= status;
- }
- }
- }
- }
-
- return 0;
-} //FIXME cleanup like ff_h264_check_intra_pred_mode
-
-/**
* gets the chroma qp.
*/
static inline int get_chroma_qp(H264Context *h, int t, int qscale){