diff options
author | ritsuka <[email protected]> | 2007-10-11 13:10:41 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2007-10-11 13:10:41 +0000 |
commit | 0f0738745170bd3fdd56c0580a164e50b515c12d (patch) | |
tree | 2c5ca988d76a754d1094dcbbc011edd0eebcf28e /libhb | |
parent | 7045d521d48d670473d5858c43e4fb54dee14b1c (diff) |
Fixed a problem when using more than 13 b-frames in x264
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1018 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/encx264.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libhb/encx264.c b/libhb/encx264.c index 7c2d55480..6709716ff 100644 --- a/libhb/encx264.c +++ b/libhb/encx264.c @@ -23,8 +23,7 @@ hb_work_object_t hb_encx264 = encx264Close }; -// 16 is probably overkill but it's also the maximum for h.264 reference frames -#define MAX_INFLIGHT_FRAMES 16 +#define DTS_BUFFER_SIZE 32 struct hb_work_private_s { @@ -33,8 +32,8 @@ struct hb_work_private_s x264_picture_t pic_in; // Internal queue of DTS start/stop values. - int64_t dts_start[MAX_INFLIGHT_FRAMES]; - int64_t dts_stop[MAX_INFLIGHT_FRAMES]; + int64_t dts_start[DTS_BUFFER_SIZE]; + int64_t dts_stop[DTS_BUFFER_SIZE]; int64_t dts_write_index; int64_t dts_read_index; @@ -304,8 +303,8 @@ int encx264Work( hb_work_object_t * w, hb_buffer_t ** buf_in, pv->pic_in.i_qpplus1 = 0; // Remember current PTS value, use as DTS later - pv->dts_start[pv->dts_write_index & (MAX_INFLIGHT_FRAMES-1)] = in->start; - pv->dts_stop[pv->dts_write_index & (MAX_INFLIGHT_FRAMES-1)] = in->stop; + pv->dts_start[pv->dts_write_index & (DTS_BUFFER_SIZE-1)] = in->start; + pv->dts_stop[pv->dts_write_index & (DTS_BUFFER_SIZE-1)] = in->stop; pv->dts_write_index++; /* Feed the input DTS to x264 so it can figure out proper output PTS */ @@ -345,8 +344,8 @@ int encx264Work( hb_work_object_t * w, hb_buffer_t ** buf_in, int64_t dts_start, dts_stop; /* Get next DTS value to use */ - dts_start = pv->dts_start[pv->dts_read_index & (MAX_INFLIGHT_FRAMES-1)]; - dts_stop = pv->dts_stop[pv->dts_read_index & (MAX_INFLIGHT_FRAMES-1)]; + dts_start = pv->dts_start[pv->dts_read_index & (DTS_BUFFER_SIZE-1)]; + dts_stop = pv->dts_stop[pv->dts_read_index & (DTS_BUFFER_SIZE-1)]; pv->dts_read_index++; for( i = 0; i < i_nal; i++ ) |