vl: fix low strength denoise filter
[mesa.git] / src / gallium / state_trackers / vdpau / vdpau_private.h
index b8b15aeed4cec02a0be6fb4cb43a938239b7b190..35f0dc0d58a2a6cc2dd85449190fa47756da9de9 100644 (file)
 #include "pipe/p_video_decoder.h"
 
 #include "util/u_debug.h"
+#include "util/u_rect.h"
 #include "vl/vl_compositor.h"
+#include "vl/vl_matrix_filter.h"
+#include "vl/vl_median_filter.h"
 
 #include "vl_winsys.h"
 
@@ -220,6 +223,16 @@ ProfileToPipe(VdpDecoderProfile vdpau_profile)
          return PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN;
       case VDP_DECODER_PROFILE_H264_HIGH:
          return PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH;
+      case VDP_DECODER_PROFILE_MPEG4_PART2_SP:
+         return PIPE_VIDEO_PROFILE_MPEG4_SIMPLE;
+      case VDP_DECODER_PROFILE_MPEG4_PART2_ASP:
+         return PIPE_VIDEO_PROFILE_MPEG4_ADVANCED_SIMPLE;
+      case VDP_DECODER_PROFILE_VC1_SIMPLE:
+         return PIPE_VIDEO_PROFILE_VC1_SIMPLE;
+      case VDP_DECODER_PROFILE_VC1_MAIN:
+         return PIPE_VIDEO_PROFILE_VC1_MAIN;
+      case VDP_DECODER_PROFILE_VC1_ADVANCED:
+         return PIPE_VIDEO_PROFILE_VC1_ADVANCED;
       default:
          return PIPE_VIDEO_PROFILE_UNKNOWN;
    }
@@ -241,6 +254,16 @@ PipeToProfile(enum pipe_video_profile p_profile)
          return VDP_DECODER_PROFILE_H264_MAIN;
       case PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH:
          return VDP_DECODER_PROFILE_H264_HIGH;
+      case PIPE_VIDEO_PROFILE_MPEG4_SIMPLE:
+         return VDP_DECODER_PROFILE_MPEG4_PART2_SP;
+      case PIPE_VIDEO_PROFILE_MPEG4_ADVANCED_SIMPLE:
+         return VDP_DECODER_PROFILE_MPEG4_PART2_ASP;
+      case PIPE_VIDEO_PROFILE_VC1_SIMPLE:
+         return VDP_DECODER_PROFILE_VC1_SIMPLE;
+      case PIPE_VIDEO_PROFILE_VC1_MAIN:
+         return VDP_DECODER_PROFILE_VC1_MAIN;
+      case PIPE_VIDEO_PROFILE_VC1_ADVANCED:
+         return VDP_DECODER_PROFILE_VC1_ADVANCED;
       default:
          assert(0);
          return -1;
@@ -278,18 +301,37 @@ typedef struct
    vlVdpDevice *device;
    Drawable drawable;
    struct vl_compositor compositor;
+   struct u_rect dirty_area;
 } vlVdpPresentationQueue;
 
 typedef struct
 {
    vlVdpDevice *device;
    struct vl_compositor compositor;
+
+   struct {
+      bool supported, enabled;
+      unsigned level;
+      struct vl_median_filter *filter;
+   } noise_reduction;
+
+   struct {
+      bool supported, enabled;
+      float value;
+      struct vl_matrix_filter *filter;
+   } sharpness;
+
+   unsigned video_width, video_height;
+   enum pipe_video_chroma_format chroma_format;
+   unsigned max_layers, skip_chroma_deint, custom_csc;
+   float luma_key_min, luma_key_max;
+   float csc[16];
 } vlVdpVideoMixer;
 
 typedef struct
 {
    vlVdpDevice *device;
-   struct pipe_video_buffer *video_buffer;
+   struct pipe_video_buffer templat, *video_buffer;
 } vlVdpSurface;
 
 typedef uint64_t vlVdpTime;
@@ -301,15 +343,13 @@ typedef struct
    struct pipe_surface *surface;
    struct pipe_sampler_view *sampler_view;
    struct pipe_fence_handle *fence;
+   struct u_rect dirty_area;
 } vlVdpOutputSurface;
 
 typedef struct
 {
    vlVdpDevice *device;
    struct pipe_video_decoder *decoder;
-   unsigned num_buffers;
-   void **buffers;
-   unsigned cur_buffer;
 } vlVdpDecoder;
 
 typedef uint32_t vlHandle;