From: handbrake Date: Wed, 1 May 2013 17:49:39 +0000 (+0000) Subject: QSV: Merging trunk to qsv branch. RB 492 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12ac31061f35e3dd4c0d732f1cf55aa72fd81244;p=handbrake QSV: Merging trunk to qsv branch. RB 492 git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/qsv@5434 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/contrib/libbluray/A01-filter-dup.patch b/contrib/libbluray/A01-filter-dup.patch new file mode 100644 index 000000000..608f8dd1b --- /dev/null +++ b/contrib/libbluray/A01-filter-dup.patch @@ -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 + #include + ++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; + } diff --git a/libhb/sync.c b/libhb/sync.c index 3e2bbb703..3771a8e8e 100644 --- a/libhb/sync.c +++ b/libhb/sync.c @@ -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; diff --git a/libhb/work.c b/libhb/work.c index 4ff79a788..d05b2822d 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -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 ); ) { diff --git a/test/test.c b/test/test.c index 0a0e1e558..fa6fe020f 100644 --- a/test/test.c +++ b/test/test.c @@ -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 Select chapters (e.g. \"1-3\" for chapters\n" " 1 to 3, or \"3\" for chapter 3 only,\n" " default: all chapters)\n" - " --angle Select the DVD angle\n" - " --previews <#:B> Select how many preview images are generated (max 30),\n" + " --angle 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 Set output file name\n" " -f, --format 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 Set video quality\n" " -b, --vb 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 Set picture width\n" + " -w, --width Set picture width\n" " -l, --height Set picture height\n" - " --crop 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 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" " or omitted (default settings)\n" " or\n" " (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" - " (default 1:1:4:4:0:0:-1)\n" + " (default 1:1:4:4:0:0:-1)\n" " -8, --denoise Denoise video with hqdn3d filter\n" " or omitted (default settings)\n" " or\n" @@ -3376,14 +3382,14 @@ static void ShowHelp() " subtitle track is used instead.\n" " --srt-file SubRip SRT filename(s), separated by commas.\n" " --srt-codeset Character codeset(s) that the SRT file(s) are\n" - " encoded in, separted by commas.\n" + " 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" - " 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" + " separated by commas. If not specified, zero is assumed.\n" " Offsets may be negative.\n" " --srt-lang 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" " to be displayed upon playback. Setting no default\n" diff --git a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs index ad76a56b2..ad5698b1b 100644 --- a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs @@ -228,6 +228,7 @@ namespace HandBrakeWPF.ViewModels /// private void encodeService_EncodeStarted(object sender, EventArgs e) { + this.encodeLogIndex = -1; // Reset the log index. this.SelectedTab = 0; }