@@ -3772,4 +3772,122 @@ HwFilterParameter *PolicyOclFcHandler::CreateHwFilterParam(VP_EXECUTE_CAPS vpExe
3772
3772
return nullptr ;
3773
3773
}
3774
3774
}
3775
+
3776
+ MOS_STATUS PolicyOclFcHandler::LayerSelectForProcess (std::vector<int > &layerIndexes, SwFilterPipe &featurePipe, VP_EXECUTE_CAPS &caps)
3777
+ {
3778
+ layerIndexes.clear ();
3779
+ int32_t resLayerCount = VP_COMP_MAX_LAYERS;
3780
+
3781
+ VP_PUBLIC_CHK_STATUS_RETURN (RemoveTransparentLayers (featurePipe));
3782
+
3783
+ bool skip = false ;
3784
+ VP_SURFACE *output = featurePipe.GetSurface (false , 0 );
3785
+ bool bilinearInUseFor3DSampler = false ;
3786
+ VP_PUBLIC_CHK_NULL_RETURN (output);
3787
+
3788
+ for (uint32_t i = 0 ; i < featurePipe.GetSurfaceCount (true ); ++i)
3789
+ {
3790
+ VPHAL_SCALING_MODE scalingMode = VPHAL_SCALING_NEAREST;
3791
+ VP_SURFACE *input = featurePipe.GetSurface (true , i);
3792
+ SwFilterSubPipe *subpipe = featurePipe.GetSwFilterSubPipe (true , i);
3793
+ VP_PUBLIC_CHK_NULL_RETURN (input);
3794
+ VP_PUBLIC_CHK_NULL_RETURN (subpipe);
3795
+ VP_PUBLIC_CHK_STATUS_RETURN (AddInputLayerForProcess (skip, layerIndexes, scalingMode, i, *input, *subpipe, *output, caps, resLayerCount));
3796
+ if (skip)
3797
+ {
3798
+ break ;
3799
+ }
3800
+
3801
+ if (VPHAL_SCALING_BILINEAR == scalingMode)
3802
+ {
3803
+ bilinearInUseFor3DSampler = true ;
3804
+ }
3805
+ }
3806
+
3807
+ // Use bilinear for layers, which is using nearest.
3808
+ if (s_forceNearestToBilinearIfBilinearExists && bilinearInUseFor3DSampler)
3809
+ {
3810
+ for (uint32_t i = 0 ; i < layerIndexes.size (); ++i)
3811
+ {
3812
+ SwFilterSubPipe *subpipe = featurePipe.GetSwFilterSubPipe (true , layerIndexes[i]);
3813
+ VP_PUBLIC_CHK_NULL_RETURN (subpipe);
3814
+ SwFilterScaling *scaling = dynamic_cast <SwFilterScaling *>(subpipe->GetSwFilter (FeatureType::FeatureTypeScaling));
3815
+ if (scaling && VPHAL_SCALING_NEAREST == scaling->GetSwFilterParams ().scalingMode )
3816
+ {
3817
+ scaling->GetSwFilterParams ().scalingMode = VPHAL_SCALING_BILINEAR;
3818
+ VP_PUBLIC_NORMALMESSAGE (" Scaling Info: Force nearest to bilinear for layer %d (%d)" , layerIndexes[i], i);
3819
+ MT_LOG3 (MT_VP_HAL_FC_SCALINGINFO, MT_NORMAL, MT_VP_HAL_FC_LAYER, layerIndexes[i], MT_VP_HAL_SCALING_MODE, VPHAL_SCALING_NEAREST, MT_VP_HAL_SCALING_MODE_FORCE, VPHAL_SCALING_BILINEAR);
3820
+ }
3821
+ }
3822
+ }
3823
+
3824
+ // No procamp in target being used.
3825
+ return MOS_STATUS_SUCCESS;
3826
+ }
3827
+
3828
+ MOS_STATUS PolicyOclFcHandler::AddInputLayerForProcess (bool &bSkip, std::vector<int > &layerIndexes, VPHAL_SCALING_MODE &scalingMode, int index, VP_SURFACE &input, SwFilterSubPipe &pipe, VP_SURFACE &output, VP_EXECUTE_CAPS &caps, int32_t &resLayerCount)
3829
+ {
3830
+ // Legacy FC has lots of limitations.
3831
+ // Procamp Luma key layer limitation, sampler limitation
3832
+ // OCL FC doesn't have these limitations
3833
+ bSkip = false ;
3834
+ --resLayerCount;
3835
+
3836
+ SwFilterScaling *scaling = dynamic_cast <SwFilterScaling *>(pipe.GetSwFilter (FeatureType::FeatureTypeScaling));
3837
+ SwFilterDeinterlace *di = dynamic_cast <SwFilterDeinterlace *>(pipe.GetSwFilter (FeatureType::FeatureTypeDi));
3838
+ VPHAL_SAMPLE_TYPE sampleType = input.SampleType ;
3839
+
3840
+ VP_PUBLIC_CHK_NULL_RETURN (scaling);
3841
+
3842
+ scalingMode = scaling->GetSwFilterParams ().scalingMode ;
3843
+ // Disable AVS scaling mode
3844
+ if (VPHAL_SCALING_AVS == scalingMode)
3845
+ {
3846
+ scalingMode = VPHAL_SCALING_BILINEAR;
3847
+ }
3848
+
3849
+ if (!IsInterlacedInputSupported (input))
3850
+ {
3851
+ sampleType = SAMPLE_PROGRESSIVE;
3852
+ // Disable DI
3853
+ if (di && di->IsFeatureEnabled (caps))
3854
+ {
3855
+ di->GetFilterEngineCaps ().bEnabled = false ;
3856
+ }
3857
+ // Disable Iscaling
3858
+ if (scaling->IsFeatureEnabled (caps) &&
3859
+ ISCALING_NONE != scaling->GetSwFilterParams ().interlacedScalingType )
3860
+ {
3861
+ scaling->GetSwFilterParams ().interlacedScalingType = ISCALING_NONE;
3862
+ }
3863
+ }
3864
+ VP_PUBLIC_CHK_STATUS_RETURN (Get3DSamplerScalingMode (scalingMode, pipe, layerIndexes.size (), input, output));
3865
+
3866
+ if (resLayerCount < 0 )
3867
+ {
3868
+ // Multipass
3869
+ bSkip = true ;
3870
+ VP_PUBLIC_NORMALMESSAGE (" Scaling Info: layer %d is not selected. layers %d" ,
3871
+ index,
3872
+ resLayerCount);
3873
+ return MOS_STATUS_SUCCESS;
3874
+ }
3875
+
3876
+ VP_PUBLIC_NORMALMESSAGE (" Scaling Info: scalingMode %d is selected for layer %d" , scalingMode, index);
3877
+ MT_LOG2 (MT_VP_HAL_FC_SCALINGINFO, MT_NORMAL, MT_VP_HAL_FC_LAYER, index, MT_VP_HAL_SCALING_MODE, scalingMode);
3878
+
3879
+ // Append source to compositing operation
3880
+ scaling->GetSwFilterParams ().scalingMode = scalingMode;
3881
+
3882
+ if (di)
3883
+ {
3884
+ di->GetSwFilterParams ().sampleTypeInput = sampleType;
3885
+ }
3886
+
3887
+ input.SampleType = sampleType;
3888
+ layerIndexes.push_back (index);
3889
+
3890
+ return MOS_STATUS_SUCCESS;
3891
+ }
3892
+
3775
3893
} // namespace vp
0 commit comments