@@ -362,9 +362,7 @@ FilteredResizeH::FilteredResizeH( PClip _child, double subrange_left, double sub
362362{
363363 int filter_sz;
364364
365- src_width = vi.width ;
366365 src_height = vi.height ;
367- dst_width = target_width;
368366 dst_height = vi.height ;
369367
370368 pixelsize = (uint8_t )vi.ComponentSize (); // AVS16
@@ -384,6 +382,9 @@ FilteredResizeH::FilteredResizeH( PClip _child, double subrange_left, double sub
384382 Enable_AVX2 = avsp && ((env->GetCPUFlags () & CPUF_AVX2)!=0 );
385383#endif
386384
385+ src_width = vi.IsPlanar () ? vi.width : vi.BytesFromPixels (vi.width )/pixelsize;
386+ dst_width = vi.IsPlanar () ? target_width : vi.BytesFromPixels (target_width)/pixelsize;
387+
387388 if ((range_mode!=1 ) && (range_mode!=4 ))
388389 {
389390 if (vi.IsYUV ())
@@ -432,9 +433,6 @@ FilteredResizeH::FilteredResizeH( PClip _child, double subrange_left, double sub
432433 const int shift_w = (!grey && vi.IsPlanar () && !isRGBPfamily) ? vi.GetPlaneWidthSubsampling (PLANAR_U) : 0 ;
433434 const int shift_h = (!grey && vi.IsPlanar () && !isRGBPfamily) ? vi.GetPlaneHeightSubsampling (PLANAR_U) : 0 ;
434435
435- const int src_width = vi.IsPlanar () ? vi.width : vi.BytesFromPixels (vi.width )/pixelsize;
436- const int dst_width = vi.IsPlanar () ? target_width : vi.BytesFromPixels (target_width)/pixelsize;
437-
438436 if (vi.height <32 ) threads_number=1 ;
439437 else threads_number=threads;
440438
@@ -2388,7 +2386,7 @@ PClip FilteredResizeMT::CreateResize(PClip clip, int target_width, int target_he
23882386 {
23892387 if (!desample)
23902388 {
2391- AVSValue sargs[6 ] = {result,int (subrange_left),0 ,int (subrange_width),vi. height ,true };
2389+ AVSValue sargs[6 ] = {result,int (subrange_left),0 ,int (subrange_width),target_height ,true };
23922390 result=env->Invoke (" Crop" ,AVSValue (sargs,6 )).AsClip ();
23932391 }
23942392 }
@@ -2701,7 +2699,7 @@ PClip FilteredResizeMT::CreateResize(PClip clip, int target_width, int target_he
27012699 {
27022700 if (!desample)
27032701 {
2704- AVSValue sargs[6 ] = {result,0 ,int (subrange_top),vi. width ,int (subrange_height),true };
2702+ AVSValue sargs[6 ] = {result,0 ,int (subrange_top),target_width ,int (subrange_height),true };
27052703 result=env->Invoke (" Crop" ,AVSValue (sargs,6 )).AsClip ();
27062704 }
27072705 }
@@ -2745,7 +2743,7 @@ PClip FilteredResizeMT::CreateResize(PClip clip, int target_width, int target_he
27452743 {
27462744 if (!desample)
27472745 {
2748- AVSValue sargs[6 ] = {result,int (subrange_left),0 ,int (subrange_width),vi. height ,true };
2746+ AVSValue sargs[6 ] = {result,int (subrange_left),0 ,int (subrange_width),target_height ,true };
27492747 result=env->Invoke (" Crop" ,AVSValue (sargs,6 )).AsClip ();
27502748 }
27512749 }
@@ -2786,7 +2784,7 @@ PClip FilteredResizeMT::CreateResize(PClip clip, int target_width, int target_he
27862784 {
27872785 if (!desample)
27882786 {
2789- AVSValue sargs[6 ] = {result,0 ,int (subrange_top),vi. width ,int (subrange_height),true };
2787+ AVSValue sargs[6 ] = {result,0 ,int (subrange_top),target_width ,int (subrange_height),true };
27902788 result=env->Invoke (" Crop" ,AVSValue (sargs,6 )).AsClip ();
27912789 }
27922790 }
0 commit comments