]> granicus.if.org Git - handbrake/commitdiff
QSV: Merging trunk to qsv branch. RB 492
authorhandbrake <no-reply@handbrake.fr>
Wed, 1 May 2013 17:49:39 +0000 (17:49 +0000)
committerhandbrake <no-reply@handbrake.fr>
Wed, 1 May 2013 17:49:39 +0000 (17:49 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/qsv@5434 b64f7644-9d1e-0410-96f1-a4d463321fa5

contrib/libbluray/A01-filter-dup.patch [new file with mode: 0644]
libhb/sync.c
libhb/work.c
test/test.c
win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs

diff --git a/contrib/libbluray/A01-filter-dup.patch b/contrib/libbluray/A01-filter-dup.patch
new file mode 100644 (file)
index 0000000..608f8dd
--- /dev/null
@@ -0,0 +1,80 @@
+diff --git a/src/libbluray/bdnav/navigation.c b/src/libbluray/bdnav/navigation.c
+index c8dc307..26d0000 100644
+--- a/src/libbluray/bdnav/navigation.c
++++ b/src/libbluray/bdnav/navigation.c
+@@ -32,9 +32,25 @@
+ #include <stdlib.h>
+ #include <string.h>
++static int _stream_cmp(MPLS_STREAM *a, MPLS_STREAM *b)
++{
++    if (a->stream_type == b->stream_type &&
++        a->coding_type == b->coding_type &&
++        a->pid         == b->pid         &&
++        a->subpath_id  == b->subpath_id  &&
++        a->subclip_id  == b->subclip_id  &&
++        a->format      == b->format      &&
++        a->rate        == b->rate        &&
++        a->char_code   == b->char_code   &&
++        memcmp(a->lang, b->lang, 4) == 0) {
++        return 1;
++    }
++    return 0;
++}
++
+ static int _filter_dup(MPLS_PL *pl_list[], unsigned count, MPLS_PL *pl)
+ {
+-    unsigned ii, jj;
++    unsigned ii, jj, kk;
+     for (ii = 0; ii < count; ii++) {
+         if (pl->list_count != pl_list[ii]->list_count) {
+@@ -54,7 +70,48 @@ static int _filter_dup(MPLS_PL *pl_list[], unsigned count, MPLS_PL *pl)
+                 pi1->out_time != pi2->out_time) {
+                 break;
+             }
++            if (pi1->stn.num_video           != pi2->stn.num_video           ||
++                pi1->stn.num_audio           != pi2->stn.num_audio           ||
++                pi1->stn.num_pg              != pi2->stn.num_pg              || 
++                pi1->stn.num_ig              != pi2->stn.num_ig              ||
++                pi1->stn.num_secondary_audio != pi2->stn.num_secondary_audio ||
++                pi1->stn.num_secondary_video != pi2->stn.num_secondary_video) {
++                break;
++            }
++            for (kk = 0; kk < pi1->stn.num_video; kk++) {
++                if (!_stream_cmp(&pi1->stn.video[kk], &pi2->stn.video[kk])) {
++                    goto next;
++                }
++            }
++            for (kk = 0; kk < pi1->stn.num_audio; kk++) {
++                if (!_stream_cmp(&pi1->stn.audio[kk], &pi2->stn.audio[kk])) {
++                    goto next;
++                }
++            }
++            for (kk = 0; kk < pi1->stn.num_pg; kk++) {
++                if (!_stream_cmp(&pi1->stn.pg[kk], &pi2->stn.pg[kk])) {
++                    goto next;
++                }
++            }
++            for (kk = 0; kk < pi1->stn.num_ig; kk++) {
++                if (!_stream_cmp(&pi1->stn.ig[kk], &pi2->stn.ig[kk])) {
++                    goto next;
++                }
++            }
++            for (kk = 0; kk < pi1->stn.num_secondary_audio; kk++) {
++                if (!_stream_cmp(&pi1->stn.secondary_audio[kk],
++                                 &pi2->stn.secondary_audio[kk])) {
++                    goto next;
++                }
++            }
++            for (kk = 0; kk < pi1->stn.num_secondary_video; kk++) {
++                if (!_stream_cmp(&pi1->stn.secondary_video[kk],
++                                 &pi2->stn.secondary_video[kk])) {
++                    goto next;
++                }
++            }
+         }
++next:
+         if (jj != pl->list_count) {
+             continue;
+         }
index 3e2bbb70377ad4c83816917e56746f0ff882f7aa..3771a8e8e80e2a2ef7935da009d5c3e506b6e71e 100644 (file)
@@ -368,6 +368,7 @@ int syncVideoWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
              * Feed it downstream & signal that we're done. 
              */
             *buf_out = next;
+            sync->cur = NULL;
 
             pv->common->start_found = 1;
             pv->common->first_pts[0] = INT64_MAX - 1;
index 4ff79a78841f0b6461c4a8f6c5192e640e3ed3f5..d05b2822d40c8f4bb573bd2c62a1f4a9c48d1b43 100644 (file)
@@ -708,7 +708,7 @@ static void do_job( hb_job_t * job )
 
         int is_vpp_interlace = 0;
         int is_actual_crop_resize = 0;
-        if( job->vcodec == HB_VCODEC_QSV_H264 && title->video_codec_param == AV_CODEC_ID_H264)
+        if( job->vcodec == HB_VCODEC_QSV_H264 && title->video_codec_param == AV_CODEC_ID_H264){
             for( i = 0; i < hb_list_count( job->list_filter ); i++){
                 hb_filter_object_t * filter = hb_list_item( job->list_filter, i );
                 if(filter->id == HB_FILTER_DEINTERLACE){
@@ -726,12 +726,15 @@ static void do_job( hb_job_t * job )
                     if( job->width  != job->title->width ||
                         job->height != job->title->height ||
                         job->crop[0] != 0 ||  job->crop[1] != 0 ||
-                        job->crop[2] != 0 ||  job->crop[3] != 0 || (job->cfr == 1 && job->vrate > 0)){
+                        job->crop[2] != 0 ||  job->crop[3] != 0 /*|| (job->cfr == 1 && job->vrate > 0)*/){
                         is_actual_crop_resize = 1;
                     }
                 }
             }
-         int is_additional_vpp_function = is_actual_crop_resize;
+            // as per MSDK/QSV support
+            init.cfr = 1;
+        }
+        int is_additional_vpp_function = is_actual_crop_resize;
 
         for( i = 0; i < hb_list_count( job->list_filter ); )
         {
index 0a0e1e55898a7f3e3640dc714ae0230c2c94963f..fa6fe020fbba76278e6a5c54925ed28b89d31ddc 100644 (file)
@@ -1793,7 +1793,6 @@ static int HandleEvents( hb_handle_t * h )
 
             if(vcodec == HB_VCODEC_QSV_H264)
             {
-
                 char * filter_str;
                 filter_str = hb_strdup_printf("%d:%d:%d:%d:%d:%d_dei:%s",
                         job->width, job->height,
@@ -1830,6 +1829,16 @@ static int HandleEvents( hb_handle_t * h )
             hb_add_filter( job, filter, filter_str );
             free( filter_str );
 
+            if(vcodec == HB_VCODEC_QSV_H264)
+            {
+                // as per MSDK/QSV support
+                job->cfr = cfr = 1;
+
+                // to be extended
+                job->vrate = title->rate;
+                job->vrate_base = title->rate_base;
+            }
+
             if( vquality >= 0.0 )
             {
                 job->vquality = vquality;
@@ -2959,7 +2968,6 @@ static void ShowHelp()
     "                            double quotation marks\n"
     "    -z, --preset-list       See a list of available built-in presets\n"
     "        --no-dvdnav         Do not use dvdnav for reading DVDs\n"
-    "                            (experimental, enabled by default for testing)\n"
     "\n"
 
     "### Source Options-----------------------------------------------------------\n\n"
@@ -2973,8 +2981,8 @@ static void ShowHelp()
     "    -c, --chapters <string> Select chapters (e.g. \"1-3\" for chapters\n"
     "                            1 to 3, or \"3\" for chapter 3 only,\n"
     "                            default: all chapters)\n"
-    "        --angle <number>    Select the DVD angle\n"
-    "        --previews <#:B>    Select how many preview images are generated (max 30),\n"
+    "        --angle <number>    Select the video angle (DVD or Blu-ray only)\n"
+    "        --previews <#:B>    Select how many preview images are generated,\n"
     "                            and whether or not they're stored to disk (0 or 1).\n"
     "                            (default: 10:0)\n"
     "    --start-at-preview <#>  Start encoding at a given preview.\n"
@@ -2988,10 +2996,10 @@ static void ShowHelp()
     "    -o, --output <string>   Set output file name\n"
     "    -f, --format <string>   Set output format (mp4/mkv, default:\n"
     "                            autodetected from file name)\n"
-    "    -m, --markers           Add chapter markers (mp4 and mkv output formats only)\n"
-    "    -4, --large-file        Use 64-bit mp4 files that can hold more than\n"
-    "                            4 GB. Note: Breaks iPod, PS3 compatibility.\n"""
-    "    -O, --optimize          Optimize mp4 files for HTTP streaming\n"
+    "    -m, --markers           Add chapter markers\n"
+    "    -4, --large-file        Create 64-bit mp4 files that can hold more than 4 GB\n"
+    "                            of data. Note: breaks pre-iOS iPod compatibility.\n"
+    "    -O, --optimize          Optimize mp4 files for HTTP streaming (\"fast start\")\n"
     "    -I, --ipod-atom         Mark mp4 files so 5.5G iPods will accept them\n"
     "\n"
 
@@ -3114,10 +3122,8 @@ static void ShowHelp()
     "    -q, --quality <number>  Set video quality\n"
     "    -b, --vb <kb/s>         Set video bitrate (default: 1000)\n"
     "    -2, --two-pass          Use two-pass mode\n"
-    "    -T, --turbo             When using 2-pass use the turbo options\n"
-    "                            on the first pass to improve speed\n"
-    "                            (only works with x264, affects PSNR by about 0.05dB,\n"
-    "                            and increases first pass speed two to four times)\n"
+    "    -T, --turbo             When using 2-pass use \"turbo\" options on the\n"
+    "                            1st pass to improve speed (only works with x264)\n"
     "    -r, --rate              Set video framerate (" );
     for( i = 0; i < hb_video_rates_count; i++ )
     {
@@ -3269,14 +3275,14 @@ static void ShowHelp()
     "\n"
 
     "### Picture Settings---------------------------------------------------------\n\n"
-    "    -w, --width <number>    Set picture width\n"
+    "    -w, --width  <number>   Set picture width\n"
     "    -l, --height <number>   Set picture height\n"
-    "        --crop <T:B:L:R>    Set cropping values (default: autocrop)\n"
-    "        --loose-crop        Always crop to a multiple of the modulus\n"
-    "          <#>               Specifies the maximum number of extra pixels\n"
+    "        --crop  <T:B:L:R>   Set cropping values (default: autocrop)\n"
+    "        --loose-crop  <#>   Always crop to a multiple of the modulus\n"
+    "                            Specifies the maximum number of extra pixels\n"
     "                            which may be cropped (default: 15)\n"
-    "    -Y, --maxHeight <#>     Set maximum height\n"
-    "    -X, --maxWidth <#>      Set maximum width\n"
+    "    -Y, --maxHeight   <#>   Set maximum height\n"
+    "    -X, --maxWidth    <#>   Set maximum width\n"
     "    --strict-anamorphic     Store pixel aspect ratio in video stream\n"
     "    --loose-anamorphic      Store pixel aspect ratio with specified width\n"
     "    --custom-anamorphic     Store pixel aspect ratio in video stream and\n"
@@ -3301,7 +3307,7 @@ static void ShowHelp()
 
     "### Filters---------------------------------------------------------\n\n"
 
-     "    -d, --deinterlace       Deinterlace video with yadif/mcdeint filter\n"
+     "    -d, --deinterlace       Deinterlace video with Libav, yadif or mcdeint\n"
      "          <fast/slow/slower/bob> or omitted (default settings)\n"
      "           or\n"
      "          <YM:FD:MM:QP>     (default 0:-1:-1:1)\n"
@@ -3320,7 +3326,7 @@ static void ShowHelp()
      "                            Note: this filter drops duplicate frames to\n"
      "                            restore the pre-telecine framerate, unless you\n"
      "                            specify a constant framerate (--rate 29.97)\n"
-     "          <L:R:T:B:SB:MP:FD>   (default 1:1:4:4:0:0:-1)\n"
+     "          <L:R:T:B:SB:MP:FD> (default 1:1:4:4:0:0:-1)\n"
      "    -8, --denoise           Denoise video with hqdn3d filter\n"
      "          <weak/medium/strong> or omitted (default settings)\n"
      "           or\n"
@@ -3376,14 +3382,14 @@ static void ShowHelp()
     "                            subtitle track is used instead.\n"
     "        --srt-file <string> SubRip SRT filename(s), separated by commas.\n"
     "        --srt-codeset       Character codeset(s) that the SRT file(s) are\n"
-    "          <string>          encoded in, separted by commas.\n"
+    "          <string>          encoded in, separated by commas.\n"
     "                            Use 'iconv -l' for a list of valid\n"
-    "                            codesets. If not specified latin1 is assumed\n"
-    "        --srt-offset        Offset in milli-seconds to apply to the SRT file(s)\n"
-    "          <string>          separted by commas. If not specified zero is assumed.\n"
+    "                            codesets. If not specified, 'latin1' is assumed\n"
+    "        --srt-offset        Offset (in milliseconds) to apply to the SRT file(s),\n"
+    "          <string>          separated by commas. If not specified, zero is assumed.\n"
     "                            Offsets may be negative.\n"
     "        --srt-lang <string> Language as an iso639-2 code fra, eng, spa et cetera)\n"
-    "                            for the SRT file(s) separated by commas. If not specified\n"
+    "                            for the SRT file(s), separated by commas. If not specified,\n"
     "                            then 'und' is used.\n"
     "        --srt-default       Flag the selected srt as the default subtitle\n"
     "          <number>          to be displayed upon playback.  Setting no default\n"
index ad76a56b273440b12cd415f1ad8e649f9ab81581..ad5698b1b94a92275f0cdbabb1e9fd65d19be5e3 100644 (file)
@@ -228,6 +228,7 @@ namespace HandBrakeWPF.ViewModels
         /// </param>\r
         private void encodeService_EncodeStarted(object sender, EventArgs e)\r
         {\r
+            this.encodeLogIndex = -1; // Reset the log index.\r
             this.SelectedTab = 0;\r
         }\r
 \r