diff options
author | Sean V Kelley <seanvk@posteo.de> | 2017-01-17 15:00:55 -0800 |
---|---|---|
committer | Sean V Kelley <seanvk@posteo.de> | 2017-01-17 15:00:55 -0800 |
commit | fb9050d57ae7e014056e8148d5a87aa443794cd4 (patch) | |
tree | 81869cb06ed332cf9e12a4e916e1a8ca440b53f2 | |
parent | dcf071516da00e752afd15ca9527e1e8493c1028 (diff) |
Revert "ENC:support more quality level and switch to new AVC encoder solution on SKL"
This reverts commit dcf071516da00e752afd15ca9527e1e8493c1028.
-rwxr-xr-x | src/Makefile.am | 11 | ||||
-rw-r--r-- | src/i965_drv_video.c | 8 | ||||
-rw-r--r-- | src/i965_drv_video.h | 2 | ||||
-rw-r--r-- | src/i965_encoder.c | 39 |
4 files changed, 10 insertions, 50 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 9a5e44b..424812b 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -101,11 +101,6 @@ source_c = \ gen9_vp9_encoder_kernels.c \ gen9_vp9_const_def.c \ gen9_vp9_encoder.c \ - i965_avc_encoder_common.c \ - i965_encoder_common.c \ - gen9_avc_encoder_kernels.c \ - gen9_avc_const_def.c \ - gen9_avc_encoder.c \ intel_common_vpp_internal.c \ $(NULL) @@ -159,12 +154,6 @@ source_h = \ gen9_vp9_encapi.h \ gen9_vp9_const_def.h \ gen9_vp9_encoder_kernels.h \ - i965_encoder_api.h \ - i965_avc_encoder_common.h \ - i965_encoder_common.h \ - gen9_avc_encoder.h \ - gen9_avc_const_def.h \ - gen9_avc_encoder_kernels.h \ intel_gen_vppapi.h \ intel_common_vpp_internal.h \ $(NULL) diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c index 64cc0e2..cc37190 100644 --- a/src/i965_drv_video.c +++ b/src/i965_drv_video.c @@ -911,7 +911,6 @@ i965_GetConfigAttributes(VADriverContextP ctx, VAConfigAttrib *attrib_list, /* in/out */ int num_attribs) { - struct i965_driver_data * const i965 = i965_driver_data(ctx); VAStatus va_status; int i; @@ -1004,11 +1003,8 @@ i965_GetConfigAttributes(VADriverContextP ctx, attrib_list[i].value = 1; if (profile == VAProfileH264ConstrainedBaseline || profile == VAProfileH264Main || - profile == VAProfileH264High ){ - attrib_list[i].value = ENCODER_QUALITY_RANGE; - if(IS_GEN9(i965->intel.device_info)) - attrib_list[i].value = ENCODER_QUALITY_RANGE_AVC; - } + profile == VAProfileH264High ) + attrib_list[i].value = ENCODER_QUALITY_RANGE; break; } break; diff --git a/src/i965_drv_video.h b/src/i965_drv_video.h index 334b788..7cba3a3 100644 --- a/src/i965_drv_video.h +++ b/src/i965_drv_video.h @@ -69,9 +69,7 @@ #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 diff --git a/src/i965_encoder.c b/src/i965_encoder.c index beac911..0a648d4 100644 --- a/src/i965_encoder.c +++ b/src/i965_encoder.c @@ -41,7 +41,6 @@ #include "gen6_mfc.h" #include "i965_post_processing.h" -#include "i965_encoder_api.h" static struct intel_fraction reduce_fraction(struct intel_fraction f) @@ -790,7 +789,6 @@ intel_encoder_check_temporal_layer_structure(VADriverContextP ctx, static VAStatus intel_encoder_check_misc_parameter(VADriverContextP ctx, - VAProfile profile, struct encode_state *encode_state, struct intel_encoder_context *encoder_context) { @@ -802,23 +800,12 @@ intel_encoder_check_misc_parameter(VADriverContextP ctx, VAEncMiscParameterBufferQualityLevel* param_quality_level = (VAEncMiscParameterBufferQualityLevel*)pMiscParam->data; encoder_context->quality_level = param_quality_level->quality_level; - switch (profile) { - case VAProfileH264ConstrainedBaseline: - case VAProfileH264Main: - case VAProfileH264High: - if (encoder_context->quality_level == 0) - encoder_context->quality_level = ENCODER_DEFAULT_QUALITY_AVC; - break; - default: - if (encoder_context->quality_level == 0) - encoder_context->quality_level = ENCODER_DEFAULT_QUALITY; - break; + if (encoder_context->quality_level == 0) + encoder_context->quality_level = ENCODER_DEFAULT_QUALITY; + else if (encoder_context->quality_level > encoder_context->quality_range) { + ret = VA_STATUS_ERROR_INVALID_PARAMETER; + goto out; } - - if (encoder_context->quality_level > encoder_context->quality_range) { - ret = VA_STATUS_ERROR_INVALID_PARAMETER; - goto out; - } } ret = intel_encoder_check_temporal_layer_structure(ctx, encode_state, encoder_context); @@ -1294,7 +1281,7 @@ intel_encoder_sanity_check_input(VADriverContextP ctx, } if (vaStatus == VA_STATUS_SUCCESS) - vaStatus = intel_encoder_check_misc_parameter(ctx, profile, encode_state, encoder_context); + vaStatus = intel_encoder_check_misc_parameter(ctx, encode_state, encoder_context); out: return vaStatus; @@ -1375,7 +1362,6 @@ intel_enc_hw_context_init(VADriverContextP ctx, hw_init_func vme_context_init, hw_init_func mfc_context_init) { - struct i965_driver_data *i965 = i965_driver_data(ctx); struct intel_driver_data *intel = intel_driver_data(ctx); struct intel_encoder_context *encoder_context = calloc(1, sizeof(struct intel_encoder_context)); int i; @@ -1408,9 +1394,7 @@ intel_enc_hw_context_init(VADriverContextP ctx, encoder_context->codec = CODEC_H264; if (obj_config->entrypoint == VAEntrypointEncSliceLP) - encoder_context->quality_range = ENCODER_QUALITY_RANGE_AVC; - else if(IS_GEN9(i965->intel.device_info)) - encoder_context->quality_range = ENCODER_QUALITY_RANGE_AVC; + encoder_context->quality_range = ENCODER_LP_QUALITY_RANGE; else encoder_context->quality_range = ENCODER_QUALITY_RANGE; break; @@ -1501,12 +1485,5 @@ gen8_enc_hw_context_init(VADriverContextP ctx, struct object_config *obj_config) struct hw_context * gen9_enc_hw_context_init(VADriverContextP ctx, struct object_config *obj_config) { - switch (obj_config->profile){ - case VAProfileH264ConstrainedBaseline: - case VAProfileH264Main: - case VAProfileH264High: - return intel_enc_hw_context_init(ctx, obj_config, gen9_avc_vme_context_init, gen9_avc_pak_context_init); - default: - return intel_enc_hw_context_init(ctx, obj_config, gen9_vme_context_init, gen9_mfc_context_init); - } + return intel_enc_hw_context_init(ctx, obj_config, gen9_vme_context_init, gen9_mfc_context_init); } |