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
G
gst-plugins-base
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
Sebastian Dröge
gst-plugins-base
Commits
94ca1b00
Commit
94ca1b00
authored
May 18, 2009
by
Michael Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
theoradec: for 4:2:2, use Y42B (planar) rather than a packed format.
parent
c94f9520
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
53 deletions
+28
-53
ext/theora/theoradec.c
ext/theora/theoradec.c
+28
-53
No files found.
ext/theora/theoradec.c
View file @
94ca1b00
...
...
@@ -66,7 +66,7 @@ GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC
,
GST_PAD_ALWAYS
,
GST_STATIC_CAPS
(
"video/x-raw-yuv, "
"format = (fourcc) { I420, Y
UY2
, Y444 }, "
"format = (fourcc) { I420, Y
42B
, Y444 }, "
"framerate = (fraction) [0/1, MAX], "
"width = (int) [ 1, MAX ], "
"height = (int) [ 1, MAX ]"
)
);
...
...
@@ -895,7 +895,7 @@ theora_handle_type_packet (GstTheoraDec * dec, ogg_packet * packet)
fourcc
=
GST_MAKE_FOURCC
(
'I'
,
'4'
,
'2'
,
'0'
);
}
else
if
(
dec
->
info
.
pixelformat
==
OC_PF_422
)
{
dec
->
output_bpp
=
16
;
fourcc
=
GST_MAKE_FOURCC
(
'Y'
,
'
U'
,
'Y'
,
'2
'
);
fourcc
=
GST_MAKE_FOURCC
(
'Y'
,
'
4'
,
'2'
,
'B
'
);
}
else
if
(
dec
->
info
.
pixelformat
==
OC_PF_444
)
{
dec
->
output_bpp
=
24
;
fourcc
=
GST_MAKE_FOURCC
(
'Y'
,
'4'
,
'4'
,
'4'
);
...
...
@@ -1164,19 +1164,22 @@ no_buffer:
}
/* Allocate buffer and copy image data into Y
UY2
format */
/* Allocate buffer and copy image data into Y
42B
format */
static
GstFlowReturn
theora_handle_422_image
(
GstTheoraDec
*
dec
,
yuv_buffer
*
yuv
,
GstBuffer
**
out
)
{
gint
width
=
dec
->
width
;
gint
uvwidth
=
dec
->
width
/
2
;
gint
height
=
dec
->
height
;
gint
out_size
;
gint
stride
;
gint
ystride
,
uv
stride
;
GstFlowReturn
result
;
int
i
,
j
;
int
i
;
guint8
*
dst
,
*
src
;
stride
=
GST_ROUND_UP_2
(
width
)
*
2
;
out_size
=
stride
*
height
;
ystride
=
GST_ROUND_UP_4
(
width
);
uvstride
=
GST_ROUND_UP_8
(
width
)
/
2
;
out_size
=
ystride
*
height
+
uvstride
*
height
*
2
;
/* now copy over the area contained in offset_x,offset_y,
* frame_width, frame_height */
...
...
@@ -1186,55 +1189,27 @@ theora_handle_422_image (GstTheoraDec * dec, yuv_buffer * yuv, GstBuffer ** out)
if
(
G_UNLIKELY
(
result
!=
GST_FLOW_OK
))
goto
no_buffer
;
/* The output pixels look like:
* YUYVYUYV....
*
* Do the interleaving... Note that this is kinda messed up if our width is
* odd. In that case, we can't represent it properly in YUY2, so we just
* pad out to even in that case (this is why we have GST_ROUND_UP_2() above).
*/
{
guchar
*
src_y
;
guchar
*
src_cb
;
guchar
*
src_cr
;
guchar
*
dest
;
guchar
*
curdest
;
guchar
*
src
;
dst
=
GST_BUFFER_DATA
(
*
out
);
dest
=
GST_BUFFER_DATA
(
*
out
);
src_y
=
yuv
->
y
+
dec
->
offset_x
+
dec
->
offset_y
*
yuv
->
y_stride
;
src_cb
=
yuv
->
u
+
dec
->
offset_x
/
2
+
dec
->
offset_y
*
yuv
->
uv_stride
;
src_cr
=
yuv
->
v
+
dec
->
offset_x
/
2
+
dec
->
offset_y
*
yuv
->
uv_stride
;
for
(
i
=
0
;
i
<
height
;
i
++
)
{
/* Y first */
curdest
=
dest
;
src
=
src_y
;
for
(
j
=
0
;
j
<
width
;
j
++
)
{
*
curdest
=
*
src
++
;
curdest
+=
2
;
}
src_y
+=
yuv
->
y_stride
;
curdest
=
dest
+
1
;
src
=
src_cb
;
for
(
j
=
0
;
j
<
width
/
2
;
j
++
)
{
*
curdest
=
*
src
++
;
curdest
+=
4
;
}
src_cb
+=
yuv
->
uv_stride
;
src
=
yuv
->
y
;
for
(
i
=
0
;
i
<
height
;
i
++
)
{
memcpy
(
dst
,
src
,
width
);
src
+=
yuv
->
y_stride
;
dst
+=
ystride
;
}
curdest
=
dest
+
3
;
src
=
src_cr
;
for
(
j
=
0
;
j
<
width
/
2
;
j
++
)
{
*
curdest
=
*
src
++
;
curdest
+=
4
;
}
src_cr
+=
yuv
->
uv_stride
;
src
=
yuv
->
u
;
for
(
i
=
0
;
i
<
height
;
i
++
)
{
memcpy
(
dst
,
src
,
uvwidth
);
src
+=
yuv
->
uv_stride
;
dst
+=
uvstride
;
}
dest
+=
stride
;
}
src
=
yuv
->
v
;
for
(
i
=
0
;
i
<
height
;
i
++
)
{
memcpy
(
dst
,
src
,
uvwidth
);
src
+=
yuv
->
uv_stride
;
dst
+=
uvstride
;
}
no_buffer:
...
...
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