Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guillaume Martres
aom-rav1e
Commits
9bcf07ae
Commit
9bcf07ae
authored
Jun 28, 2011
by
John Koleszar
Committed by
Code Review
Jun 28, 2011
Browse files
Merge "Simplify decode_macroblock."
parents
14566125
81c05464
Changes
1
Hide whitespace changes
Inline
Side-by-side
vp8/decoder/decodframe.c
View file @
9bcf07ae
...
...
@@ -183,7 +183,8 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
unsigned
int
mb_idx
)
{
int
eobtotal
=
0
;
int
i
,
do_clamp
=
xd
->
mode_info_context
->
mbmi
.
need_to_clamp_mvs
;
MB_PREDICTION_MODE
mode
;
int
i
;
if
(
xd
->
mode_info_context
->
mbmi
.
mb_skip_coeff
)
{
...
...
@@ -195,14 +196,14 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
}
/* Perform temporary clamping of the MV to be used for prediction */
if
(
d
o_clamp
)
if
(
xd
->
mode_info_context
->
mbmi
.
need_t
o_clamp
_mvs
)
{
clamp_mvs
(
xd
);
}
eobtotal
|
=
(
xd
->
mode_info_context
->
mbmi
.
mode
==
B_PRED
||
xd
->
mode_info_context
->
mbmi
.
mode
==
SPLITMV
);
if
(
!
eobtotal
)
mode
=
xd
->
mode_info_context
->
mbmi
.
mode
;
if
(
eobtotal
==
0
&&
mode
!=
B_PRED
&&
mode
!=
SPLITMV
)
{
/* Special case: Force the loopfilter to skip when eobtotal and
* mb_skip_coeff are zero.
...
...
@@ -221,15 +222,12 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
{
RECON_INVOKE
(
&
pbi
->
common
.
rtcd
.
recon
,
build_intra_predictors_mbuv
)(
xd
);
if
(
xd
->
mode_info_context
->
mbmi
.
mode
!=
B_PRED
)
if
(
mode
!=
B_PRED
)
{
RECON_INVOKE
(
&
pbi
->
common
.
rtcd
.
recon
,
build_intra_predictors_mby
)(
xd
);
}
else
{
vp8_intra_prediction_down_copy
(
xd
);
}
}
else
...
...
@@ -252,41 +250,10 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
#endif
/* dequantization and idct */
if
(
xd
->
mode_info_context
->
mbmi
.
mode
!=
B_PRED
&&
xd
->
mode_info_context
->
mbmi
.
mode
!=
SPLITMV
)
{
BLOCKD
*
b
=
&
xd
->
block
[
24
];
DEQUANT_INVOKE
(
&
pbi
->
dequant
,
block
)(
b
);
/* do 2nd order transform on the dc block */
if
(
xd
->
eobs
[
24
]
>
1
)
{
IDCT_INVOKE
(
RTCD_VTABLE
(
idct
),
iwalsh16
)(
&
b
->
dqcoeff
[
0
],
b
->
diff
);
((
int
*
)
b
->
qcoeff
)[
0
]
=
0
;
((
int
*
)
b
->
qcoeff
)[
1
]
=
0
;
((
int
*
)
b
->
qcoeff
)[
2
]
=
0
;
((
int
*
)
b
->
qcoeff
)[
3
]
=
0
;
((
int
*
)
b
->
qcoeff
)[
4
]
=
0
;
((
int
*
)
b
->
qcoeff
)[
5
]
=
0
;
((
int
*
)
b
->
qcoeff
)[
6
]
=
0
;
((
int
*
)
b
->
qcoeff
)[
7
]
=
0
;
}
else
{
IDCT_INVOKE
(
RTCD_VTABLE
(
idct
),
iwalsh1
)(
&
b
->
dqcoeff
[
0
],
b
->
diff
);
((
int
*
)
b
->
qcoeff
)[
0
]
=
0
;
}
DEQUANT_INVOKE
(
&
pbi
->
dequant
,
dc_idct_add_y_block
)
(
xd
->
qcoeff
,
xd
->
block
[
0
].
dequant
,
xd
->
predictor
,
xd
->
dst
.
y_buffer
,
xd
->
dst
.
y_stride
,
xd
->
eobs
,
xd
->
block
[
24
].
diff
);
}
else
if
(
xd
->
mode_info_context
->
mbmi
.
mode
==
B_PRED
)
if
(
mode
==
B_PRED
)
{
for
(
i
=
0
;
i
<
16
;
i
++
)
{
BLOCKD
*
b
=
&
xd
->
block
[
i
];
RECON_INVOKE
(
RTCD_VTABLE
(
recon
),
intra4x4_predict
)
(
b
,
b
->
bmi
.
as_mode
,
b
->
predictor
);
...
...
@@ -307,13 +274,43 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
}
}
else
else
if
(
mode
==
SPLITMV
)
{
DEQUANT_INVOKE
(
&
pbi
->
dequant
,
idct_add_y_block
)
(
xd
->
qcoeff
,
xd
->
block
[
0
].
dequant
,
xd
->
predictor
,
xd
->
dst
.
y_buffer
,
xd
->
dst
.
y_stride
,
xd
->
eobs
);
}
else
{
BLOCKD
*
b
=
&
xd
->
block
[
24
];
DEQUANT_INVOKE
(
&
pbi
->
dequant
,
block
)(
b
);
/* do 2nd order transform on the dc block */
if
(
xd
->
eobs
[
24
]
>
1
)
{
IDCT_INVOKE
(
RTCD_VTABLE
(
idct
),
iwalsh16
)(
&
b
->
dqcoeff
[
0
],
b
->
diff
);
((
int
*
)
b
->
qcoeff
)[
0
]
=
0
;
((
int
*
)
b
->
qcoeff
)[
1
]
=
0
;
((
int
*
)
b
->
qcoeff
)[
2
]
=
0
;
((
int
*
)
b
->
qcoeff
)[
3
]
=
0
;
((
int
*
)
b
->
qcoeff
)[
4
]
=
0
;
((
int
*
)
b
->
qcoeff
)[
5
]
=
0
;
((
int
*
)
b
->
qcoeff
)[
6
]
=
0
;
((
int
*
)
b
->
qcoeff
)[
7
]
=
0
;
}
else
{
IDCT_INVOKE
(
RTCD_VTABLE
(
idct
),
iwalsh1
)(
&
b
->
dqcoeff
[
0
],
b
->
diff
);
((
int
*
)
b
->
qcoeff
)[
0
]
=
0
;
}
DEQUANT_INVOKE
(
&
pbi
->
dequant
,
dc_idct_add_y_block
)
(
xd
->
qcoeff
,
xd
->
block
[
0
].
dequant
,
xd
->
predictor
,
xd
->
dst
.
y_buffer
,
xd
->
dst
.
y_stride
,
xd
->
eobs
,
xd
->
block
[
24
].
diff
);
}
DEQUANT_INVOKE
(
&
pbi
->
dequant
,
idct_add_uv_block
)
(
xd
->
qcoeff
+
16
*
16
,
xd
->
block
[
16
].
dequant
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment