Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
3ba98577
Commit
3ba98577
authored
May 15, 2013
by
Dmitry Kovalev
Committed by
Gerrit Code Review
May 15, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Adding alpha plane to YV12_BUFFER_CONFIG structure." into experimental
parents
cd16fe91
b7a4f8a6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
51 deletions
+42
-51
vp9/vp9_cx_iface.c
vp9/vp9_cx_iface.c
+0
-25
vp9/vp9_dx_iface.c
vp9/vp9_dx_iface.c
+0
-24
vp9/vp9_iface_common.h
vp9/vp9_iface_common.h
+32
-2
vpx_scale/generic/yv12config.c
vpx_scale/generic/yv12config.c
+5
-0
vpx_scale/yv12config.h
vpx_scale/yv12config.h
+5
-0
No files found.
vp9/vp9_cx_iface.c
View file @
3ba98577
...
...
@@ -543,31 +543,6 @@ static vpx_codec_err_t vp8e_destroy(vpx_codec_alg_priv_t *ctx) {
return
VPX_CODEC_OK
;
}
static
vpx_codec_err_t
image2yuvconfig
(
const
vpx_image_t
*
img
,
YV12_BUFFER_CONFIG
*
yv12
)
{
vpx_codec_err_t
res
=
VPX_CODEC_OK
;
yv12
->
y_buffer
=
img
->
planes
[
VPX_PLANE_Y
];
yv12
->
u_buffer
=
img
->
planes
[
VPX_PLANE_U
];
yv12
->
v_buffer
=
img
->
planes
[
VPX_PLANE_V
];
yv12
->
y_crop_width
=
img
->
d_w
;
yv12
->
y_crop_height
=
img
->
d_h
;
yv12
->
y_width
=
img
->
d_w
;
yv12
->
y_height
=
img
->
d_h
;
yv12
->
uv_width
=
img
->
x_chroma_shift
==
1
?
(
1
+
yv12
->
y_width
)
/
2
:
yv12
->
y_width
;
yv12
->
uv_height
=
img
->
y_chroma_shift
==
1
?
(
1
+
yv12
->
y_height
)
/
2
:
yv12
->
y_height
;
yv12
->
y_stride
=
img
->
stride
[
VPX_PLANE_Y
];
yv12
->
uv_stride
=
img
->
stride
[
VPX_PLANE_U
];
yv12
->
border
=
(
img
->
stride
[
VPX_PLANE_Y
]
-
img
->
w
)
/
2
;
yv12
->
clrtype
=
REG_YUV
;
return
res
;
}
static
void
pick_quickcompress_mode
(
vpx_codec_alg_priv_t
*
ctx
,
unsigned
long
duration
,
unsigned
long
deadline
)
{
...
...
vp9/vp9_dx_iface.c
View file @
3ba98577
...
...
@@ -578,30 +578,6 @@ static vpx_codec_err_t vp8_xma_set_mmap(vpx_codec_ctx_t *ctx,
return
res
;
}
static
vpx_codec_err_t
image2yuvconfig
(
const
vpx_image_t
*
img
,
YV12_BUFFER_CONFIG
*
yv12
)
{
vpx_codec_err_t
res
=
VPX_CODEC_OK
;
yv12
->
y_buffer
=
img
->
planes
[
VPX_PLANE_Y
];
yv12
->
u_buffer
=
img
->
planes
[
VPX_PLANE_U
];
yv12
->
v_buffer
=
img
->
planes
[
VPX_PLANE_V
];
yv12
->
y_crop_width
=
img
->
d_w
;
yv12
->
y_crop_height
=
img
->
d_h
;
yv12
->
y_width
=
img
->
d_w
;
yv12
->
y_height
=
img
->
d_h
;
yv12
->
uv_width
=
yv12
->
y_width
/
2
;
yv12
->
uv_height
=
yv12
->
y_height
/
2
;
yv12
->
y_stride
=
img
->
stride
[
VPX_PLANE_Y
];
yv12
->
uv_stride
=
img
->
stride
[
VPX_PLANE_U
];
yv12
->
border
=
(
img
->
stride
[
VPX_PLANE_Y
]
-
img
->
d_w
)
/
2
;
yv12
->
clrtype
=
(
img
->
fmt
==
VPX_IMG_FMT_VPXI420
||
img
->
fmt
==
VPX_IMG_FMT_VPXYV12
);
return
res
;
}
static
vpx_codec_err_t
vp9_set_reference
(
vpx_codec_alg_priv_t
*
ctx
,
int
ctr_id
,
...
...
vp9/vp9_iface_common.h
View file @
3ba98577
...
...
@@ -37,11 +37,11 @@ static void yuvconfig2image(vpx_image_t *img, const YV12_BUFFER_CONFIG *yv12,
img
->
planes
[
VPX_PLANE_Y
]
=
yv12
->
y_buffer
;
img
->
planes
[
VPX_PLANE_U
]
=
yv12
->
u_buffer
;
img
->
planes
[
VPX_PLANE_V
]
=
yv12
->
v_buffer
;
img
->
planes
[
VPX_PLANE_ALPHA
]
=
NULL
;
img
->
planes
[
VPX_PLANE_ALPHA
]
=
yv12
->
alpha_buffer
;
img
->
stride
[
VPX_PLANE_Y
]
=
yv12
->
y_stride
;
img
->
stride
[
VPX_PLANE_U
]
=
yv12
->
uv_stride
;
img
->
stride
[
VPX_PLANE_V
]
=
yv12
->
uv_stride
;
img
->
stride
[
VPX_PLANE_ALPHA
]
=
yv12
->
y
_stride
;
img
->
stride
[
VPX_PLANE_ALPHA
]
=
yv12
->
alpha
_stride
;
img
->
bps
=
bps
;
img
->
user_priv
=
user_priv
;
img
->
img_data
=
yv12
->
buffer_alloc
;
...
...
@@ -49,4 +49,34 @@ static void yuvconfig2image(vpx_image_t *img, const YV12_BUFFER_CONFIG *yv12,
img
->
self_allocd
=
0
;
}
static
vpx_codec_err_t
image2yuvconfig
(
const
vpx_image_t
*
img
,
YV12_BUFFER_CONFIG
*
yv12
)
{
yv12
->
y_buffer
=
img
->
planes
[
VPX_PLANE_Y
];
yv12
->
u_buffer
=
img
->
planes
[
VPX_PLANE_U
];
yv12
->
v_buffer
=
img
->
planes
[
VPX_PLANE_V
];
yv12
->
alpha_buffer
=
img
->
planes
[
VPX_PLANE_ALPHA
];
yv12
->
y_crop_width
=
img
->
d_w
;
yv12
->
y_crop_height
=
img
->
d_h
;
yv12
->
y_width
=
img
->
d_w
;
yv12
->
y_height
=
img
->
d_h
;
yv12
->
uv_width
=
img
->
x_chroma_shift
==
1
?
(
1
+
yv12
->
y_width
)
/
2
:
yv12
->
y_width
;
yv12
->
uv_height
=
img
->
y_chroma_shift
==
1
?
(
1
+
yv12
->
y_height
)
/
2
:
yv12
->
y_height
;
yv12
->
alpha_width
=
yv12
->
alpha_buffer
?
img
->
d_w
:
0
;
yv12
->
alpha_height
=
yv12
->
alpha_buffer
?
img
->
d_h
:
0
;
yv12
->
y_stride
=
img
->
stride
[
VPX_PLANE_Y
];
yv12
->
uv_stride
=
img
->
stride
[
VPX_PLANE_U
];
yv12
->
alpha_stride
=
yv12
->
alpha_buffer
?
img
->
stride
[
VPX_PLANE_ALPHA
]
:
0
;
yv12
->
border
=
(
img
->
stride
[
VPX_PLANE_Y
]
-
img
->
w
)
/
2
;
yv12
->
clrtype
=
REG_YUV
;
return
VPX_CODEC_OK
;
}
#endif // VP9_VP9_IFACE_COMMON_H_
vpx_scale/generic/yv12config.c
View file @
3ba98577
...
...
@@ -76,12 +76,17 @@ int vp8_yv12_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
ybf
->
uv_height
=
uv_height
;
ybf
->
uv_stride
=
uv_stride
;
ybf
->
alpha_width
=
0
;
ybf
->
alpha_height
=
0
;
ybf
->
alpha_stride
=
0
;
ybf
->
border
=
border
;
ybf
->
frame_size
=
frame_size
;
ybf
->
y_buffer
=
ybf
->
buffer_alloc
+
(
border
*
y_stride
)
+
border
;
ybf
->
u_buffer
=
ybf
->
buffer_alloc
+
yplane_size
+
(
border
/
2
*
uv_stride
)
+
border
/
2
;
ybf
->
v_buffer
=
ybf
->
buffer_alloc
+
yplane_size
+
uvplane_size
+
(
border
/
2
*
uv_stride
)
+
border
/
2
;
ybf
->
alpha_buffer
=
NULL
;
ybf
->
corrupted
=
0
;
/* assume not currupted by errors */
return
0
;
...
...
vpx_scale/yv12config.h
View file @
3ba98577
...
...
@@ -52,9 +52,14 @@ extern "C" {
int
uv_stride
;
/* int uvinternal_width; */
int
alpha_width
;
int
alpha_height
;
int
alpha_stride
;
uint8_t
*
y_buffer
;
uint8_t
*
u_buffer
;
uint8_t
*
v_buffer
;
uint8_t
*
alpha_buffer
;
uint8_t
*
buffer_alloc
;
int
buffer_alloc_sz
;
...
...
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