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
6e4ed2f0
Commit
6e4ed2f0
authored
May 01, 2013
by
Dmitry Kovalev
Committed by
Gerrit Code Review
May 01, 2013
Browse files
Merge "Adding vp9_get_qindex function." into experimental
parents
d139655b
3f6c6ffc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
39 deletions
+24
-39
vp9/common/vp9_onyxc_int.h
vp9/common/vp9_onyxc_int.h
+1
-7
vp9/common/vp9_quant_common.c
vp9/common/vp9_quant_common.c
+14
-0
vp9/common/vp9_quant_common.h
vp9/common/vp9_quant_common.h
+7
-1
vp9/decoder/vp9_decodframe.c
vp9/decoder/vp9_decodframe.c
+1
-13
vp9/encoder/vp9_quantize.c
vp9/encoder/vp9_quantize.c
+1
-18
No files found.
vp9/common/vp9_onyxc_int.h
View file @
6e4ed2f0
...
...
@@ -18,6 +18,7 @@
#include "vp9/common/vp9_entropymv.h"
#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_entropymode.h"
#include "vp9/common/vp9_quant_common.h"
#if CONFIG_POSTPROC
#include "vp9/common/vp9_postproc.h"
...
...
@@ -31,13 +32,6 @@
void
vp9_initialize_common
(
void
);
#define MINQ 0
#define MAXQ 255
#define QINDEX_BITS 8
#define QINDEX_RANGE (MAXQ + 1)
#if CONFIG_MULTIPLE_ARF
#define NUM_REF_FRAMES 8
#define NUM_REF_FRAMES_LG2 3
...
...
vp9/common/vp9_quant_common.c
View file @
6e4ed2f0
...
...
@@ -10,6 +10,7 @@
#include "vp9/common/vp9_common.h"
#include "vp9/common/vp9_quant_common.h"
#include "vp9/common/vp9_seg_common.h"
static
int16_t
dc_qlookup
[
QINDEX_RANGE
];
static
int16_t
ac_qlookup
[
QINDEX_RANGE
];
...
...
@@ -44,3 +45,16 @@ int16_t vp9_dc_quant(int qindex, int delta) {
int16_t
vp9_ac_quant
(
int
qindex
,
int
delta
)
{
return
ac_qlookup
[
clamp
(
qindex
+
delta
,
0
,
MAXQ
)];
}
int
vp9_get_qindex
(
MACROBLOCKD
*
xd
,
int
segment_id
,
int
base_qindex
)
{
if
(
vp9_segfeature_active
(
xd
,
segment_id
,
SEG_LVL_ALT_Q
))
{
const
int
data
=
vp9_get_segdata
(
xd
,
segment_id
,
SEG_LVL_ALT_Q
);
return
xd
->
mb_segment_abs_delta
==
SEGMENT_ABSDATA
?
data
:
// Abs value
clamp
(
base_qindex
+
data
,
0
,
MAXQ
);
// Delta value
}
else
{
return
base_qindex
;
}
}
vp9/common/vp9_quant_common.h
View file @
6e4ed2f0
...
...
@@ -12,11 +12,17 @@
#define VP9_COMMON_VP9_QUANT_COMMON_H_
#include "vp9/common/vp9_blockd.h"
#include "vp9/common/vp9_onyxc_int.h"
#define MINQ 0
#define MAXQ 255
#define QINDEX_RANGE (MAXQ - MINQ + 1)
#define QINDEX_BITS 8
void
vp9_init_quant_tables
();
int16_t
vp9_dc_quant
(
int
qindex
,
int
delta
);
int16_t
vp9_ac_quant
(
int
qindex
,
int
delta
);
int
vp9_get_qindex
(
MACROBLOCKD
*
mb
,
int
segment_id
,
int
base_qindex
);
#endif // VP9_COMMON_VP9_QUANT_COMMON_H_
vp9/decoder/vp9_decodframe.c
View file @
6e4ed2f0
...
...
@@ -181,22 +181,10 @@ void vp9_init_dequantizer(VP9_COMMON *pc) {
}
}
static
int
get_qindex
(
MACROBLOCKD
*
mb
,
int
segment_id
,
int
base_qindex
)
{
// Set the Q baseline allowing for any segment level adjustment
if
(
vp9_segfeature_active
(
mb
,
segment_id
,
SEG_LVL_ALT_Q
))
{
const
int
data
=
vp9_get_segdata
(
mb
,
segment_id
,
SEG_LVL_ALT_Q
);
return
mb
->
mb_segment_abs_delta
==
SEGMENT_ABSDATA
?
data
:
// Abs value
clamp
(
base_qindex
+
data
,
0
,
MAXQ
);
// Delta value
}
else
{
return
base_qindex
;
}
}
static
void
mb_init_dequantizer
(
VP9_COMMON
*
pc
,
MACROBLOCKD
*
xd
)
{
int
i
;
const
int
segment_id
=
xd
->
mode_info_context
->
mbmi
.
segment_id
;
xd
->
q_index
=
get_qindex
(
xd
,
segment_id
,
pc
->
base_qindex
);
xd
->
q_index
=
vp9_
get_qindex
(
xd
,
segment_id
,
pc
->
base_qindex
);
xd
->
plane
[
0
].
dequant
=
pc
->
y_dequant
[
xd
->
q_index
];
for
(
i
=
1
;
i
<
MAX_MB_PLANE
;
i
++
)
...
...
vp9/encoder/vp9_quantize.c
View file @
6e4ed2f0
...
...
@@ -318,27 +318,10 @@ void vp9_init_quantizer(VP9_COMP *cpi) {
void
vp9_mb_init_quantizer
(
VP9_COMP
*
cpi
,
MACROBLOCK
*
x
)
{
int
i
;
int
qindex
;
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
))
{
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
qindex
=
clamp
(
qindex
,
0
,
MAXQ
);
}
}
else
{
qindex
=
cpi
->
common
.
base_qindex
;
}
const
int
qindex
=
vp9_get_qindex
(
xd
,
segment_id
,
cpi
->
common
.
base_qindex
);
// Y
zbin_extra
=
(
cpi
->
common
.
y_dequant
[
qindex
][
1
]
*
...
...
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