mpeg2enc: f_code[s][t] follows the picture coding type
authorXiang, Haihao <haihao.xiang@intel.com>
Thu, 29 Nov 2012 01:56:06 +0000 (09:56 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Fri, 7 Dec 2012 08:05:35 +0000 (16:05 +0800)
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
test/encode/mpeg2enc.c

index a393053..9fcedc1 100644 (file)
@@ -960,6 +960,25 @@ mpeg2enc_update_picture_parameter(struct mpeg2enc_context *ctx,
     pic_param->reconstructed_picture = surface_ids[SID_RECON_PICTURE];
     pic_param->forward_reference_picture = surface_ids[SID_REFERENCE_PICTURE_L0];
     pic_param->backward_reference_picture = surface_ids[SID_REFERENCE_PICTURE_L1];
+
+    if (pic_param->picture_type == VAEncPictureTypeIntra) {
+        pic_param->f_code[0][0] = 0xf;
+        pic_param->f_code[0][1] = 0xf;
+        pic_param->f_code[1][0] = 0xf;
+        pic_param->f_code[1][1] = 0xf;
+    } else if (pic_param->picture_type == VAEncPictureTypePredictive) {
+        pic_param->f_code[0][0] = 0x1;
+        pic_param->f_code[0][1] = 0x1;
+        pic_param->f_code[1][0] = 0xf;
+        pic_param->f_code[1][1] = 0xf;
+    } else if (pic_param->picture_type == VAEncPictureTypeBidirectional) {
+        pic_param->f_code[0][0] = 0x1;
+        pic_param->f_code[0][1] = 0x1;
+        pic_param->f_code[1][0] = 0x1;
+        pic_param->f_code[1][1] = 0x1;
+    } else {
+        assert(0);
+    }
 }
 
 static void