]> granicus.if.org Git - handbrake/commitdiff
QSV: alternate workaround for B-pyramid + keyframe insertion issue.
authorRodeo <tdskywalker@gmail.com>
Tue, 4 Mar 2014 00:11:00 +0000 (00:11 +0000)
committerRodeo <tdskywalker@gmail.com>
Tue, 4 Mar 2014 00:11:00 +0000 (00:11 +0000)
The original workaround (SVN 6016) got rid of the invalid timestamps,
but did nothing to prevent visual artifacts. Since it doesn't look
like I'll be fixing the underlying cause right away, this will avoid
broken output for our users in the meantime.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6098 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/enc_qsv.c

index c3129b74977aff8d969c3450c982868f0b42222e..86f786bdbc02d00a4681ed866d04043a98c7b8db 100644 (file)
@@ -794,6 +794,16 @@ int encqsvInit(hb_work_object_t *w, hb_job_t *job)
         {
             gop_ref_dist *= 2;
         }
+        /*
+         * XXX: B-pyramid + forced keyframes will cause visual artifacts,
+         *      force-disable B-pyramid until we insert keyframes properly
+         */
+        if (pv->param.gop.b_pyramid && job->chapter_markers)
+        {
+            pv->param.gop.b_pyramid = 0;
+            hb_log("encqsvInit: chapter markers enabled, disabling B-pyramid "
+                   "to work around a bug in our keyframe insertion code");
+        }
         if ((pv->param.gop.b_pyramid) &&
             (pv->param.videoParam->mfx.GopPicSize == 0 ||
              pv->param.videoParam->mfx.GopPicSize > gop_ref_dist))
@@ -1556,16 +1566,6 @@ int encqsvWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
                                                   ((task->bs->TimeStamp -
                                                     task->bs->DecodeTimeStamp +
                                                     (duration / 2)) / duration));
-
-                    // When forcing an IDR for a chapter right after another IDR
-                    // selected by MSDK, we may end up with one more consecutive
-                    // B-reference frame than the original delay accounts for;
-                    // work around it by incrementing the delay in this case
-                    if (pv->bfrm_workaround && job->chapter_markers &&
-                        pv->bfrm_delay > 1)
-                    {
-                        pv->bfrm_delay++;
-                    }
                 }
 
                 if (!pv->bfrm_workaround)