summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhou Chang <chang.zhou@intel.com>2011-07-27 15:16:25 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2013-05-28 16:46:48 +0800
commit167579d0bfd54daaae38357b16e2923c705b3091 (patch)
treef1d72eac6e2ce62dd27b607b1166c6842c5e580a
parent8601262cd08c781a6dd47aa199d7717027227b2a (diff)
test/encode/avcenc: Simplify the IPB pattern file upload
Signed-off-by: Zhou Chang <chang.zhou@intel.com>
-rw-r--r--test/encode/avcenc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/encode/avcenc.c b/test/encode/avcenc.c
index 197b284..49c1187 100644
--- a/test/encode/avcenc.c
+++ b/test/encode/avcenc.c
@@ -1019,7 +1019,8 @@ encode_picture(FILE *yuv_fp, FILE *avc_fp,
begin_picture(yuv_fp, frame_num, display_num, slice_type, is_idr);
- if (next_display_num < frame_number) {
+ //if (next_display_num < frame_number) {
+ if (1) {
int index;
/* prepare for next frame */
@@ -1027,7 +1028,8 @@ encode_picture(FILE *yuv_fp, FILE *avc_fp,
index = SID_INPUT_PICTURE_1;
else
index = SID_INPUT_PICTURE_0;
-
+ if ( next_display_num >= frame_number )
+ next_display_num = frame_number - 1;
fseek(yuv_fp, frame_size * next_display_num, SEEK_SET);
avcenc_context.upload_thread_param.yuv_fp = yuv_fp;
@@ -1323,8 +1325,8 @@ int main(int argc, char *argv[])
static int fcurrent = 0;
int fnext;
- fcurrent = fcurrent % sizeof(frame_type_pattern)/sizeof(int[2]);
- fnext = (fcurrent+1) % sizeof(frame_type_pattern)/sizeof(int[2]);
+ fcurrent = fcurrent % (sizeof(frame_type_pattern)/sizeof(int[2]));
+ fnext = (fcurrent+1) % (sizeof(frame_type_pattern)/sizeof(int[2]));
if ( frame_type_pattern[fcurrent][0] == SLICE_TYPE_I ) {
encode_picture(yuv_fp, avc_fp,enc_frame_number, f, f==0, SLICE_TYPE_I, 0,