summaryrefslogtreecommitdiffstats
path: root/libmpeg2/header.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpeg2/header.c')
-rw-r--r--libmpeg2/header.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/libmpeg2/header.c b/libmpeg2/header.c
index ab5e12923c..331fcf1767 100644
--- a/libmpeg2/header.c
+++ b/libmpeg2/header.c
@@ -203,6 +203,7 @@ static int header_process_picture_coding_extension (picture_t * picture, uint8_t
picture->repeat_first_field = (buffer[3] >> 1) & 1;
picture->progressive_frame = buffer[4] >> 7;
+#if 0
// repeat_first implementation by A'rpi/ESP-team, based on libmpeg3:
if(picture->repeat_count>=100) picture->repeat_count=0;
if(picture->repeat_first_field){
@@ -216,7 +217,30 @@ static int header_process_picture_coding_extension (picture_t * picture, uint8_t
picture->repeat_count+=50;
}
}
-
+ //repeat_count=display_time-100%
+#else
+ // repeat_first implemantation by iive, based on A'rpi/ESP-team and libmpeg3
+ if( picture->progressive_sequence == 1 )
+ {
+ if( picture->repeat_first_field == 0 ) picture->display_time=100;//normal
+ else
+ {
+ if( picture->top_field_first == 0 ) picture->display_time=200;//2 frames
+ else picture->display_time=300;//3 frames
+ }
+ }else
+ {
+ if( picture->progressive_frame == 0 )
+ picture->display_time=100;//2fields, interlaced in time
+ else
+ {
+ if( picture->top_field_first == 0 ) picture->display_time=100;//reconstruct 2 fields
+ else picture->display_time = 150;//reconstruct 3 fields
+ }
+
+ if( picture->picture_structure!=3 ) picture->display_time/=2;//we calc on every field
+ }
+#endif
return 0;
}