Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
aom-rav1e
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
aom-rav1e
Commits
0270a790
Commit
0270a790
authored
May 25, 2010
by
John Koleszar
Committed by
Code Review
May 25, 2010
Browse files
Options
Browse Files
Download
Plain Diff
Merge "vpx_image: add VPX_ prefix to PLANE_*"
parents
c601db95
b6c71918
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
60 deletions
+67
-60
ivfdec.c
ivfdec.c
+6
-6
ivfenc.c
ivfenc.c
+2
-2
vp8/vp8_cx_iface.c
vp8/vp8_cx_iface.c
+12
-12
vp8/vp8_dx_iface.c
vp8/vp8_dx_iface.c
+6
-6
vpx/src/vpx_image.c
vpx/src/vpx_image.c
+29
-29
vpx/vpx_image.h
vpx/vpx_image.h
+12
-5
No files found.
ivfdec.c
View file @
0270a790
...
...
@@ -534,28 +534,28 @@ int main(int argc, const char **argv_)
out
=
out_open
(
out_fn
,
do_md5
);
}
buf
=
img
->
planes
[
PLANE_Y
];
buf
=
img
->
planes
[
VPX_
PLANE_Y
];
for
(
y
=
0
;
y
<
img
->
d_h
;
y
++
)
{
out_put
(
out
,
buf
,
img
->
d_w
,
do_md5
);
buf
+=
img
->
stride
[
PLANE_Y
];
buf
+=
img
->
stride
[
VPX_
PLANE_Y
];
}
buf
=
img
->
planes
[
flipuv
?
PLANE_V
:
PLANE_U
];
buf
=
img
->
planes
[
flipuv
?
VPX_PLANE_V
:
VPX_
PLANE_U
];
for
(
y
=
0
;
y
<
(
1
+
img
->
d_h
)
/
2
;
y
++
)
{
out_put
(
out
,
buf
,
(
1
+
img
->
d_w
)
/
2
,
do_md5
);
buf
+=
img
->
stride
[
PLANE_U
];
buf
+=
img
->
stride
[
VPX_
PLANE_U
];
}
buf
=
img
->
planes
[
flipuv
?
PLANE_U
:
PLANE_V
];
buf
=
img
->
planes
[
flipuv
?
VPX_PLANE_U
:
VPX_
PLANE_V
];
for
(
y
=
0
;
y
<
(
1
+
img
->
d_h
)
/
2
;
y
++
)
{
out_put
(
out
,
buf
,
(
1
+
img
->
d_w
)
/
2
,
do_md5
);
buf
+=
img
->
stride
[
PLANE_V
];
buf
+=
img
->
stride
[
VPX_
PLANE_V
];
}
if
(
!
fn2
)
...
...
ivfenc.c
View file @
0270a790
...
...
@@ -247,10 +247,10 @@ static int read_frame(FILE *f, vpx_image_t *img, unsigned int is_ivf)
switch
(
plane
)
{
case
1
:
ptr
=
img
->
planes
[
img
->
fmt
==
VPX_IMG_FMT_YV12
?
PLANE_V
:
PLANE_U
];
ptr
=
img
->
planes
[
img
->
fmt
==
VPX_IMG_FMT_YV12
?
VPX_PLANE_V
:
VPX_
PLANE_U
];
break
;
case
2
:
ptr
=
img
->
planes
[
img
->
fmt
==
VPX_IMG_FMT_YV12
?
PLANE_U
:
PLANE_V
];
ptr
=
img
->
planes
[
img
->
fmt
==
VPX_IMG_FMT_YV12
?
VPX_PLANE_U
:
VPX_
PLANE_V
];
break
;
default:
ptr
=
img
->
planes
[
plane
];
...
...
vp8/vp8_cx_iface.c
View file @
0270a790
...
...
@@ -536,19 +536,19 @@ 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
[
PLANE_Y
];
yv12
->
u_buffer
=
img
->
planes
[
PLANE_U
];
yv12
->
v_buffer
=
img
->
planes
[
PLANE_V
];
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_width
=
img
->
d_w
;
yv12
->
y_height
=
img
->
d_h
;
yv12
->
uv_width
=
(
1
+
yv12
->
y_width
)
/
2
;
yv12
->
uv_height
=
(
1
+
yv12
->
y_height
)
/
2
;
yv12
->
y_stride
=
img
->
stride
[
PLANE_Y
];
yv12
->
uv_stride
=
img
->
stride
[
PLANE_U
];
yv12
->
y_stride
=
img
->
stride
[
VPX_
PLANE_Y
];
yv12
->
uv_stride
=
img
->
stride
[
VPX_
PLANE_U
];
yv12
->
border
=
(
img
->
stride
[
PLANE_Y
]
-
img
->
w
)
/
2
;
yv12
->
border
=
(
img
->
stride
[
VPX_
PLANE_Y
]
-
img
->
w
)
/
2
;
yv12
->
clrtype
=
(
img
->
fmt
==
VPX_IMG_FMT_VPXI420
||
img
->
fmt
==
VPX_IMG_FMT_VPXYV12
);
//REG_YUV = 0
return
res
;
}
...
...
@@ -857,9 +857,9 @@ static vpx_image_t *vp8e_get_preview(vpx_codec_alg_priv_t *ctx)
*/
ctx
->
preview_img
.
bps
=
12
;
ctx
->
preview_img
.
planes
[
PLANE_Y
]
=
sd
.
y_buffer
;
ctx
->
preview_img
.
planes
[
PLANE_U
]
=
sd
.
u_buffer
;
ctx
->
preview_img
.
planes
[
PLANE_V
]
=
sd
.
v_buffer
;
ctx
->
preview_img
.
planes
[
VPX_
PLANE_Y
]
=
sd
.
y_buffer
;
ctx
->
preview_img
.
planes
[
VPX_
PLANE_U
]
=
sd
.
u_buffer
;
ctx
->
preview_img
.
planes
[
VPX_
PLANE_V
]
=
sd
.
v_buffer
;
if
(
sd
.
clrtype
==
REG_YUV
)
ctx
->
preview_img
.
fmt
=
VPX_IMG_FMT_I420
;
...
...
@@ -871,9 +871,9 @@ static vpx_image_t *vp8e_get_preview(vpx_codec_alg_priv_t *ctx)
ctx
->
preview_img
.
d_w
=
ctx
->
cfg
.
g_w
;
ctx
->
preview_img
.
d_h
=
ctx
->
cfg
.
g_h
;
ctx
->
preview_img
.
stride
[
PLANE_Y
]
=
sd
.
y_stride
;
ctx
->
preview_img
.
stride
[
PLANE_U
]
=
sd
.
uv_stride
;
ctx
->
preview_img
.
stride
[
PLANE_V
]
=
sd
.
uv_stride
;
ctx
->
preview_img
.
stride
[
VPX_
PLANE_Y
]
=
sd
.
y_stride
;
ctx
->
preview_img
.
stride
[
VPX_
PLANE_U
]
=
sd
.
uv_stride
;
ctx
->
preview_img
.
stride
[
VPX_
PLANE_V
]
=
sd
.
uv_stride
;
ctx
->
preview_img
.
w
=
sd
.
y_width
;
ctx
->
preview_img
.
h
=
sd
.
y_height
;
...
...
vp8/vp8_dx_iface.c
View file @
0270a790
...
...
@@ -557,19 +557,19 @@ 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
[
PLANE_Y
];
yv12
->
u_buffer
=
img
->
planes
[
PLANE_U
];
yv12
->
v_buffer
=
img
->
planes
[
PLANE_V
];
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_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
[
PLANE_Y
];
yv12
->
uv_stride
=
img
->
stride
[
PLANE_U
];
yv12
->
y_stride
=
img
->
stride
[
VPX_
PLANE_Y
];
yv12
->
uv_stride
=
img
->
stride
[
VPX_
PLANE_U
];
yv12
->
border
=
(
img
->
stride
[
PLANE_Y
]
-
img
->
d_w
)
/
2
;
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
;
...
...
vpx/src/vpx_image.c
View file @
0270a790
...
...
@@ -133,8 +133,8 @@ static vpx_image_t *img_alloc_helper(vpx_image_t *img,
img
->
bps
=
bps
;
/* Calculate strides */
img
->
stride
[
PLANE_Y
]
=
img
->
stride
[
PLANE_ALPHA
]
=
s
;
img
->
stride
[
PLANE_U
]
=
img
->
stride
[
PLANE_V
]
=
s
>>
xcs
;
img
->
stride
[
VPX_PLANE_Y
]
=
img
->
stride
[
VPX_
PLANE_ALPHA
]
=
s
;
img
->
stride
[
VPX_PLANE_U
]
=
img
->
stride
[
VPX_
PLANE_V
]
=
s
>>
xcs
;
/* Default viewport to entire image */
if
(
!
vpx_img_set_rect
(
img
,
0
,
0
,
d_w
,
d_h
))
...
...
@@ -180,8 +180,8 @@ int vpx_img_set_rect(vpx_image_t *img,
/* Calculate plane pointers */
if
(
!
(
img
->
fmt
&
VPX_IMG_FMT_PLANAR
))
{
img
->
planes
[
PLANE_PACKED
]
=
img
->
img_data
+
x
*
img
->
bps
/
8
+
y
*
img
->
stride
[
PLANE_PACKED
];
img
->
planes
[
VPX_
PLANE_PACKED
]
=
img
->
img_data
+
x
*
img
->
bps
/
8
+
y
*
img
->
stride
[
VPX_
PLANE_PACKED
];
}
else
{
...
...
@@ -189,33 +189,33 @@ int vpx_img_set_rect(vpx_image_t *img,
if
(
img
->
fmt
&
VPX_IMG_FMT_HAS_ALPHA
)
{
img
->
planes
[
PLANE_ALPHA
]
=
data
+
x
+
y
*
img
->
stride
[
PLANE_ALPHA
];
data
+=
img
->
h
*
img
->
stride
[
PLANE_ALPHA
];
img
->
planes
[
VPX_
PLANE_ALPHA
]
=
data
+
x
+
y
*
img
->
stride
[
VPX_
PLANE_ALPHA
];
data
+=
img
->
h
*
img
->
stride
[
VPX_
PLANE_ALPHA
];
}
img
->
planes
[
PLANE_Y
]
=
data
+
x
+
y
*
img
->
stride
[
PLANE_Y
];
data
+=
img
->
h
*
img
->
stride
[
PLANE_Y
];
img
->
planes
[
VPX_PLANE_Y
]
=
data
+
x
+
y
*
img
->
stride
[
VPX_
PLANE_Y
];
data
+=
img
->
h
*
img
->
stride
[
VPX_
PLANE_Y
];
if
(
!
(
img
->
fmt
&
VPX_IMG_FMT_UV_FLIP
))
{
img
->
planes
[
PLANE_U
]
=
data
img
->
planes
[
VPX_
PLANE_U
]
=
data
+
(
x
>>
img
->
x_chroma_shift
)
+
(
y
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
PLANE_U
];
data
+=
(
img
->
h
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
PLANE_U
];
img
->
planes
[
PLANE_V
]
=
data
+
(
y
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
VPX_
PLANE_U
];
data
+=
(
img
->
h
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
VPX_
PLANE_U
];
img
->
planes
[
VPX_
PLANE_V
]
=
data
+
(
x
>>
img
->
x_chroma_shift
)
+
(
y
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
PLANE_V
];
+
(
y
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
VPX_
PLANE_V
];
}
else
{
img
->
planes
[
PLANE_V
]
=
data
img
->
planes
[
VPX_
PLANE_V
]
=
data
+
(
x
>>
img
->
x_chroma_shift
)
+
(
y
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
PLANE_V
];
data
+=
(
img
->
h
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
PLANE_V
];
img
->
planes
[
PLANE_U
]
=
data
+
(
y
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
VPX_
PLANE_V
];
data
+=
(
img
->
h
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
VPX_
PLANE_V
];
img
->
planes
[
VPX_
PLANE_U
]
=
data
+
(
x
>>
img
->
x_chroma_shift
)
+
(
y
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
PLANE_U
];
+
(
y
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
VPX_
PLANE_U
];
}
}
...
...
@@ -233,19 +233,19 @@ void vpx_img_flip(vpx_image_t *img)
* stride parameter will be promoted to unsigned, causing errors when
* the lhs is a larger type than the rhs.
*/
img
->
planes
[
PLANE_Y
]
+=
(
signed
)(
img
->
d_h
-
1
)
*
img
->
stride
[
PLANE_Y
];
img
->
stride
[
PLANE_Y
]
=
-
img
->
stride
[
PLANE_Y
];
img
->
planes
[
VPX_PLANE_Y
]
+=
(
signed
)(
img
->
d_h
-
1
)
*
img
->
stride
[
VPX_
PLANE_Y
];
img
->
stride
[
VPX_PLANE_Y
]
=
-
img
->
stride
[
VPX_
PLANE_Y
];
img
->
planes
[
PLANE_U
]
+=
(
signed
)((
img
->
d_h
>>
img
->
y_chroma_shift
)
-
1
)
*
img
->
stride
[
PLANE_U
];
img
->
stride
[
PLANE_U
]
=
-
img
->
stride
[
PLANE_U
];
img
->
planes
[
VPX_
PLANE_U
]
+=
(
signed
)((
img
->
d_h
>>
img
->
y_chroma_shift
)
-
1
)
*
img
->
stride
[
VPX_
PLANE_U
];
img
->
stride
[
VPX_PLANE_U
]
=
-
img
->
stride
[
VPX_
PLANE_U
];
img
->
planes
[
PLANE_V
]
+=
(
signed
)((
img
->
d_h
>>
img
->
y_chroma_shift
)
-
1
)
*
img
->
stride
[
PLANE_V
];
img
->
stride
[
PLANE_V
]
=
-
img
->
stride
[
PLANE_V
];
img
->
planes
[
VPX_
PLANE_V
]
+=
(
signed
)((
img
->
d_h
>>
img
->
y_chroma_shift
)
-
1
)
*
img
->
stride
[
VPX_
PLANE_V
];
img
->
stride
[
VPX_PLANE_V
]
=
-
img
->
stride
[
VPX_
PLANE_V
];
img
->
planes
[
PLANE_ALPHA
]
+=
(
signed
)(
img
->
d_h
-
1
)
*
img
->
stride
[
PLANE_ALPHA
];
img
->
stride
[
PLANE_ALPHA
]
=
-
img
->
stride
[
PLANE_ALPHA
];
img
->
planes
[
VPX_PLANE_ALPHA
]
+=
(
signed
)(
img
->
d_h
-
1
)
*
img
->
stride
[
VPX_
PLANE_ALPHA
];
img
->
stride
[
VPX_PLANE_ALPHA
]
=
-
img
->
stride
[
VPX_
PLANE_ALPHA
];
}
void
vpx_img_free
(
vpx_image_t
*
img
)
...
...
vpx/vpx_image.h
View file @
0270a790
...
...
@@ -110,11 +110,18 @@ extern "C" {
unsigned
int
y_chroma_shift
;
/**< subsampling order, Y */
/* Image data pointers. */
#define PLANE_PACKED 0
/**< To be used for all packed formats */
#define PLANE_Y 0
/**< Y (Luminance) plane */
#define PLANE_U 1
/**< U (Chroma) plane */
#define PLANE_V 2
/**< V (Chroma) plane */
#define PLANE_ALPHA 3
/**< A (Transparancy) plane */
#define VPX_PLANE_PACKED 0
/**< To be used for all packed formats */
#define VPX_PLANE_Y 0
/**< Y (Luminance) plane */
#define VPX_PLANE_U 1
/**< U (Chroma) plane */
#define VPX_PLANE_V 2
/**< V (Chroma) plane */
#define VPX_PLANE_ALPHA 3
/**< A (Transparancy) plane */
#if !defined(VPX_CODEC_DISABLE_COMPAT) || !VPX_CODEC_DISABLE_COMPAT
#define PLANE_PACKED VPX_PLANE_PACKED
#define PLANE_Y VPX_PLANE_Y
#define PLANE_U VPX_PLANE_U
#define PLANE_V VPX_PLANE_V
#define PLANE_ALPHA VPX_PLANE_ALPHA
#endif
unsigned
char
*
planes
[
4
];
/**< pointer to the top left pixel for each plane */
int
stride
[
4
];
/**< stride between rows for each plane */
...
...
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