hardware/intel/libva
修订版 | 167579d0bfd54daaae38357b16e2923c705b3091 (tree) |
---|---|
时间 | 2013-05-28 17:46:48 |
作者 | Zhou Chang <chang.zhou@inte...> |
Commiter | Xiang, Haihao |
test/encode/avcenc: Simplify the IPB pattern file upload
Signed-off-by: Zhou Chang <chang.zhou@intel.com>
@@ -1019,7 +1019,8 @@ encode_picture(FILE *yuv_fp, FILE *avc_fp, | ||
1019 | 1019 | |
1020 | 1020 | begin_picture(yuv_fp, frame_num, display_num, slice_type, is_idr); |
1021 | 1021 | |
1022 | - if (next_display_num < frame_number) { | |
1022 | + //if (next_display_num < frame_number) { | |
1023 | + if (1) { | |
1023 | 1024 | int index; |
1024 | 1025 | |
1025 | 1026 | /* prepare for next frame */ |
@@ -1027,7 +1028,8 @@ encode_picture(FILE *yuv_fp, FILE *avc_fp, | ||
1027 | 1028 | index = SID_INPUT_PICTURE_1; |
1028 | 1029 | else |
1029 | 1030 | index = SID_INPUT_PICTURE_0; |
1030 | - | |
1031 | + if ( next_display_num >= frame_number ) | |
1032 | + next_display_num = frame_number - 1; | |
1031 | 1033 | fseek(yuv_fp, frame_size * next_display_num, SEEK_SET); |
1032 | 1034 | |
1033 | 1035 | avcenc_context.upload_thread_param.yuv_fp = yuv_fp; |
@@ -1323,8 +1325,8 @@ int main(int argc, char *argv[]) | ||
1323 | 1325 | static int fcurrent = 0; |
1324 | 1326 | int fnext; |
1325 | 1327 | |
1326 | - fcurrent = fcurrent % sizeof(frame_type_pattern)/sizeof(int[2]); | |
1327 | - fnext = (fcurrent+1) % sizeof(frame_type_pattern)/sizeof(int[2]); | |
1328 | + fcurrent = fcurrent % (sizeof(frame_type_pattern)/sizeof(int[2])); | |
1329 | + fnext = (fcurrent+1) % (sizeof(frame_type_pattern)/sizeof(int[2])); | |
1328 | 1330 | |
1329 | 1331 | if ( frame_type_pattern[fcurrent][0] == SLICE_TYPE_I ) { |
1330 | 1332 | encode_picture(yuv_fp, avc_fp,enc_frame_number, f, f==0, SLICE_TYPE_I, 0, |