• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

githubのコードからのfolk


Commit MetaInfo

修订版bd48bff38ee978ac17f47f9302c90ffa9d7cefe7 (tree)
时间2010-12-18 01:31:54
作者jstebbins <jstebbins@b64f...>
Commiterjstebbins

Log Message

prevent crash with strict ana and non-mod-2 dimensions.
and make par computation in loose ana a little more accurate.

git-svn-id: svn://localhost/HandBrake/trunk@3710 b64f7644-9d1e-0410-96f1-a4d463321fa5

更改概述

差异

--- a/libhb/hb.c
+++ b/libhb/hb.c
@@ -963,10 +963,12 @@ void hb_set_anamorphic_size( hb_job_t * job,
963963 {
964964 case 1:
965965 /* Strict anamorphic */
966- *output_width = cropped_width;
967- *output_height = cropped_height;
968- *output_par_width = title->pixel_aspect_width;
969- *output_par_height = title->pixel_aspect_height;
966+ *output_width = MULTIPLE_MOD( cropped_width, 2 );
967+ *output_height = MULTIPLE_MOD( cropped_height, 2 );
968+ // adjust the source PAR for new width/height
969+ // new PAR = source PAR * ( old width / new_width ) * ( new_height / old_height )
970+ pixel_aspect_width = title->pixel_aspect_width * cropped_width * (*output_height);
971+ pixel_aspect_height = title->pixel_aspect_height * (*output_width) * cropped_height;
970972 break;
971973
972974 case 2:
@@ -1007,8 +1009,8 @@ void hb_set_anamorphic_size( hb_job_t * job,
10071009 /* The film AR is the source's display width / cropped source height.
10081010 The output display width is the output height * film AR.
10091011 The output PAR is the output display width / output storage width. */
1010- pixel_aspect_width = height * source_display_width / cropped_height;
1011- pixel_aspect_height = width;
1012+ pixel_aspect_width = height * cropped_width * pixel_aspect_width;
1013+ pixel_aspect_height = width * cropped_height * pixel_aspect_height;
10121014
10131015 /* Pass the results back to the caller */
10141016 *output_width = width;
--- a/libhb/work.c
+++ b/libhb/work.c
@@ -449,6 +449,7 @@ static void do_job( hb_job_t * job, int cpu_count )
449449 job->anamorphic.par_width >>= 1;
450450 job->anamorphic.par_height >>= 1;
451451 }
452+ hb_reduce( &job->anamorphic.par_width, &job->anamorphic.par_height, job->anamorphic.par_width, job->anamorphic.par_height );
452453 }
453454 }
454455