mpeg2enc: set the frames between I and P frames
authorXiang, Haihao <haihao.xiang@intel.com>
Wed, 5 Dec 2012 08:18:20 +0000 (16:18 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Fri, 7 Dec 2012 08:05:35 +0000 (16:05 +0800)
The default valude is 2

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
test/encode/mpeg2enc.c

index aace552..29d9a99 100644 (file)
@@ -101,6 +101,7 @@ struct mpeg2enc_context {
     FILE *ofp;
     unsigned char *frame_data_buffer;
     int intra_period;
+    int ip_period;
     int bit_rate; /* in kbps */
 
     /* VA resource */
@@ -714,7 +715,7 @@ mpeg2enc_init_sequence_parameter(struct mpeg2enc_context *ctx,
     }
         
     seq_param->intra_period = ctx->intra_period;
-    seq_param->ip_period = 0;   /* FIXME: ??? */
+    seq_param->ip_period = ctx->ip_period;   /* FIXME: ??? */
     seq_param->picture_width = ctx->width;
     seq_param->picture_height = ctx->height;
 
@@ -872,6 +873,7 @@ mpeg2enc_init(struct mpeg2enc_context *ctx)
     ctx->codedbuf_buf_id = VA_INVALID_ID;
     ctx->codedbuf_i_size = ctx->frame_size;
     ctx->codedbuf_pb_size = 0;
+    ctx->ip_period = 2;
 
     if (ctx->mode == MPEG2_MODE_I)
         ctx->intra_period = 1;