diff options
author | Sun, Mingruo <mingruo.sun@intel.com> | 2015-08-05 10:40:34 +0800 |
---|---|---|
committer | Austin Yuan <shengquan.yuan@intel.com> | 2015-08-05 10:56:55 +0800 |
commit | 3959f2c82535c4210f693ca7a89c66231bd751e3 (patch) | |
tree | 7c1315fd5d9a935587fa87deaa7de46527ada8b2 | |
parent | d19d0a419f5b6b563a293e860ae90159b86c29b0 (diff) |
vaenc: add "-tu_value" option and set it to 7 as default
remove "-prit" and "-priv" options
Signed-off-by: Sun, Mingruo <mingruo.sun@intel.com>
-rw-r--r-- | vaenc/h264encode.c | 26 | ||||
-rw-r--r-- | vaenc/va_encode.c | 10 | ||||
-rw-r--r-- | vaenc/va_encode.h | 1 |
3 files changed, 17 insertions, 20 deletions
diff --git a/vaenc/h264encode.c b/vaenc/h264encode.c index 906e253..f05204b 100644 --- a/vaenc/h264encode.c +++ b/vaenc/h264encode.c @@ -579,6 +579,7 @@ static int render_sequence(void) VAStatus va_status; VAEncMiscParameterBuffer *misc_param, *misc_param_tmp; VAEncMiscParameterRateControl *misc_rate_ctrl; + VAEncMiscParameterBufferQualityLevel *misc_quality_param; seq_param.level_idc = 41 /*SH_LEVEL_3*/; seq_param.picture_width_in_mbs = frame_width_mbaligned / 16; @@ -616,19 +617,20 @@ static int render_sequence(void) va_status = vaRenderPicture(va_dpy,context_id, &seq_param_buf, 1); CHECK_VASTATUS(va_status,"vaRenderPicture");; - if (misc_tu_type != 0) { - va_status = vaCreateBuffer(va_dpy, context_id, - VAEncMiscParameterBufferType, - sizeof(VAEncMiscParameterBuffer), - 1, NULL, &misc_param_tmpbuf); - CHECK_VASTATUS(va_status,"vaCreateBuffer"); - vaMapBuffer(va_dpy, misc_param_tmpbuf,(void **)&misc_param_tmp); - misc_param_tmp->type = misc_tu_type; - misc_param_tmp->data[0] = misc_tu_value; - vaUnmapBuffer(va_dpy, misc_param_tmpbuf); + va_status = vaCreateBuffer(va_dpy, context_id, + VAEncMiscParameterBufferType, + sizeof(VAEncMiscParameterBuffer) + sizeof(VAEncMiscParameterBufferQualityLevel), + 1, NULL, &misc_param_tmpbuf); + CHECK_VASTATUS(va_status,"vaCreateBuffer"); + + vaMapBuffer(va_dpy, misc_param_tmpbuf,(void **)&misc_param_tmp); + misc_param_tmp->type = VAEncMiscParameterTypeQualityLevel; + misc_quality_param = (VAEncMiscParameterBufferQualityLevel *)misc_param_tmp->data; + misc_quality_param->quality_level = misc_tu_value; + vaUnmapBuffer(va_dpy, misc_param_tmpbuf); - va_status = vaRenderPicture(va_dpy,context_id, &misc_param_tmpbuf, 1); - } + va_status = vaRenderPicture(va_dpy,context_id, &misc_param_tmpbuf, 1); + if (buf_destroy) destroy_vabuffers(va_dpy, 5, seq_param_buf, rc_param_buf, misc_param_tmpbuf, render_id[0], render_id[1]); diff --git a/vaenc/va_encode.c b/vaenc/va_encode.c index 29f9986..af63108 100644 --- a/vaenc/va_encode.c +++ b/vaenc/va_encode.c @@ -116,7 +116,6 @@ unsigned int current_IDR_display = 0; unsigned int current_frame_num = 0; unsigned int current_frame_type; -unsigned int misc_tu_type = 6; unsigned int misc_tu_value = 7; int pm_active = 0; @@ -399,7 +398,8 @@ static int print_help(void) printf(" -roi_rec_y defines the ROI boundary in pixels, AVC Encoder setting\n"); printf(" -roi_rec_w defines the ROI boundary in pixels, AVC Encoder setting\n"); printf(" -roi_rec_h defines the ROI boundary in pixels, AVC Encoder setting\n"); - printf(" -target_percentage [target percentage for VBR mode] default is 95"); + printf(" -target_percentage [target percentage for VBR mode] default is 95\n"); + printf(" -tu_value default is 7\n"); return 0; } @@ -421,8 +421,7 @@ static int process_cmdline(int argc, char *argv[]) {"fourcc", required_argument, NULL, 11 }, {"syncmode", no_argument, NULL, 12 }, {"enablePSNR", no_argument, NULL, 13 }, - {"prit", required_argument, NULL, 14 }, - {"priv", required_argument, NULL, 15 }, + {"tu_value", required_argument, NULL, 15 }, {"framecount", required_argument, NULL, 16 }, {"entropy", required_argument, NULL, 17 }, {"profile", required_argument, NULL, 18 }, @@ -590,9 +589,6 @@ static int process_cmdline(int argc, char *argv[]) case 13: calc_psnr = 1; break; - case 14: - misc_tu_type = strtol(optarg, NULL, 0); - break; case 15: misc_tu_value = strtol(optarg, NULL, 0); break; diff --git a/vaenc/va_encode.h b/vaenc/va_encode.h index 30676d4..0341692 100644 --- a/vaenc/va_encode.h +++ b/vaenc/va_encode.h @@ -131,7 +131,6 @@ extern unsigned int current_IDR_display; extern unsigned int current_frame_num; extern unsigned int current_frame_type; -extern unsigned int misc_tu_type; extern unsigned int misc_tu_value; extern unsigned int surface_type; |