This already exists differently in mainline, but this way is more useful
since MPEG-2 has field pictures but not MBAFF.
---
libavcodec/mpegvideo.c | 1 +
libavcodec/mpegvideo.h | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 5f6473a..1f32853 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -958,6 +958,7 @@ alloc:
s->current_picture_ptr= (Picture*)pic;
s->current_picture_ptr->top_field_first= s->top_field_first; //FIXME use only the vars from current_pic
s->current_picture_ptr->interlaced_frame= !s->progressive_frame && !s->progressive_sequence;
+ s->current_picture_ptr->field_picture= s->picture_structure != PICT_FRAME;
}
s->current_picture_ptr->pict_type= s->pict_type;
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 8910e54..891778e 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -120,6 +120,7 @@ typedef struct Picture{
int long_ref; ///< 1->long term reference 0->short term reference
int ref_poc[2][2][16]; ///< h264 POCs of the frames used as reference (FIXME need per slice)
int ref_count[2][2]; ///< number of entries in ref_poc (FIXME need per slice)
+ int field_picture; ///< whether the picture was originally stored as fields
int mb_var_sum; ///< sum of MB variance for current frame
int mc_mb_var_sum; ///< motion compensated MB variance for current frame
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc