summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjbrjake <[email protected]>2007-08-24 19:21:30 +0000
committerjbrjake <[email protected]>2007-08-24 19:21:30 +0000
commit2375570c0b0491e126d6c227ac17f7a4ab58be25 (patch)
tree477b6e649fd626f4295dfc44b207bf52eeaa0d1d
parent6f0f5935ee1dbbc2f16209a6b503c6609fb9d62e (diff)
Doubles the number of frames checked for cadence changes, streamlines their storage with a for loop, gets rid of inaccurate "Interlaced->Progressive" messages during scanning, and, during encoding, displays those messages with time stamps in seconds instead of using the PTS units.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@862 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/decmpeg2.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libhb/decmpeg2.c b/libhb/decmpeg2.c
index 77c6c0b98..fad850171 100644
--- a/libhb/decmpeg2.c
+++ b/libhb/decmpeg2.c
@@ -25,7 +25,7 @@
#define BTB_PROG 64
#define TB_PROG 128
#define TBT_PROG 256
-int cadence[6];
+int cadence[12];
int flag = 0;
/**********************************************************************
@@ -213,11 +213,11 @@ int hb_libmpeg2_decode( hb_libmpeg2_t * m, hb_buffer_t * buf_es,
hb_log("fields: %d", m->info->display_picture->nb_fields);
*/
/* Rotate the cadence tracking. */
- cadence[5] = cadence[4];
- cadence[4] = cadence[3];
- cadence[3] = cadence[2];
- cadence[2] = cadence[1];
- cadence[1] = cadence[0];
+ int i = 0;
+ for(i=11; i > 0; i--)
+ {
+ cadence[i] = cadence[i-1];
+ }
if ( !(flag & PROGRESSIVE) && !(flag & TOP_FIRST) )
{
@@ -273,10 +273,10 @@ int hb_libmpeg2_decode( hb_libmpeg2_t * m, hb_buffer_t * buf_es,
cadence[0] = TBT_PROG;
}
- if ( (cadence[2] <= TB) && (cadence[1] <= TB) && (cadence[0] > TB) && (cadence[0]) && (cadence[1]) )
- hb_log("PTS %lld: Interlaced -> Progressive", buf->start);
- if ( (cadence[2] > TB) && (cadence[1] <= TB) && (cadence[0] <= TB) && (cadence[0]) && (cadence[1]) )
- hb_log("PTS %lld: Progressive -> Interlaced", buf->start);
+ if ( (cadence[2] <= TB) && (cadence[1] <= TB) && (cadence[0] > TB) && (cadence[11]) )
+ hb_log("%fs: Interlaced -> Progressive", (float)buf->start / 90000);
+ if ( (cadence[2] > TB) && (cadence[1] <= TB) && (cadence[0] <= TB) && (cadence[11]) )
+ hb_log("%fs: Progressive -> Interlaced", (float)buf->start / 90000);
/* Store picture flags for later use by filters */
buf->flags = m->info->display_picture->flags;