summaryrefslogtreecommitdiffstats
path: root/libhb/encx264.c
diff options
context:
space:
mode:
authorsaintdev <[email protected]>2007-06-17 00:51:17 +0000
committersaintdev <[email protected]>2007-06-17 00:51:17 +0000
commitb7552e4d2409d1f2615caf418d4d0ac8d8bff981 (patch)
tree4b2b833a8e06dc16cf38c01182254d43612d8617 /libhb/encx264.c
parent51a0dfdd04c910de55aa09db8a7039ea25999735 (diff)
Switch buf->key to buf->frametype which is a bitmask telling us what type of frame we are dealing with.
This doesn't change any functionality, but I need to be able to distinguish between x264 IDR and I frames for the upcoming matroska muxer. This also has the side effect of making the code a little easier to read and maintain. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@623 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/encx264.c')
-rw-r--r--libhb/encx264.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/libhb/encx264.c b/libhb/encx264.c
index 6bd214051..98ede9704 100644
--- a/libhb/encx264.c
+++ b/libhb/encx264.c
@@ -316,7 +316,7 @@ int encx264Work( hb_work_object_t * w, hb_buffer_t ** buf_in,
buf->size = 0;
buf->start = in->start;
buf->stop = in->stop;
- buf->key = 0;
+ buf->frametype = 0;
int64_t dts_start, dts_stop;
@@ -340,7 +340,7 @@ int encx264Work( hb_work_object_t * w, hb_buffer_t ** buf_in,
{
if( nal[i].i_ref_idc == NAL_PRIORITY_HIGHEST )
{
- buf->key = 1;
+ buf->frametype = HB_FRAME_KEY;
}
buf->size += size;
continue;
@@ -362,26 +362,27 @@ int encx264Work( hb_work_object_t * w, hb_buffer_t ** buf_in,
buf->data[buf->size+3] = ( ( size - 4 ) >> 0 ) & 0xFF;
switch( pic_out.i_type )
{
- /* For IDR (key frames), buf->key = 1,
- and the same for regular I-frames. */
+ /* Decide what type of frame we have. */
case X264_TYPE_IDR:
+ buf->frametype = HB_FRAME_IDR;
+ break;
case X264_TYPE_I:
- buf->key = 1;
+ buf->frametype = HB_FRAME_I;
+ break;
+ case X264_TYPE_P:
+ buf->frametype = HB_FRAME_P;
break;
- /* For B-frames, buf->key = 2 */
case X264_TYPE_B:
- buf->key = 2;
+ buf->frametype = HB_FRAME_B;
break;
/* This is for b-pyramid, which has reference b-frames
- However, it doesn't seem to ever be used...
- They just show up as buf->key == 2 like
- regular b-frames. */
+ However, it doesn't seem to ever be used... */
case X264_TYPE_BREF:
- buf->key = 3;
+ buf->frametype = HB_FRAME_BREF;
break;
- /* For P-frames, buf->key = 0 */
+ /* If it isn't the above, what type of frame is it?? */
default:
- buf->key = 0;
+ buf->frametype = 0;
}