Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
videolan
vlc
Commits
ba309445
Commit
ba309445
authored
Sep 27, 2014
by
Tristan Matthews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
theora: cleanup
Remove dead code and superfluous width/height variables.
parent
3417a404
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
28 deletions
+22
-28
modules/codec/theora.c
modules/codec/theora.c
+22
-28
No files found.
modules/codec/theora.c
View file @
ba309445
...
...
@@ -566,7 +566,6 @@ static void CloseDecoder( vlc_object_t *p_this )
th_info_clear
(
&
p_sys
->
ti
);
th_comment_clear
(
&
p_sys
->
tc
);
th_decode_free
(
p_sys
->
tcx
);
p_sys
->
tcx
=
NULL
;
free
(
p_sys
);
}
...
...
@@ -635,7 +634,6 @@ struct encoder_sys_t
th_info
ti
;
/* theora bitstream settings */
th_comment
tc
;
/* theora comment header */
th_enc_ctx
*
tcx
;
/* theora context */
int
i_width
,
i_height
;
};
/*****************************************************************************
...
...
@@ -695,9 +693,6 @@ static int OpenEncoder( vlc_object_t *p_this )
p_sys
->
ti
.
pic_x
=
0
/*frame_x_offset*/
;
p_sys
->
ti
.
pic_y
=
0
/*frame_y_offset*/
;
p_sys
->
i_width
=
p_sys
->
ti
.
frame_width
;
p_sys
->
i_height
=
p_sys
->
ti
.
frame_height
;
if
(
!
p_enc
->
fmt_in
.
video
.
i_frame_rate
||
!
p_enc
->
fmt_in
.
video
.
i_frame_rate_base
)
{
...
...
@@ -783,77 +778,77 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pict )
ogg_packet
oggpacket
;
block_t
*
p_block
;
th_ycbcr_buffer
ycbcr
;
int
i
;
unsigned
i
;
if
(
!
p_pict
)
return
NULL
;
/* Sanity check */
if
(
p_pict
->
p
[
0
].
i_pitch
<
(
int
)
p_sys
->
i
_width
||
p_pict
->
p
[
0
].
i_lines
<
(
int
)
p_sys
->
i
_height
)
if
(
p_pict
->
p
[
0
].
i_pitch
<
(
int
)
p_sys
->
ti
.
frame
_width
||
p_pict
->
p
[
0
].
i_lines
<
(
int
)
p_sys
->
ti
.
frame
_height
)
{
msg_Warn
(
p_enc
,
"frame is smaller than encoding size"
"(%ix%i->%ix%i) -> dropping frame"
,
p_pict
->
p
[
0
].
i_pitch
,
p_pict
->
p
[
0
].
i_lines
,
p_sys
->
i_width
,
p_sys
->
i
_height
);
p_sys
->
ti
.
frame_width
,
p_sys
->
ti
.
frame
_height
);
return
NULL
;
}
/* Fill padding */
if
(
p_pict
->
p
[
0
].
i_visible_pitch
<
(
int
)
p_sys
->
i
_width
)
if
(
p_pict
->
p
[
0
].
i_visible_pitch
<
(
int
)
p_sys
->
ti
.
frame
_width
)
{
for
(
i
=
0
;
i
<
p_sys
->
i
_height
;
i
++
)
for
(
i
=
0
;
i
<
p_sys
->
ti
.
frame
_height
;
i
++
)
{
memset
(
p_pict
->
p
[
0
].
p_pixels
+
i
*
p_pict
->
p
[
0
].
i_pitch
+
p_pict
->
p
[
0
].
i_visible_pitch
,
*
(
p_pict
->
p
[
0
].
p_pixels
+
i
*
p_pict
->
p
[
0
].
i_pitch
+
p_pict
->
p
[
0
].
i_visible_pitch
-
1
),
p_sys
->
i
_width
-
p_pict
->
p
[
0
].
i_visible_pitch
);
p_sys
->
ti
.
frame
_width
-
p_pict
->
p
[
0
].
i_visible_pitch
);
}
for
(
i
=
0
;
i
<
p_sys
->
i
_height
/
2
;
i
++
)
for
(
i
=
0
;
i
<
p_sys
->
ti
.
frame
_height
/
2
;
i
++
)
{
memset
(
p_pict
->
p
[
1
].
p_pixels
+
i
*
p_pict
->
p
[
1
].
i_pitch
+
p_pict
->
p
[
1
].
i_visible_pitch
,
*
(
p_pict
->
p
[
1
].
p_pixels
+
i
*
p_pict
->
p
[
1
].
i_pitch
+
p_pict
->
p
[
1
].
i_visible_pitch
-
1
),
p_sys
->
i
_width
/
2
-
p_pict
->
p
[
1
].
i_visible_pitch
);
p_sys
->
ti
.
frame
_width
/
2
-
p_pict
->
p
[
1
].
i_visible_pitch
);
memset
(
p_pict
->
p
[
2
].
p_pixels
+
i
*
p_pict
->
p
[
2
].
i_pitch
+
p_pict
->
p
[
2
].
i_visible_pitch
,
*
(
p_pict
->
p
[
2
].
p_pixels
+
i
*
p_pict
->
p
[
2
].
i_pitch
+
p_pict
->
p
[
2
].
i_visible_pitch
-
1
),
p_sys
->
i
_width
/
2
-
p_pict
->
p
[
2
].
i_visible_pitch
);
p_sys
->
ti
.
frame
_width
/
2
-
p_pict
->
p
[
2
].
i_visible_pitch
);
}
}
if
(
p_pict
->
p
[
0
].
i_visible_lines
<
(
int
)
p_sys
->
i
_height
)
if
(
p_pict
->
p
[
0
].
i_visible_lines
<
(
int
)
p_sys
->
ti
.
frame
_height
)
{
for
(
i
=
p_pict
->
p
[
0
].
i_visible_lines
;
i
<
p_sys
->
i
_height
;
i
++
)
for
(
i
=
p_pict
->
p
[
0
].
i_visible_lines
;
i
<
p_sys
->
ti
.
frame
_height
;
i
++
)
{
memset
(
p_pict
->
p
[
0
].
p_pixels
+
i
*
p_pict
->
p
[
0
].
i_pitch
,
0
,
p_sys
->
i
_width
);
p_sys
->
ti
.
frame
_width
);
}
for
(
i
=
p_pict
->
p
[
1
].
i_visible_lines
;
i
<
p_sys
->
i
_height
/
2
;
i
++
)
for
(
i
=
p_pict
->
p
[
1
].
i_visible_lines
;
i
<
p_sys
->
ti
.
frame
_height
/
2
;
i
++
)
{
memset
(
p_pict
->
p
[
1
].
p_pixels
+
i
*
p_pict
->
p
[
1
].
i_pitch
,
0x80
,
p_sys
->
i
_width
/
2
);
p_sys
->
ti
.
frame
_width
/
2
);
memset
(
p_pict
->
p
[
2
].
p_pixels
+
i
*
p_pict
->
p
[
2
].
i_pitch
,
0x80
,
p_sys
->
i
_width
/
2
);
p_sys
->
ti
.
frame
_width
/
2
);
}
}
/* Theora is a one-frame-in, one-frame-out system. Submit a frame
* for compression and pull out the packet. */
ycbcr
[
0
].
width
=
p_sys
->
i
_width
;
ycbcr
[
0
].
height
=
p_sys
->
i
_height
;
ycbcr
[
0
].
width
=
p_sys
->
ti
.
frame
_width
;
ycbcr
[
0
].
height
=
p_sys
->
ti
.
frame
_height
;
ycbcr
[
0
].
stride
=
p_pict
->
p
[
0
].
i_pitch
;
ycbcr
[
0
].
data
=
p_pict
->
p
[
0
].
p_pixels
;
ycbcr
[
1
].
width
=
p_sys
->
i
_width
/
2
;
ycbcr
[
1
].
height
=
p_sys
->
i
_height
/
2
;
ycbcr
[
1
].
width
=
p_sys
->
ti
.
frame
_width
/
2
;
ycbcr
[
1
].
height
=
p_sys
->
ti
.
frame
_height
/
2
;
ycbcr
[
1
].
stride
=
p_pict
->
p
[
1
].
i_pitch
;
ycbcr
[
1
].
data
=
p_pict
->
p
[
1
].
p_pixels
;
ycbcr
[
2
].
width
=
p_sys
->
i
_width
/
2
;
ycbcr
[
2
].
height
=
p_sys
->
i
_height
/
2
;
ycbcr
[
2
].
width
=
p_sys
->
ti
.
frame
_width
/
2
;
ycbcr
[
2
].
height
=
p_sys
->
ti
.
frame
_height
/
2
;
ycbcr
[
2
].
stride
=
p_pict
->
p
[
1
].
i_pitch
;
ycbcr
[
2
].
data
=
p_pict
->
p
[
2
].
p_pixels
;
...
...
@@ -889,7 +884,6 @@ static void CloseEncoder( vlc_object_t *p_this )
th_info_clear
(
&
p_sys
->
ti
);
th_comment_clear
(
&
p_sys
->
tc
);
th_encode_free
(
p_sys
->
tcx
);
p_sys
->
tcx
=
NULL
;
free
(
p_sys
);
}
#endif
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