Android-x86
Fork
Spenden

  • R/O
  • HTTP
  • SSH
  • HTTPS

hardware-intel-libva: Commit

hardware/intel/libva


Commit MetaInfo

Revision888a75cac869dc197bd55381dd80cde2942b3b52 (tree)
Zeit2016-05-09 17:48:52
AutorXiang, Haihao <haihao.xiang@inte...>
CommiterXiang, Haihao

Log Message

test/encode/avcenc: Add support for low power mode

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Reviewed-By: Sean V Kelley <sean.v.kelley@intel.com>

Ändern Zusammenfassung

Diff

--- a/test/encode/avcenc.c
+++ b/test/encode/avcenc.c
@@ -92,6 +92,8 @@ static int frame_bit_rate = -1;
9292 static int frame_rate = 30;
9393 static int ip_period = 1;
9494
95+static VAEntrypoint select_entrypoint = VAEntrypointEncSlice;
96+
9597 #define MAX_SLICES 32
9698
9799
@@ -103,6 +105,7 @@ static const struct option longopts[] = {
103105 {"qp", required_argument, 0, 1},
104106 {"fb", required_argument, 0, 2},
105107 {"mode", required_argument, 0, 3},
108+ {"low-power", no_argument, 0, 4},
106109 { NULL, 0, NULL, 0}
107110 };
108111
@@ -194,7 +197,7 @@ static void create_encode_pipe()
194197 &num_entrypoints);
195198
196199 for (slice_entrypoint = 0; slice_entrypoint < num_entrypoints; slice_entrypoint++) {
197- if (entrypoints[slice_entrypoint] == VAEntrypointEncSlice)
200+ if (entrypoints[slice_entrypoint] == select_entrypoint)
198201 break;
199202 }
200203
@@ -206,7 +209,7 @@ static void create_encode_pipe()
206209 /* find out the format for the render target, and rate control mode */
207210 attrib[0].type = VAConfigAttribRTFormat;
208211 attrib[1].type = VAConfigAttribRateControl;
209- vaGetConfigAttributes(va_dpy, avcenc_context.profile, VAEntrypointEncSlice,
212+ vaGetConfigAttributes(va_dpy, avcenc_context.profile, select_entrypoint,
210213 &attrib[0], 2);
211214
212215 if ((attrib[0].value & VA_RT_FORMAT_YUV420) == 0) {
@@ -223,7 +226,7 @@ static void create_encode_pipe()
223226 attrib[0].value = VA_RT_FORMAT_YUV420; /* set to desired RT format */
224227 attrib[1].value = avcenc_context.rate_control_method; /* set to desired RC mode */
225228
226- va_status = vaCreateConfig(va_dpy, avcenc_context.profile, VAEntrypointEncSlice,
229+ va_status = vaCreateConfig(va_dpy, avcenc_context.profile, select_entrypoint,
227230 &attrib[0], 2,&avcenc_context.config_id);
228231 CHECK_VASTATUS(va_status, "vaCreateConfig");
229232
@@ -1688,7 +1691,7 @@ encode_picture(FILE *yuv_fp, FILE *avc_fp,
16881691
16891692 static void show_help()
16901693 {
1691- printf("Usage: avnenc <width> <height> <input_yuvfile> <output_avcfile> [--qp=qpvalue|--fb=framebitrate] [--mode=0(I frames only)/1(I and P frames)/2(I, P and B frames)\n");
1694+ printf("Usage: avnenc <width> <height> <input_yuvfile> <output_avcfile> [--qp=qpvalue|--fb=framebitrate] [--mode=0(I frames only)/1(I and P frames)/2(I, P and B frames)] [--low-power]\n");
16921695 }
16931696
16941697 static void avcenc_context_seq_param_init(VAEncSequenceParameterBufferH264 *seq_param,
@@ -1919,6 +1922,10 @@ int main(int argc, char *argv[])
19191922
19201923 break;
19211924
1925+ case 4: // low-power mode
1926+ select_entrypoint = VAEntrypointEncSliceLP;
1927+ break;
1928+
19221929 default:
19231930 show_help();
19241931 return -1;
Show on old repository browser