Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
1202b712
Commit
1202b712
authored
Dec 18, 2016
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
theora: export cropping information instead of handling it internally
parent
c3e84820
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
14 deletions
+9
-14
vp3.c
libavcodec/vp3.c
+9
-14
No files found.
libavcodec/vp3.c
View file @
1202b712
...
...
@@ -1983,6 +1983,7 @@ static int vp3_decode_frame(AVCodecContext *avctx,
void
*
data
,
int
*
got_frame
,
AVPacket
*
avpkt
)
{
AVFrame
*
frame
=
data
;
const
uint8_t
*
buf
=
avpkt
->
data
;
int
buf_size
=
avpkt
->
size
;
Vp3DecodeContext
*
s
=
avctx
->
priv_data
;
...
...
@@ -2122,12 +2123,12 @@ static int vp3_decode_frame(AVCodecContext *avctx,
/* output frame, offset as needed */
if
((
ret
=
av_frame_ref
(
data
,
s
->
current_frame
.
f
))
<
0
)
return
ret
;
for
(
i
=
0
;
i
<
3
;
i
++
)
{
AVFrame
*
dst
=
data
;
int
off
=
(
s
->
offset_x
>>
(
i
&&
s
->
chroma_y_shift
))
+
(
s
->
offset_y
>>
(
i
&&
s
->
chroma_y_shift
))
*
dst
->
linesize
[
i
]
;
dst
->
data
[
i
]
+=
off
;
}
frame
->
crop_left
=
s
->
offset_x
;
frame
->
crop_right
=
avctx
->
coded_width
-
avctx
->
width
-
s
->
offset_x
;
frame
->
crop_top
=
s
->
offset_y
;
frame
->
crop_bottom
=
avctx
->
coded_height
-
avctx
->
height
-
s
->
offset_y
;
*
got_frame
=
1
;
if
(
!
HAVE_THREADS
||
!
(
s
->
avctx
->
active_thread_type
&
FF_THREAD_FRAME
))
{
...
...
@@ -2290,13 +2291,6 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
// to normal axis ([0,0] upper left)
s
->
offset_x
=
offset_x
;
s
->
offset_y
=
s
->
height
-
visible_height
-
offset_y
;
if
((
s
->
offset_x
&
0x1F
)
&&
!
(
avctx
->
flags
&
AV_CODEC_FLAG_UNALIGNED
))
{
s
->
offset_x
&=
~
0x1F
;
av_log
(
avctx
,
AV_LOG_WARNING
,
"Reducing offset_x from %d to %d"
"chroma samples to preserve alignment.
\n
"
,
offset_x
,
s
->
offset_x
);
}
}
if
(
colorspace
==
1
)
...
...
@@ -2499,7 +2493,8 @@ AVCodec ff_theora_decoder = {
AV_CODEC_CAP_FRAME_THREADS
,
.
flush
=
vp3_decode_flush
,
.
init_thread_copy
=
ONLY_IF_THREADS_ENABLED
(
vp3_init_thread_copy
),
.
update_thread_context
=
ONLY_IF_THREADS_ENABLED
(
vp3_update_thread_context
)
.
update_thread_context
=
ONLY_IF_THREADS_ENABLED
(
vp3_update_thread_context
),
.
caps_internal
=
FF_CODEC_CAP_EXPORTS_CROPPING
,
};
#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