test/encode/avcenc: fix reading raw YUV file order bug.
authorZhou Chang <chang.zhou@intel.com>
Wed, 8 Jun 2011 07:24:04 +0000 (15:24 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Tue, 28 May 2013 08:46:47 +0000 (16:46 +0800)
Signed-off-by: Zhou Chang <chang.zhou@intel.com>
test/encode/avcenc.c

index 0ceb303..0432169 100644 (file)
@@ -360,11 +360,11 @@ static void prepare_input_pb(FILE *yuv_fp, int is_bslice)
     // Copy Image to target surface according input YUV data.
        if ( is_bslice ) {
                upload_yuv_to_surface(yuv_fp, surface_ids[SID_INPUT_PICTURE]);
-               fseek(yuv_fp, SEEK_CUR, frame_size);
+               fseek(yuv_fp, frame_size, SEEK_CUR);
        } else {
-               fseek(yuv_fp, SEEK_CUR, frame_size); 
+               fseek(yuv_fp, frame_size, SEEK_CUR); 
                upload_yuv_to_surface(yuv_fp, surface_ids[SID_INPUT_PICTURE]);
-               fseek(yuv_fp, SEEK_CUR, -2l * frame_size);
+               fseek(yuv_fp, -2l * frame_size, SEEK_CUR);
        }
        
        // Render picture level parameters
@@ -929,7 +929,7 @@ int main(int argc, char *argv[])
                int is_bslice = 0;
                
                if ( ! is_intra ) {
-                       is_bslice = (f % 5 == 0) && (f < frame_number - 1);     
+                       is_bslice = (f % 2 == 1) && (f < frame_number - 1);     
                }
        
                if ( is_intra ) {