• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/libva


Commit MetaInfo

Revisiond446db390a91ddbc87f9c448611fbc2df76e31ca (tree)
Zeit2013-05-28 17:46:47
AutorZhou Chang <chang.zhou@inte...>
CommiterXiang, Haihao

Log Message

test/encode/avcenc: Support continue B frames in test code.

Signed-off-by: Zhou Chang <chang.zhou@intel.com>

Ändern Zusammenfassung

Diff

--- a/test/encode/avcenc.c
+++ b/test/encode/avcenc.c
@@ -469,9 +469,11 @@ static void end_picture(int slice_type, int next_is_bpic)
469469 surface_ids[SID_REFERENCE_PICTURE_L0] = tempID;
470470 }
471471 } else {
472- surface_ids[SID_RECON_PICTURE] = surface_ids[SID_REFERENCE_PICTURE_L0];
473- surface_ids[SID_REFERENCE_PICTURE_L0] = surface_ids[SID_REFERENCE_PICTURE_L1];
474- surface_ids[SID_REFERENCE_PICTURE_L1] = tempID;
472+ if (!next_is_bpic) {
473+ surface_ids[SID_RECON_PICTURE] = surface_ids[SID_REFERENCE_PICTURE_L0];
474+ surface_ids[SID_REFERENCE_PICTURE_L0] = surface_ids[SID_REFERENCE_PICTURE_L1];
475+ surface_ids[SID_REFERENCE_PICTURE_L1] = tempID;
476+ }
475477 }
476478
477479 avcenc_destroy_buffers(&avcenc_context.seq_param_buf_id, 1);
@@ -1013,15 +1015,23 @@ static void encode_p_picture(FILE *yuv_fp, FILE *avc_fp, int f)
10131015 SLICE_TYPE_P, 0);
10141016 }
10151017
1016-static void encode_pb_pictures(FILE *yuv_fp, FILE *avc_fp, int f)
1018+static void encode_pb_pictures(FILE *yuv_fp, FILE *avc_fp, int f, int nbframes)
10171019 {
1020+ int i;
10181021 encode_picture(yuv_fp, avc_fp,
1019- enc_frame_number, f + 1,
1022+ enc_frame_number, f + nbframes,
10201023 0,
10211024 SLICE_TYPE_P, 1);
10221025
1026+ for( i = 0; i < nbframes - 1; i++) {
1027+ encode_picture(yuv_fp, avc_fp,
1028+ enc_frame_number + 1, f + i,
1029+ 0,
1030+ SLICE_TYPE_B, 1);
1031+ }
1032+
10231033 encode_picture(yuv_fp, avc_fp,
1024- enc_frame_number + 1, f,
1034+ enc_frame_number + 1, f + nbframes - 1,
10251035 0,
10261036 SLICE_TYPE_B, 0);
10271037 }
@@ -1223,8 +1233,8 @@ int main(int argc, char *argv[])
12231233 f++;
12241234 enc_frame_number++;
12251235 } else if ( is_bslice) {
1226- encode_pb_pictures(yuv_fp, avc_fp, f);
1227- f+=2;
1236+ encode_pb_pictures(yuv_fp, avc_fp, f, 2); //last parameter is continue B frames number
1237+ f += (1 + 2);
12281238 enc_frame_number++;
12291239 } else {
12301240 encode_p_picture(yuv_fp, avc_fp, f);