Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gst-plugins-base
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
George Kiagiadakis
gst-plugins-base
Commits
5f61df82
Commit
5f61df82
authored
Apr 04, 2011
by
David Schleef
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
video: Fix YUV9 and YVU9 again
parent
f728ee39
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
16 deletions
+9
-16
gst-libs/gst/video/video.c
gst-libs/gst/video/video.c
+3
-3
tests/check/libs/video.c
tests/check/libs/video.c
+6
-13
No files found.
gst-libs/gst/video/video.c
View file @
5f61df82
...
...
@@ -1937,12 +1937,12 @@ gst_video_format_get_component_offset (GstVideoFormat format,
if
(
component
==
0
)
return
0
;
if
(
component
==
1
)
{
return
GST_ROUND_UP_4
(
width
)
*
GST_ROUND_UP_2
(
height
)
+
return
GST_ROUND_UP_4
(
width
)
*
height
+
GST_ROUND_UP_4
(
GST_ROUND_UP_4
(
width
)
/
4
)
*
(
GST_ROUND_UP_4
(
height
)
/
4
);
}
if
(
component
==
2
)
return
GST_ROUND_UP_4
(
width
)
*
GST_ROUND_UP_2
(
height
)
;
return
GST_ROUND_UP_4
(
width
)
*
height
;
return
0
;
case
GST_VIDEO_FORMAT_IYU1
:
if
(
component
==
0
)
...
...
@@ -2054,7 +2054,7 @@ gst_video_format_get_size (GstVideoFormat format, int width, int height)
return
size
;
case
GST_VIDEO_FORMAT_YUV9
:
case
GST_VIDEO_FORMAT_YVU9
:
size
=
GST_ROUND_UP_4
(
width
)
*
GST_ROUND_UP_2
(
height
)
;
size
=
GST_ROUND_UP_4
(
width
)
*
height
;
size
+=
GST_ROUND_UP_4
(
GST_ROUND_UP_4
(
width
)
/
4
)
*
(
GST_ROUND_UP_4
(
height
)
/
4
)
*
2
;
return
size
;
...
...
tests/check/libs/video.c
View file @
5f61df82
...
...
@@ -301,30 +301,25 @@ paint_setup_IMC4 (paintinfo * p, unsigned char *dest)
static
void
paint_setup_YVU9
(
paintinfo
*
p
,
unsigned
char
*
dest
)
{
int
h
=
GST_ROUND_UP_4
(
p
->
height
);
p
->
yp
=
dest
;
p
->
ystride
=
GST_ROUND_UP_4
(
p
->
width
);
p
->
vp
=
p
->
yp
+
p
->
ystride
*
GST_ROUND_UP_4
(
p
->
height
)
;
p
->
vp
=
p
->
yp
+
p
->
ystride
*
p
->
height
;
p
->
vstride
=
GST_ROUND_UP_4
(
p
->
ystride
/
4
);
p
->
up
=
p
->
vp
+
p
->
vstride
*
GST_ROUND_UP_4
(
h
/
4
);
p
->
up
=
p
->
vp
+
p
->
vstride
*
(
GST_ROUND_UP_4
(
p
->
height
)
/
4
);
p
->
ustride
=
GST_ROUND_UP_4
(
p
->
ystride
/
4
);
p
->
endptr
=
p
->
up
+
p
->
ustride
*
GST_ROUND_UP_4
(
h
/
4
);
p
->
endptr
=
p
->
up
+
p
->
ustride
*
(
GST_ROUND_UP_4
(
p
->
height
)
/
4
);
}
static
void
paint_setup_YUV9
(
paintinfo
*
p
,
unsigned
char
*
dest
)
{
/* untested */
int
h
=
GST_ROUND_UP_4
(
p
->
height
);
p
->
yp
=
dest
;
p
->
ystride
=
GST_ROUND_UP_4
(
p
->
width
);
p
->
up
=
p
->
yp
+
p
->
ystride
*
h
;
p
->
up
=
p
->
yp
+
p
->
ystride
*
p
->
height
;
p
->
ustride
=
GST_ROUND_UP_4
(
p
->
ystride
/
4
);
p
->
vp
=
p
->
up
+
p
->
ustride
*
GST_ROUND_UP_4
(
h
/
4
);
p
->
vp
=
p
->
up
+
p
->
ustride
*
(
GST_ROUND_UP_4
(
p
->
height
)
/
4
);
p
->
vstride
=
GST_ROUND_UP_4
(
p
->
ystride
/
4
);
p
->
endptr
=
p
->
vp
+
p
->
vstride
*
GST_ROUND_UP_4
(
h
/
4
);
p
->
endptr
=
p
->
vp
+
p
->
vstride
*
(
GST_ROUND_UP_4
(
p
->
height
)
/
4
);
}
#define gst_video_format_is_packed video_format_is_packed
...
...
@@ -429,8 +424,6 @@ GST_START_TEST (test_video_formats)
fail_unless_equals_int
(
off1
,
(
unsigned
long
)
paintinfo
.
up
);
fail_unless_equals_int
(
off2
,
(
unsigned
long
)
paintinfo
.
vp
);
skip_check:
/* should be 0 if there's no alpha component */
off3
=
gst_video_format_get_component_offset
(
fmt
,
3
,
w
,
h
);
fail_unless_equals_int
(
off3
,
(
unsigned
long
)
paintinfo
.
ap
);
...
...
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