diff options
author | Wan-Teh Chang <wtc-at-google.com@ffmpeg.org> | 2017-07-20 11:39:11 -0700 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-07-21 02:08:33 +0200 |
commit | b77e26b28525f366c5f978214b230a5324bedf81 (patch) | |
tree | fd65996d8cd1d2cb14a47bab2b4220ef3d2c4347 | |
parent | ea1ca17be2301aaef5b3b5ef8c2abe7f7d688e07 (diff) | |
download | ffmpeg-b77e26b28525f366c5f978214b230a5324bedf81.tar.gz |
avcodec/hevcdec: hevc_await_progress: declare |y| only if used.
hevc_await_progress() uses the variable |y| only inside the "if" block.
So |y| only needs to be declared and initialized in that block.
Signed-off-by: Wan-Teh Chang <wtc@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/hevcdec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 55f51211c3..e084d75767 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -1684,10 +1684,11 @@ static void chroma_mc_bi(HEVCContext *s, uint8_t *dst0, ptrdiff_t dststride, AVF static void hevc_await_progress(HEVCContext *s, HEVCFrame *ref, const Mv *mv, int y0, int height) { - int y = FFMAX(0, (mv->y >> 2) + y0 + height + 9); + if (s->threads_type == FF_THREAD_FRAME ) { + int y = FFMAX(0, (mv->y >> 2) + y0 + height + 9); - if (s->threads_type == FF_THREAD_FRAME ) ff_thread_await_progress(&ref->tf, y, 0); + } } static void hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0, int nPbW, |