@@ -931,12 +931,12 @@ static int enc_thread_tile(void *arg)
931931 oapve_core_t * core = (oapve_core_t * )arg ;
932932 oapve_ctx_t * ctx = core -> ctx ;
933933 oapve_tile_t * tile = ctx -> tile ;
934- int ret = OAPV_OK , i ;
934+ int ret = OAPV_OK , i = 0 ;
935935
936936 while (1 ) {
937937 // find not encoded tile
938938 oapv_tpool_enter_cs (ctx -> sync_obj );
939- for (i = 0 ; i < ctx -> num_tiles ; i ++ ) {
939+ for ( ; i < ctx -> num_tiles ; ++ i ) {
940940 if (tile [i ].stat == ENC_TILE_STAT_NOT_ENCODED ) {
941941 tile [i ].stat = ENC_TILE_STAT_ON_ENCODING ;
942942 core -> tile_idx = i ;
@@ -953,6 +953,7 @@ static int enc_thread_tile(void *arg)
953953
954954 oapv_tpool_enter_cs (ctx -> sync_obj );
955955 tile [core -> tile_idx ].stat = ENC_TILE_STAT_ENCODED ;
956+ ++ i ;
956957 oapv_tpool_leave_cs (ctx -> sync_obj );
957958 }
958959ERR :
@@ -1718,7 +1719,7 @@ static int dec_tile(oapvd_core_t *core, oapvd_tile_t *tile)
17181719static int dec_thread_tile (void * arg )
17191720{
17201721 oapv_bs_t bs ;
1721- int i , ret , run , tidx = 0 , thread_ret = OAPV_OK ;
1722+ int i = 0 , ret , run , tidx = 0 , thread_ret = OAPV_OK ;
17221723
17231724 oapvd_core_t * core = (oapvd_core_t * )arg ;
17241725 oapvd_ctx_t * ctx = core -> ctx ;
@@ -1727,7 +1728,7 @@ static int dec_thread_tile(void *arg)
17271728 while (1 ) {
17281729 // find not decoded tile
17291730 oapv_tpool_enter_cs (ctx -> sync_obj );
1730- for (i = 0 ; i < ctx -> num_tiles ; i ++ ) {
1731+ for ( ; i < ctx -> num_tiles ; ++ i ) {
17311732 if (tile [i ].stat == DEC_TILE_STAT_NOT_DECODED ) {
17321733 tile [i ].stat = DEC_TILE_STAT_ON_DECODING ;
17331734 tidx = i ;
@@ -1775,7 +1776,7 @@ static int dec_thread_tile(void *arg)
17751776 tile [tidx ].stat = ret ;
17761777 thread_ret = ret ;
17771778 }
1778- tile [ tidx ]. stat = OAPV_SUCCEEDED ( ret ) ? DEC_TILE_STAT_DECODED : ret ;
1779+ ++ i ;
17791780 oapv_tpool_leave_cs (ctx -> sync_obj );
17801781 }
17811782 return thread_ret ;
0 commit comments