summaryrefslogtreecommitdiff
path: root/libavcodec/h264_mvpred.h
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2011-07-12 20:36:50 +0200
committerDiego Biurrun <diego@biurrun.de>2011-07-12 20:36:50 +0200
commit028216b2c2d81f7fe918163c74b0a59cd327f2f7 (patch)
tree6c447d97fb4d87ce69ec222bc226eef76ac1c1d3 /libavcodec/h264_mvpred.h
parent987041318ff7a5e99682470a017eef06151f00ae (diff)
h264: move decode_mb_skip() from h264.h to h.264_mvpred.h
This resolves a circular dependency between the headers.
Diffstat (limited to 'libavcodec/h264_mvpred.h')
-rw-r--r--libavcodec/h264_mvpred.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/libavcodec/h264_mvpred.h b/libavcodec/h264_mvpred.h
index 1d40c0a2c5..52c032337a 100644
--- a/libavcodec/h264_mvpred.h
+++ b/libavcodec/h264_mvpred.h
@@ -327,4 +327,43 @@ zeromv:
return;
}
+/**
+ * decodes a P_SKIP or B_SKIP macroblock
+ */
+static void av_unused decode_mb_skip(H264Context *h){
+ MpegEncContext * const s = &h->s;
+ const int mb_xy= h->mb_xy;
+ int mb_type=0;
+
+ memset(h->non_zero_count[mb_xy], 0, 48);
+
+ if(MB_FIELD)
+ mb_type|= MB_TYPE_INTERLACED;
+
+ if( h->slice_type_nos == AV_PICTURE_TYPE_B )
+ {
+ // just for fill_caches. pred_direct_motion will set the real mb_type
+ mb_type|= MB_TYPE_L0L1|MB_TYPE_DIRECT2|MB_TYPE_SKIP;
+ if(h->direct_spatial_mv_pred){
+ fill_decode_neighbors(h, mb_type);
+ fill_decode_caches(h, mb_type); //FIXME check what is needed and what not ...
+ }
+ ff_h264_pred_direct_motion(h, &mb_type);
+ mb_type|= MB_TYPE_SKIP;
+ }
+ else
+ {
+ mb_type|= MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P1L0|MB_TYPE_SKIP;
+
+ fill_decode_neighbors(h, mb_type);
+ pred_pskip_motion(h);
+ }
+
+ write_back_motion(h, mb_type);
+ s->current_picture.f.mb_type[mb_xy] = mb_type;
+ s->current_picture.f.qscale_table[mb_xy] = s->qscale;
+ h->slice_table[ mb_xy ]= h->slice_num;
+ h->prev_mb_skipped= 1;
+}
+
#endif /* AVCODEC_H264_MVPRED_H */