Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
c94b6351
Commit
c94b6351
authored
Aug 11, 2016
by
Debargha Mukherjee
Committed by
Gerrit Code Review
Aug 11, 2016
Browse files
Merge "A fix in optimize_b for new-quant" into nextgenv2
parents
05ce8508
f4112212
Changes
1
Hide whitespace changes
Inline
Side-by-side
vp10/encoder/encodemb.c
View file @
c94b6351
...
...
@@ -89,12 +89,13 @@ int vp10_optimize_b(MACROBLOCK *mb, int plane, int block,
get_scan
(
tx_size
,
tx_type
,
is_inter_block
(
&
xd
->
mi
[
0
]
->
mbmi
));
const
int16_t
*
const
scan
=
so
->
scan
;
const
int16_t
*
const
nb
=
so
->
neighbors
;
const
int
shift
=
get_tx_scale
(
xd
,
tx_type
,
tx_size
);
#if CONFIG_NEW_QUANT
int
dq
=
get_dq_profile_from_ctx
(
ctx
);
const
dequant_val_type_nuq
*
dequant_val
=
pd
->
dequant_val_nuq
[
dq
];
#endif // CONFIG_NEW_QUANT
const
int
shift
=
get_tx_scale
(
xd
,
tx_type
,
tx_size
);
#else
const
int
dq_step
[
2
]
=
{
dequant_ptr
[
0
]
>>
shift
,
dequant_ptr
[
1
]
>>
shift
};
#endif // CONFIG_NEW_QUANT
int
next
=
eob
,
sz
=
0
;
const
int64_t
rdmult
=
(
mb
->
rdmult
*
plane_rd_mult
[
ref
][
type
])
>>
1
;
const
int64_t
rddiv
=
mb
->
rddiv
;
...
...
@@ -296,6 +297,14 @@ int vp10_optimize_b(MACROBLOCK *mb, int plane, int block,
tokens
[
i
][
1
].
qc
=
x
;
if
(
x
)
{
#if CONFIG_NEW_QUANT
tokens
[
i
][
1
].
dqc
=
vp10_dequant_abscoeff_nuq
(
abs
(
x
),
dequant_ptr
[
rc
!=
0
],
dequant_val
[
band_translate
[
i
]]);
tokens
[
i
][
1
].
dqc
=
shift
?
ROUND_POWER_OF_TWO
(
tokens
[
i
][
1
].
dqc
,
shift
)
:
tokens
[
i
][
1
].
dqc
;
if
(
sz
)
tokens
[
i
][
1
].
dqc
=
-
tokens
[
i
][
1
].
dqc
;
#else
tran_low_t
offset
=
dq_step
[
rc
!=
0
];
// The 32x32 transform coefficient uses half quantization step size.
// Account for the rounding difference in the dequantized coefficeint
...
...
@@ -308,6 +317,7 @@ int vp10_optimize_b(MACROBLOCK *mb, int plane, int block,
tokens
[
i
][
1
].
dqc
=
dqcoeff
[
rc
]
-
offset
;
else
tokens
[
i
][
1
].
dqc
=
dqcoeff
[
rc
]
+
offset
;
#endif // CONFIG_NEW_QUANT
}
else
{
tokens
[
i
][
1
].
dqc
=
0
;
}
...
...
@@ -365,13 +375,6 @@ int vp10_optimize_b(MACROBLOCK *mb, int plane, int block,
qcoeff
[
rc
]
=
x
;
dqcoeff
[
rc
]
=
tokens
[
i
][
best
].
dqc
;
#if CONFIG_NEW_QUANT
dqcoeff
[
rc
]
=
vp10_dequant_abscoeff_nuq
(
abs
(
x
),
dequant_ptr
[
rc
!=
0
],
dequant_val
[
band_translate
[
i
]]);
if
(
shift
)
dqcoeff
[
rc
]
=
ROUND_POWER_OF_TWO
(
dqcoeff
[
rc
],
shift
);
if
(
x
<
0
)
dqcoeff
[
rc
]
=
-
dqcoeff
[
rc
];
#endif // CONFIG_NEW_QUANT
next
=
tokens
[
i
][
best
].
next
;
best
=
best_index
[
i
][
best
];
}
...
...
Write
Preview
Supports
Markdown
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