summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorRodeo <[email protected]>2013-12-15 20:15:56 +0000
committerRodeo <[email protected]>2013-12-15 20:15:56 +0000
commitc193ab25bef0c3e1fa83603baa374cb2d65466ae (patch)
treecebb4e20b0d483cc270c2b791a76499903fece4e /libhb
parentd1f37e84a62271ba4f3b95a47281bb4c72854a94 (diff)
QSV: check whether b_pyramid is respected in the non-workaround path too.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5931 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/enc_qsv.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/libhb/enc_qsv.c b/libhb/enc_qsv.c
index 78f7aab87..3e54315b0 100644
--- a/libhb/enc_qsv.c
+++ b/libhb/enc_qsv.c
@@ -1437,35 +1437,36 @@ int encqsvWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
buf->s.duration = duration;
if (pv->bfrm_delay)
{
+ if ((pv->frames_out == 0) &&
+ (hb_qsv_info->capabilities & HB_QSV_CAP_MSDK_API_1_6) &&
+ (hb_qsv_info->capabilities & HB_QSV_CAP_H264_BPYRAMID))
+ {
+ // with B-pyramid, the delay may be more than 1 frame,
+ // so compute the actual delay based on the initial DTS
+ // provided by MSDK; also, account for rounding errors
+ // (e.g. 24000/1001 fps @ 90kHz -> 3753.75 ticks/frame)
+ pv->bfrm_delay = HB_QSV_CLIP3(1, BFRM_DELAY_MAX,
+ ((task->bs->TimeStamp -
+ task->bs->DecodeTimeStamp +
+ (duration / 2)) / duration));
+ // check whether b_pyramid is respected, log if needed
+ if ((pv->param.gop.b_pyramid != 0 && pv->bfrm_delay <= 1) ||
+ (pv->param.gop.b_pyramid == 0 && pv->bfrm_delay >= 2))
+ {
+ hb_log( "encqsvWork: b_pyramid %d not respected (delay: %d)",
+ pv->param.gop.b_pyramid, pv->bfrm_delay);
+ }
+ }
+
if (!pv->bfrm_workaround)
{
buf->s.renderOffset = task->bs->DecodeTimeStamp;
}
else
{
- // MSDK API < 1.6 or VFR, so generate our own DTS
- if ((pv->frames_out == 0) &&
- (hb_qsv_info->capabilities & HB_QSV_CAP_MSDK_API_1_6) &&
- (hb_qsv_info->capabilities & HB_QSV_CAP_H264_BPYRAMID))
- {
- // with B-pyramid, the delay may be more than 1 frame,
- // so compute the actual delay based on the initial DTS
- // provided by MSDK; also, account for rounding errors
- // (e.g. 24000/1001 fps @ 90kHz -> 3753.75 ticks/frame)
- pv->bfrm_delay = ((task->bs->TimeStamp -
- task->bs->DecodeTimeStamp +
- (duration / 2)) / duration);
- pv->bfrm_delay = FFMAX(pv->bfrm_delay, 1);
- pv->bfrm_delay = FFMIN(pv->bfrm_delay, BFRM_DELAY_MAX);
- // check whether b_pyramid is respected, log if needed
- if ((pv->param.gop.b_pyramid != 0 && pv->bfrm_delay <= 1) ||
- (pv->param.gop.b_pyramid == 0 && pv->bfrm_delay >= 2))
- {
- hb_log("encqsvWork: b_pyramid %d not respected (delay: %d)",
- pv->param.gop.b_pyramid, pv->bfrm_delay);
- }
- }
/*
+ * MSDK API < 1.6 or VFR
+ *
* Generate VFR-compatible output DTS based on input PTS.
*
* Depends on the B-frame delay: