OSDN Git Service

ENC:support more quality level and switch to new AVC encoder solution on SKL
[android-x86/hardware-intel-common-vaapi.git] / src / i965_drv_video.h
index 9b9bfac..334b788 100644 (file)
@@ -69,7 +69,9 @@
 #define DEFAULT_SATURATION      50
 
 #define ENCODER_QUALITY_RANGE     2
+#define ENCODER_QUALITY_RANGE_AVC     8
 #define ENCODER_DEFAULT_QUALITY   1
+#define ENCODER_DEFAULT_QUALITY_AVC   4
 #define ENCODER_HIGH_QUALITY      ENCODER_DEFAULT_QUALITY
 #define ENCODER_LOW_QUALITY       2
 
 #define HAS_VP9_ENCODING(ctx)          ((ctx)->codec_info->has_vp9_encoding && \
                                          (ctx)->intel.has_bsd)
 
+#define HAS_VP9_ENCODING_PROFILE(ctx, profile)                     \
+    (HAS_VP9_ENCODING(ctx) &&                                      \
+     ((ctx)->codec_info->vp9_enc_profiles & (1U << (profile - VAProfileVP9Profile0))))
+
 struct i965_surface
 {
     struct object_base *base;
@@ -266,7 +272,9 @@ struct encode_state
 
     int last_packed_header_type;
 
-    struct buffer_store *misc_param[16];
+    int has_layers;
+
+    struct buffer_store *misc_param[16][8];
 
     VASurfaceID current_render_target;
     struct object_surface *input_yuv_object;
@@ -450,6 +458,7 @@ struct hw_codec_info
 
     unsigned int h264_mvc_dec_profiles;
     unsigned int vp9_dec_profiles;
+    unsigned int vp9_enc_profiles;
 
     unsigned int h264_dec_chroma_formats;
     unsigned int jpeg_dec_chroma_formats;
@@ -491,6 +500,7 @@ struct hw_codec_info
 
 
 #include "i965_render.h"
+#include "i965_gpe_utils.h"
 
 struct i965_driver_data 
 {
@@ -527,6 +537,8 @@ struct i965_driver_data
     struct va_wl_output *wl_output;
 
     VADriverContextP wrapper_pdrvctx;
+
+    struct i965_gpe_table gpe_table;
 };
 
 #define NEW_CONFIG_ID() object_heap_allocate(&i965->config_heap);
@@ -625,8 +637,6 @@ extern VAStatus i965_CreateSurfaces(VADriverContextP ctx,
                     int format,
                     int num_surfaces,
                     VASurfaceID *surfaces);
-extern VAStatus i965_SyncSurface(VADriverContextP ctx,
-                    VASurfaceID render_target);
 
 #define I965_SURFACE_MEM_NATIVE             0
 #define I965_SURFACE_MEM_GEM_FLINK          1