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
Xiph.Org
aom-rav1e
Commits
f0923f3b
Commit
f0923f3b
authored
Mar 26, 2013
by
John Koleszar
Committed by
Gerrit Code Review
Mar 26, 2013
Browse files
Merge "Code cleanup." into experimental
parents
49c5841b
7cc14e59
Changes
4
Hide whitespace changes
Inline
Side-by-side
vp9/common/vp9_loopfilter.c
View file @
f0923f3b
...
...
@@ -129,7 +129,7 @@ void vp9_loop_filter_frame_init(VP9_COMMON *cm,
lvl_seg
=
vp9_get_segdata
(
xd
,
seg
,
SEG_LVL_ALT_LF
);
}
else
{
/* Delta Value */
lvl_seg
+=
vp9_get_segdata
(
xd
,
seg
,
SEG_LVL_ALT_LF
);
lvl_seg
=
(
lvl_seg
>
0
)
?
((
lvl_seg
>
63
)
?
63
:
lvl_seg
)
:
0
;
lvl_seg
=
clamp
(
lvl_seg
,
0
,
63
)
;
}
}
...
...
@@ -152,13 +152,12 @@ void vp9_loop_filter_frame_init(VP9_COMMON *cm,
/* Apply delta for Intra modes */
mode
=
0
;
/* B_PRED */
/* Only the split mode BPRED has a further special case */
lvl_mode
=
lvl_ref
+
xd
->
mode_lf_deltas
[
mode
];
lvl_mode
=
(
lvl_mode
>
0
)
?
(
lvl_mode
>
63
?
63
:
lvl_mode
)
:
0
;
/* clamp */
lvl_mode
=
clamp
(
lvl_ref
+
xd
->
mode_lf_deltas
[
mode
],
0
,
63
);
lfi
->
lvl
[
seg
][
ref
][
mode
]
=
lvl_mode
;
mode
=
1
;
/* all the rest of Intra modes */
lvl_mode
=
(
lvl_ref
>
0
)
?
(
lvl_ref
>
63
?
63
:
lvl_ref
)
:
0
;
/* clamp */
lvl_mode
=
clamp
(
lvl_ref
,
0
,
63
);
lfi
->
lvl
[
seg
][
ref
][
mode
]
=
lvl_mode
;
/* LAST, GOLDEN, ALT */
...
...
@@ -170,9 +169,7 @@ void vp9_loop_filter_frame_init(VP9_COMMON *cm,
/* Apply delta for Inter modes */
for
(
mode
=
1
;
mode
<
4
;
mode
++
)
{
lvl_mode
=
lvl_ref
+
xd
->
mode_lf_deltas
[
mode
];
lvl_mode
=
(
lvl_mode
>
0
)
?
(
lvl_mode
>
63
?
63
:
lvl_mode
)
:
0
;
/* clamp */
lvl_mode
=
clamp
(
lvl_ref
+
xd
->
mode_lf_deltas
[
mode
],
0
,
63
);
lfi
->
lvl
[
seg
][
ref
][
mode
]
=
lvl_mode
;
}
}
...
...
@@ -379,16 +376,13 @@ void vp9_loop_filter_partial_frame(VP9_COMMON *cm, MACROBLOCKD *xd,
*/
if
(
alt_flt_enabled
)
{
for
(
i
=
0
;
i
<
MAX_MB_SEGMENTS
;
i
++
)
{
/* Abs value */
if
(
xd
->
mb_segment_abs_delta
==
SEGMENT_ABSDATA
)
{
// Abs value
lvl_seg
[
i
]
=
vp9_get_segdata
(
xd
,
i
,
SEG_LVL_ALT_LF
);
}
/* Delta Value */
else
{
lvl_seg
[
i
]
=
default_filt_lvl
+
vp9_get_segdata
(
xd
,
i
,
SEG_LVL_ALT_LF
);
lvl_seg
[
i
]
=
(
lvl_seg
[
i
]
>
0
)
?
((
lvl_seg
[
i
]
>
63
)
?
63
:
lvl_seg
[
i
])
:
0
;
}
else
{
// Delta Value
lvl_seg
[
i
]
=
default_filt_lvl
+
vp9_get_segdata
(
xd
,
i
,
SEG_LVL_ALT_LF
);
lvl_seg
[
i
]
=
clamp
(
lvl_seg
[
i
],
0
,
63
);
}
}
}
...
...
vp9/common/vp9_quant_common.c
View file @
f0923f3b
...
...
@@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "vp9/common/vp9_common.h"
#include "vp9/common/vp9_quant_common.h"
static
int
dc_qlookup
[
QINDEX_RANGE
];
...
...
@@ -24,7 +24,7 @@ void vp9_init_quant_tables() {
for
(
i
=
0
;
i
<
QINDEX_RANGE
;
i
++
)
{
ac_qlookup
[
i
]
=
current_val
;
current_val
=
(
int
)(
(
double
)
current_val
*
1
.
02
);
current_val
=
(
int
)(
current_val
*
1
.
02
);
if
(
current_val
==
last_val
)
current_val
++
;
last_val
=
current_val
;
...
...
@@ -38,57 +38,18 @@ void vp9_init_quant_tables() {
}
}
int
vp9_dc_quant
(
int
QIndex
,
int
Delta
)
{
int
retval
;
QIndex
=
QIndex
+
Delta
;
if
(
QIndex
>
MAXQ
)
QIndex
=
MAXQ
;
else
if
(
QIndex
<
0
)
QIndex
=
0
;
retval
=
dc_qlookup
[
QIndex
];
return
retval
;
int
vp9_dc_quant
(
int
qindex
,
int
delta
)
{
return
dc_qlookup
[
clamp
(
qindex
+
delta
,
0
,
MAXQ
)];
}
int
vp9_dc_uv_quant
(
int
QIndex
,
int
Delta
)
{
int
retval
;
QIndex
=
QIndex
+
Delta
;
if
(
QIndex
>
MAXQ
)
QIndex
=
MAXQ
;
else
if
(
QIndex
<
0
)
QIndex
=
0
;
retval
=
dc_qlookup
[
QIndex
];
return
retval
;
int
vp9_dc_uv_quant
(
int
qindex
,
int
delta
)
{
return
dc_qlookup
[
clamp
(
qindex
+
delta
,
0
,
MAXQ
)];
}
int
vp9_ac_yquant
(
int
QIndex
)
{
int
retval
;
if
(
QIndex
>
MAXQ
)
QIndex
=
MAXQ
;
else
if
(
QIndex
<
0
)
QIndex
=
0
;
retval
=
ac_qlookup
[
QIndex
];
return
retval
;
int
vp9_ac_yquant
(
int
qindex
)
{
return
ac_qlookup
[
clamp
(
qindex
,
0
,
MAXQ
)];
}
int
vp9_ac_uv_quant
(
int
QIndex
,
int
Delta
)
{
int
retval
;
QIndex
=
QIndex
+
Delta
;
if
(
QIndex
>
MAXQ
)
QIndex
=
MAXQ
;
else
if
(
QIndex
<
0
)
QIndex
=
0
;
retval
=
ac_qlookup
[
QIndex
];
return
retval
;
int
vp9_ac_uv_quant
(
int
qindex
,
int
delta
)
{
return
ac_qlookup
[
clamp
(
qindex
+
delta
,
0
,
MAXQ
)];
}
vp9/common/vp9_quant_common.h
View file @
f0923f3b
...
...
@@ -11,16 +11,15 @@
#ifndef VP9_COMMON_VP9_QUANT_COMMON_H_
#define VP9_COMMON_VP9_QUANT_COMMON_H_
#include "string.h"
#include "vp9/common/vp9_blockd.h"
#include "vp9/common/vp9_onyxc_int.h"
extern
void
vp9_init_quant_tables
(
void
);
extern
int
vp9_ac_yquant
(
int
QI
ndex
);
extern
int
vp9_dc_quant
(
int
QI
ndex
,
int
D
elta
);
extern
int
vp9_dc2quant
(
int
QI
ndex
,
int
D
elta
);
extern
int
vp9_ac2quant
(
int
QI
ndex
,
int
D
elta
);
extern
int
vp9_dc_uv_quant
(
int
QI
ndex
,
int
D
elta
);
extern
int
vp9_ac_uv_quant
(
int
QI
ndex
,
int
D
elta
);
void
vp9_init_quant_tables
();
int
vp9_ac_yquant
(
int
qi
ndex
);
int
vp9_dc_quant
(
int
qi
ndex
,
int
d
elta
);
int
vp9_dc2quant
(
int
qi
ndex
,
int
d
elta
);
int
vp9_ac2quant
(
int
qi
ndex
,
int
d
elta
);
int
vp9_dc_uv_quant
(
int
qi
ndex
,
int
d
elta
);
int
vp9_ac_uv_quant
(
int
qi
ndex
,
int
d
elta
);
#endif // VP9_COMMON_VP9_QUANT_COMMON_H_
vp9/decoder/vp9_decodframe.c
View file @
f0923f3b
...
...
@@ -1291,7 +1291,7 @@ int vp9_decode_frame(VP9D_COMP *pbi, const unsigned char **p_data_end) {
pc
->
version
=
(
data
[
0
]
>>
1
)
&
7
;
pc
->
show_frame
=
(
data
[
0
]
>>
4
)
&
1
;
scaling_active
=
(
data
[
0
]
>>
5
)
&
1
;
first_partition_length_in_bytes
=
data
[
1
]
|
(
data
[
2
]
<<
8
);
first_partition_length_in_bytes
=
read_le16
(
data
+
1
);
if
(
!
read_is_valid
(
data
,
first_partition_length_in_bytes
,
data_end
))
vpx_internal_error
(
&
pc
->
error
,
VPX_CODEC_CORRUPT_FRAME
,
...
...
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