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
Guillaume Martres
aom-rav1e
Commits
a334cb0b
Commit
a334cb0b
authored
Aug 08, 2014
by
Adrian Grange
Committed by
Gerrit Code Review
Aug 08, 2014
Browse files
Merge "Common encode/decode function to get reference frame"
parents
9a4cd417
1ebf52df
Changes
7
Hide whitespace changes
Inline
Side-by-side
vp9/common/vp9_onyxc_int.h
View file @
a334cb0b
...
...
@@ -202,6 +202,12 @@ typedef struct VP9Common {
ENTROPY_CONTEXT
*
above_context
;
}
VP9_COMMON
;
static
INLINE
YV12_BUFFER_CONFIG
*
get_ref_frame
(
VP9_COMMON
*
cm
,
int
index
)
{
if
(
index
<
0
||
index
>=
REF_FRAMES
)
return
NULL
;
return
&
cm
->
frame_bufs
[
cm
->
ref_frame_map
[
index
]].
buf
;
}
static
INLINE
YV12_BUFFER_CONFIG
*
get_frame_new_buffer
(
VP9_COMMON
*
cm
)
{
return
&
cm
->
frame_bufs
[
cm
->
new_fb_idx
].
buf
;
}
...
...
vp9/decoder/vp9_decoder.c
View file @
a334cb0b
...
...
@@ -181,17 +181,6 @@ vpx_codec_err_t vp9_set_reference_dec(VP9_COMMON *cm,
return
cm
->
error
.
error_code
;
}
int
vp9_get_reference_dec
(
VP9Decoder
*
pbi
,
int
index
,
YV12_BUFFER_CONFIG
**
fb
)
{
VP9_COMMON
*
cm
=
&
pbi
->
common
;
if
(
index
<
0
||
index
>=
REF_FRAMES
)
return
-
1
;
*
fb
=
&
cm
->
frame_bufs
[
cm
->
ref_frame_map
[
index
]].
buf
;
return
0
;
}
/* If any buffer updating is signaled it should be done here. */
static
void
swap_frame_buffers
(
VP9Decoder
*
pbi
)
{
int
ref_index
=
0
,
mask
;
...
...
vp9/decoder/vp9_decoder.h
View file @
a334cb0b
...
...
@@ -74,9 +74,6 @@ vpx_codec_err_t vp9_set_reference_dec(VP9_COMMON *cm,
VP9_REFFRAME
ref_frame_flag
,
YV12_BUFFER_CONFIG
*
sd
);
int
vp9_get_reference_dec
(
struct
VP9Decoder
*
pbi
,
int
index
,
YV12_BUFFER_CONFIG
**
fb
);
struct
VP9Decoder
*
vp9_decoder_create
();
void
vp9_decoder_remove
(
struct
VP9Decoder
*
pbi
);
...
...
vp9/encoder/vp9_encoder.c
View file @
a334cb0b
...
...
@@ -1303,16 +1303,6 @@ int vp9_copy_reference_enc(VP9_COMP *cpi, VP9_REFFRAME ref_frame_flag,
}
}
int
vp9_get_reference_enc
(
VP9_COMP
*
cpi
,
int
index
,
YV12_BUFFER_CONFIG
**
fb
)
{
VP9_COMMON
*
cm
=
&
cpi
->
common
;
if
(
index
<
0
||
index
>=
REF_FRAMES
)
return
-
1
;
*
fb
=
&
cm
->
frame_bufs
[
cm
->
ref_frame_map
[
index
]].
buf
;
return
0
;
}
int
vp9_set_reference_enc
(
VP9_COMP
*
cpi
,
VP9_REFFRAME
ref_frame_flag
,
YV12_BUFFER_CONFIG
*
sd
)
{
YV12_BUFFER_CONFIG
*
cfg
=
get_vp9_ref_frame_buffer
(
cpi
,
ref_frame_flag
);
...
...
vp9/encoder/vp9_encoder.h
View file @
a334cb0b
...
...
@@ -463,9 +463,6 @@ void vp9_update_reference(VP9_COMP *cpi, int ref_frame_flags);
int
vp9_copy_reference_enc
(
VP9_COMP
*
cpi
,
VP9_REFFRAME
ref_frame_flag
,
YV12_BUFFER_CONFIG
*
sd
);
int
vp9_get_reference_enc
(
VP9_COMP
*
cpi
,
int
index
,
YV12_BUFFER_CONFIG
**
fb
);
int
vp9_set_reference_enc
(
VP9_COMP
*
cpi
,
VP9_REFFRAME
ref_frame_flag
,
YV12_BUFFER_CONFIG
*
sd
);
...
...
vp9/vp9_cx_iface.c
View file @
a334cb0b
...
...
@@ -1053,9 +1053,9 @@ static vpx_codec_err_t ctrl_get_reference(vpx_codec_alg_priv_t *ctx,
vp9_ref_frame_t
*
const
frame
=
va_arg
(
args
,
vp9_ref_frame_t
*
);
if
(
frame
!=
NULL
)
{
YV12_BUFFER_CONFIG
*
fb
;
YV12_BUFFER_CONFIG
*
fb
=
get_ref_frame
(
&
ctx
->
cpi
->
common
,
frame
->
idx
);
if
(
fb
==
NULL
)
return
VPX_CODEC_ERROR
;
vp9_get_reference_enc
(
ctx
->
cpi
,
frame
->
idx
,
&
fb
);
yuvconfig2image
(
&
frame
->
img
,
fb
,
NULL
);
return
VPX_CODEC_OK
;
}
else
{
...
...
vp9/vp9_dx_iface.c
View file @
a334cb0b
...
...
@@ -583,9 +583,9 @@ static vpx_codec_err_t ctrl_get_reference(vpx_codec_alg_priv_t *ctx,
vp9_ref_frame_t
*
data
=
va_arg
(
args
,
vp9_ref_frame_t
*
);
if
(
data
)
{
YV12_BUFFER_CONFIG
*
fb
;
YV12_BUFFER_CONFIG
*
fb
=
get_ref_frame
(
&
ctx
->
pbi
->
common
,
data
->
idx
);
if
(
fb
==
NULL
)
return
VPX_CODEC_ERROR
;
vp9_get_reference_dec
(
ctx
->
pbi
,
data
->
idx
,
&
fb
);
yuvconfig2image
(
&
data
->
img
,
fb
,
NULL
);
return
VPX_CODEC_OK
;
}
else
{
...
...
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