summaryrefslogtreecommitdiff
path: root/libavcodec/vc1_block.c
diff options
context:
space:
mode:
authorzhaoxiu.zeng <zhaoxiu.zeng@gmail.com>2015-02-25 00:28:45 +0800
committerMichael Niedermayer <michaelni@gmx.at>2015-02-28 15:51:17 +0100
commit137fbab11b344641c9b677a3f012d25f755ab767 (patch)
tree61eecd31f4439f5f85b6bfbf8ddfe62f70e4da54 /libavcodec/vc1_block.c
parent9914502264fda0b974db3fff3d3e91b4309b7c0b (diff)
avcodec/vc1_block: move early exit code up in ff_vc1_pred_dc()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vc1_block.c')
-rw-r--r--libavcodec/vc1_block.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
index 680227cfe8..2513273064 100644
--- a/libavcodec/vc1_block.c
+++ b/libavcodec/vc1_block.c
@@ -388,6 +388,12 @@ static inline int ff_vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n,
int q1, q2 = 0;
int dqscale_index;
+ /* scale predictors if needed */
+ q1 = s->current_picture.qscale_table[mb_pos];
+ dqscale_index = s->y_dc_scale_table[q1] - 1;
+ if (dqscale_index < 0)
+ return 0;
+
wrap = s->block_wrap[n];
dc_val = s->dc_val[0] + s->block_index[n];
@@ -397,11 +403,7 @@ static inline int ff_vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n,
c = dc_val[ - 1];
b = dc_val[ - 1 - wrap];
a = dc_val[ - wrap];
- /* scale predictors if needed */
- q1 = s->current_picture.qscale_table[mb_pos];
- dqscale_index = s->y_dc_scale_table[q1] - 1;
- if (dqscale_index < 0)
- return 0;
+
if (c_avail && (n != 1 && n != 3)) {
q2 = s->current_picture.qscale_table[mb_pos - 1];
if (q2 && q2 != q1)