Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
external
libvpx
Commits
0cef7234
Commit
0cef7234
authored
Apr 10, 2013
by
Dmitry Kovalev
Committed by
Gerrit Code Review
Apr 10, 2013
Browse files
Merge "Fixing upper case names." into experimental
parents
1c6df34c
c34f6fcb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
62 deletions
+52
-62
vp9/common/vp9_onyxc_int.h
vp9/common/vp9_onyxc_int.h
+2
-2
vp9/decoder/vp9_decodframe.c
vp9/decoder/vp9_decodframe.c
+7
-7
vp9/encoder/vp9_quantize.c
vp9/encoder/vp9_quantize.c
+43
-53
No files found.
vp9/common/vp9_onyxc_int.h
View file @
0cef7234
...
...
@@ -169,8 +169,8 @@ typedef enum {
typedef
struct
VP9Common
{
struct
vpx_internal_error_info
error
;
DECLARE_ALIGNED
(
16
,
int16_t
,
Y1
dequant
[
QINDEX_RANGE
][
16
]);
DECLARE_ALIGNED
(
16
,
int16_t
,
UV
dequant
[
QINDEX_RANGE
][
16
]);
DECLARE_ALIGNED
(
16
,
int16_t
,
y_
dequant
[
QINDEX_RANGE
][
16
]);
DECLARE_ALIGNED
(
16
,
int16_t
,
uv_
dequant
[
QINDEX_RANGE
][
16
]);
int
width
;
int
height
;
...
...
vp9/decoder/vp9_decodframe.c
View file @
0cef7234
...
...
@@ -102,15 +102,15 @@ void vp9_init_de_quantizer(VP9D_COMP *pbi) {
VP9_COMMON
*
const
pc
=
&
pbi
->
common
;
for
(
q
=
0
;
q
<
QINDEX_RANGE
;
q
++
)
{
pc
->
Y1
dequant
[
q
][
0
]
=
(
int16_t
)
vp9_dc_quant
(
q
,
pc
->
y1dc_delta_q
);
pc
->
UV
dequant
[
q
][
0
]
=
(
int16_t
)
vp9_dc_uv_quant
(
q
,
pc
->
uvdc_delta_q
);
pc
->
y_
dequant
[
q
][
0
]
=
(
int16_t
)
vp9_dc_quant
(
q
,
pc
->
y1dc_delta_q
);
pc
->
uv_
dequant
[
q
][
0
]
=
(
int16_t
)
vp9_dc_uv_quant
(
q
,
pc
->
uvdc_delta_q
);
/* all the ac values =; */
for
(
i
=
1
;
i
<
16
;
i
++
)
{
const
int
rc
=
vp9_default_zig_zag1d_4x4
[
i
];
pc
->
Y1
dequant
[
q
][
rc
]
=
(
int16_t
)
vp9_ac_yquant
(
q
);
pc
->
UV
dequant
[
q
][
rc
]
=
(
int16_t
)
vp9_ac_uv_quant
(
q
,
pc
->
uvac_delta_q
);
pc
->
y_
dequant
[
q
][
rc
]
=
(
int16_t
)
vp9_ac_yquant
(
q
);
pc
->
uv_
dequant
[
q
][
rc
]
=
(
int16_t
)
vp9_ac_uv_quant
(
q
,
pc
->
uvac_delta_q
);
}
}
}
...
...
@@ -136,10 +136,10 @@ static void mb_init_dequantizer(VP9D_COMP *pbi, MACROBLOCKD *mb) {
mb
->
q_index
=
qindex
;
for
(
i
=
0
;
i
<
16
;
i
++
)
mb
->
block
[
i
].
dequant
=
pc
->
Y1
dequant
[
qindex
];
mb
->
block
[
i
].
dequant
=
pc
->
y_
dequant
[
qindex
];
for
(
i
=
16
;
i
<
24
;
i
++
)
mb
->
block
[
i
].
dequant
=
pc
->
UV
dequant
[
qindex
];
mb
->
block
[
i
].
dequant
=
pc
->
uv_
dequant
[
qindex
];
if
(
mb
->
lossless
)
{
assert
(
qindex
==
0
);
...
...
@@ -241,7 +241,7 @@ static void decode_16x16(VP9D_COMP *pbi, MACROBLOCKD *xd,
xd
->
predictor
+
16
*
16
,
xd
->
dst
.
u_buffer
,
8
,
xd
->
dst
.
uv_stride
,
xd
->
plane
[
1
].
eobs
[
0
]);
vp9_dequant_idct_add_8x8
(
xd
->
plane
[
2
].
qcoeff
,
xd
->
block
[
16
].
dequant
,
vp9_dequant_idct_add_8x8
(
xd
->
plane
[
2
].
qcoeff
,
xd
->
block
[
20
].
dequant
,
xd
->
predictor
+
16
*
16
+
64
,
xd
->
dst
.
v_buffer
,
8
,
xd
->
dst
.
uv_stride
,
xd
->
plane
[
2
].
eobs
[
0
]);
}
...
...
vp9/encoder/vp9_quantize.c
View file @
0cef7234
...
...
@@ -626,14 +626,14 @@ void vp9_init_quantizer(VP9_COMP *cpi) {
invert_quant
(
cpi
->
Y1quant
[
q
]
+
0
,
cpi
->
Y1quant_shift
[
q
]
+
0
,
quant_val
);
cpi
->
Y1zbin
[
q
][
0
]
=
ROUND_POWER_OF_TWO
(
qzbin_factor
*
quant_val
,
7
);
cpi
->
Y1round
[
q
][
0
]
=
(
qrounding_factor
*
quant_val
)
>>
7
;
cpi
->
common
.
Y1
dequant
[
q
][
0
]
=
quant_val
;
cpi
->
common
.
y_
dequant
[
q
][
0
]
=
quant_val
;
cpi
->
zrun_zbin_boost_y1
[
q
][
0
]
=
(
quant_val
*
zbin_boost
[
0
])
>>
7
;
quant_val
=
vp9_dc_uv_quant
(
q
,
cpi
->
common
.
uvdc_delta_q
);
invert_quant
(
cpi
->
UVquant
[
q
]
+
0
,
cpi
->
UVquant_shift
[
q
]
+
0
,
quant_val
);
cpi
->
UVzbin
[
q
][
0
]
=
ROUND_POWER_OF_TWO
(
qzbin_factor
*
quant_val
,
7
);
cpi
->
UVround
[
q
][
0
]
=
(
qrounding_factor
*
quant_val
)
>>
7
;
cpi
->
common
.
UV
dequant
[
q
][
0
]
=
quant_val
;
cpi
->
common
.
uv_
dequant
[
q
][
0
]
=
quant_val
;
cpi
->
zrun_zbin_boost_uv
[
q
][
0
]
=
(
quant_val
*
zbin_boost
[
0
])
>>
7
;
// all the 4x4 ac values =;
...
...
@@ -644,7 +644,7 @@ void vp9_init_quantizer(VP9_COMP *cpi) {
invert_quant
(
cpi
->
Y1quant
[
q
]
+
rc
,
cpi
->
Y1quant_shift
[
q
]
+
rc
,
quant_val
);
cpi
->
Y1zbin
[
q
][
rc
]
=
ROUND_POWER_OF_TWO
(
qzbin_factor
*
quant_val
,
7
);
cpi
->
Y1round
[
q
][
rc
]
=
(
qrounding_factor
*
quant_val
)
>>
7
;
cpi
->
common
.
Y1
dequant
[
q
][
rc
]
=
quant_val
;
cpi
->
common
.
y_
dequant
[
q
][
rc
]
=
quant_val
;
cpi
->
zrun_zbin_boost_y1
[
q
][
i
]
=
ROUND_POWER_OF_TWO
(
quant_val
*
zbin_boost
[
i
],
7
);
...
...
@@ -652,7 +652,7 @@ void vp9_init_quantizer(VP9_COMP *cpi) {
invert_quant
(
cpi
->
UVquant
[
q
]
+
rc
,
cpi
->
UVquant_shift
[
q
]
+
rc
,
quant_val
);
cpi
->
UVzbin
[
q
][
rc
]
=
ROUND_POWER_OF_TWO
(
qzbin_factor
*
quant_val
,
7
);
cpi
->
UVround
[
q
][
rc
]
=
(
qrounding_factor
*
quant_val
)
>>
7
;
cpi
->
common
.
UV
dequant
[
q
][
rc
]
=
quant_val
;
cpi
->
common
.
uv_
dequant
[
q
][
rc
]
=
quant_val
;
cpi
->
zrun_zbin_boost_uv
[
q
][
i
]
=
ROUND_POWER_OF_TWO
(
quant_val
*
zbin_boost
[
i
],
7
);
}
...
...
@@ -661,40 +661,39 @@ void vp9_init_quantizer(VP9_COMP *cpi) {
void
vp9_mb_init_quantizer
(
VP9_COMP
*
cpi
,
MACROBLOCK
*
x
)
{
int
i
;
int
QI
ndex
;
int
qi
ndex
;
MACROBLOCKD
*
xd
=
&
x
->
e_mbd
;
int
zbin_extra
;
int
segment_id
=
xd
->
mode_info_context
->
mbmi
.
segment_id
;
// Select the baseline MB Q index allowing for any segment level change.
if
(
vp9_segfeature_active
(
xd
,
segment_id
,
SEG_LVL_ALT_Q
))
{
// Abs Value
if
(
xd
->
mb_segment_abs_delta
==
SEGMENT_ABSDATA
)
QIndex
=
vp9_get_segdata
(
xd
,
segment_id
,
SEG_LVL_ALT_Q
);
// Delta Value
else
{
QIndex
=
cpi
->
common
.
base_qindex
+
vp9_get_segdata
(
xd
,
segment_id
,
SEG_LVL_ALT_Q
);
if
(
xd
->
mb_segment_abs_delta
==
SEGMENT_ABSDATA
)
{
// Abs Value
qindex
=
vp9_get_segdata
(
xd
,
segment_id
,
SEG_LVL_ALT_Q
);
}
else
{
// Delta Value
qindex
=
cpi
->
common
.
base_qindex
+
vp9_get_segdata
(
xd
,
segment_id
,
SEG_LVL_ALT_Q
);
// Clamp to valid range
QI
ndex
=
(
QIndex
>=
0
)
?
((
QIndex
<=
MAXQ
)
?
QIndex
:
MAXQ
)
:
0
;
qi
ndex
=
clamp
(
qindex
,
0
,
MAXQ
)
;
}
}
else
QIndex
=
cpi
->
common
.
base_qindex
;
}
else
{
qindex
=
cpi
->
common
.
base_qindex
;
}
// Y
zbin_extra
=
(
cpi
->
common
.
Y1dequant
[
QIndex
][
1
]
*
(
cpi
->
zbin_mode_boost
+
x
->
act_zbin_adj
))
>>
7
;
zbin_extra
=
(
cpi
->
common
.
y_dequant
[
qindex
][
1
]
*
(
cpi
->
zbin_mode_boost
+
x
->
act_zbin_adj
))
>>
7
;
for
(
i
=
0
;
i
<
16
;
i
++
)
{
x
->
block
[
i
].
quant
=
cpi
->
Y1quant
[
QI
ndex
];
x
->
block
[
i
].
quant_shift
=
cpi
->
Y1quant_shift
[
QI
ndex
];
x
->
block
[
i
].
zbin
=
cpi
->
Y1zbin
[
QI
ndex
];
x
->
block
[
i
].
round
=
cpi
->
Y1round
[
QI
ndex
];
x
->
e_mbd
.
block
[
i
].
dequant
=
cpi
->
common
.
Y1
dequant
[
QI
ndex
];
x
->
block
[
i
].
zrun_zbin_boost
=
cpi
->
zrun_zbin_boost_y1
[
QI
ndex
];
x
->
block
[
i
].
quant
=
cpi
->
Y1quant
[
qi
ndex
];
x
->
block
[
i
].
quant_shift
=
cpi
->
Y1quant_shift
[
qi
ndex
];
x
->
block
[
i
].
zbin
=
cpi
->
Y1zbin
[
qi
ndex
];
x
->
block
[
i
].
round
=
cpi
->
Y1round
[
qi
ndex
];
x
->
e_mbd
.
block
[
i
].
dequant
=
cpi
->
common
.
y_
dequant
[
qi
ndex
];
x
->
block
[
i
].
zrun_zbin_boost
=
cpi
->
zrun_zbin_boost_y1
[
qi
ndex
];
x
->
block
[
i
].
zbin_extra
=
(
int16_t
)
zbin_extra
;
// Segment skip feature.
...
...
@@ -703,49 +702,40 @@ void vp9_mb_init_quantizer(VP9_COMP *cpi, MACROBLOCK *x) {
}
// UV
zbin_extra
=
(
cpi
->
common
.
UVdequant
[
QIndex
][
1
]
*
(
cpi
->
zbin_mode_boost
+
x
->
act_zbin_adj
))
>>
7
;
zbin_extra
=
(
cpi
->
common
.
uv_dequant
[
qindex
][
1
]
*
(
cpi
->
zbin_mode_boost
+
x
->
act_zbin_adj
))
>>
7
;
for
(
i
=
16
;
i
<
24
;
i
++
)
{
x
->
block
[
i
].
quant
=
cpi
->
UVquant
[
QI
ndex
];
x
->
block
[
i
].
quant_shift
=
cpi
->
UVquant_shift
[
QI
ndex
];
x
->
block
[
i
].
zbin
=
cpi
->
UVzbin
[
QI
ndex
];
x
->
block
[
i
].
round
=
cpi
->
UVround
[
QI
ndex
];
x
->
e_mbd
.
block
[
i
].
dequant
=
cpi
->
common
.
UV
dequant
[
QI
ndex
];
x
->
block
[
i
].
zrun_zbin_boost
=
cpi
->
zrun_zbin_boost_uv
[
QI
ndex
];
x
->
block
[
i
].
quant
=
cpi
->
UVquant
[
qi
ndex
];
x
->
block
[
i
].
quant_shift
=
cpi
->
UVquant_shift
[
qi
ndex
];
x
->
block
[
i
].
zbin
=
cpi
->
UVzbin
[
qi
ndex
];
x
->
block
[
i
].
round
=
cpi
->
UVround
[
qi
ndex
];
x
->
e_mbd
.
block
[
i
].
dequant
=
cpi
->
common
.
uv_
dequant
[
qi
ndex
];
x
->
block
[
i
].
zrun_zbin_boost
=
cpi
->
zrun_zbin_boost_uv
[
qi
ndex
];
x
->
block
[
i
].
zbin_extra
=
(
int16_t
)
zbin_extra
;
// Segment skip feature.
x
->
block
[
i
].
skip_block
=
vp9_segfeature_active
(
xd
,
segment_id
,
SEG_LVL_SKIP
);
vp9_segfeature_active
(
xd
,
segment_id
,
SEG_LVL_SKIP
);
}
/* save this macroblock QIndex for vp9_update_zbin_extra() */
x
->
e_mbd
.
q_index
=
QI
ndex
;
x
->
e_mbd
.
q_index
=
qi
ndex
;
}
void
vp9_update_zbin_extra
(
VP9_COMP
*
cpi
,
MACROBLOCK
*
x
)
{
int
i
;
int
QIndex
=
x
->
e_mbd
.
q_index
;
int
zbin_extra
;
// Y
zbin_extra
=
(
cpi
->
common
.
Y1dequant
[
QIndex
][
1
]
*
(
cpi
->
zbin_mode_boost
+
x
->
act_zbin_adj
))
>>
7
;
for
(
i
=
0
;
i
<
16
;
i
++
)
{
x
->
block
[
i
].
zbin_extra
=
(
int16_t
)
zbin_extra
;
}
const
int
qindex
=
x
->
e_mbd
.
q_index
;
const
int
y_zbin_extra
=
(
cpi
->
common
.
y_dequant
[
qindex
][
1
]
*
(
cpi
->
zbin_mode_boost
+
x
->
act_zbin_adj
))
>>
7
;
const
int
uv_zbin_extra
=
(
cpi
->
common
.
uv_dequant
[
qindex
][
1
]
*
(
cpi
->
zbin_mode_boost
+
x
->
act_zbin_adj
))
>>
7
;
// UV
zbin_extra
=
(
cpi
->
common
.
UVdequant
[
QIndex
][
1
]
*
(
cpi
->
zbin_mode_boost
+
x
->
act_zbin_adj
))
>>
7
;
for
(
i
=
0
;
i
<
16
;
i
++
)
x
->
block
[
i
].
zbin_extra
=
(
int16_t
)
y_zbin_extra
;
for
(
i
=
16
;
i
<
24
;
i
++
)
{
x
->
block
[
i
].
zbin_extra
=
(
int16_t
)
zbin_extra
;
}
for
(
i
=
16
;
i
<
24
;
i
++
)
x
->
block
[
i
].
zbin_extra
=
(
int16_t
)
uv_zbin_extra
;
}
void
vp9_frame_init_quantizer
(
VP9_COMP
*
cpi
)
{
...
...
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