Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
bc15fcb8
Commit
bc15fcb8
authored
12 years ago
by
Michael Niedermayer
Browse files
Options
Downloads
Patches
Plain Diff
theora: support midstream reconfiguration
Fixes Ticket868 Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
7cb27d21
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Changelog
+1
-0
1 addition, 0 deletions
Changelog
libavcodec/vp3.c
+36
-0
36 additions, 0 deletions
libavcodec/vp3.c
with
37 additions
and
0 deletions
Changelog
+
1
−
0
View file @
bc15fcb8
...
...
@@ -6,6 +6,7 @@ version <next>:
- SRTP support
- Error diffusion dither in Swscale
- Chained Ogg support
- Theora Midstream reconfiguration support
version 1.1:
...
...
This diff is collapsed.
Click to expand it.
libavcodec/vp3.c
+
36
−
0
View file @
bc15fcb8
...
...
@@ -75,6 +75,10 @@ typedef struct Vp3Fragment {
/* special internal mode */
#define MODE_COPY 8
static
int
theora_decode_header
(
AVCodecContext
*
avctx
,
GetBitContext
*
gb
);
static
int
theora_decode_tables
(
AVCodecContext
*
avctx
,
GetBitContext
*
gb
);
/* There are 6 preset schemes, plus a free-form scheme */
static
const
int
ModeAlphabet
[
6
][
CODING_MODE_COUNT
]
=
{
...
...
@@ -292,6 +296,8 @@ static av_cold int vp3_decode_end(AVCodecContext *avctx)
av_freep
(
&
s
->
motion_val
[
1
]);
av_freep
(
&
s
->
edge_emu_buffer
);
s
->
theora_tables
=
0
;
if
(
avctx
->
internal
->
is_copy
)
return
0
;
...
...
@@ -1912,16 +1918,46 @@ static int vp3_decode_frame(AVCodecContext *avctx,
Vp3DecodeContext
*
s
=
avctx
->
priv_data
;
GetBitContext
gb
;
int
i
;
int
ret
;
init_get_bits
(
&
gb
,
buf
,
buf_size
*
8
);
if
(
s
->
theora
&&
get_bits1
(
&
gb
))
{
int
type
=
get_bits
(
&
gb
,
7
);
skip_bits_long
(
&
gb
,
6
*
8
);
/* "theora" */
if
(
type
==
0
)
{
if
(
s
->
avctx
->
active_thread_type
&
FF_THREAD_FRAME
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"midstream reconfiguration with multithreading is unsupported, try -threads 1
\n
"
);
return
AVERROR_PATCHWELCOME
;
}
vp3_decode_end
(
avctx
);
ret
=
theora_decode_header
(
avctx
,
&
gb
);
if
(
ret
<
0
)
{
vp3_decode_end
(
avctx
);
}
else
ret
=
vp3_decode_init
(
avctx
);
return
ret
;
}
else
if
(
type
==
2
)
{
ret
=
theora_decode_tables
(
avctx
,
&
gb
);
if
(
ret
<
0
)
{
vp3_decode_end
(
avctx
);
}
else
ret
=
vp3_decode_init
(
avctx
);
return
ret
;
}
av_log
(
avctx
,
AV_LOG_ERROR
,
"Header packet passed to frame decoder, skipping
\n
"
);
return
-
1
;
}
s
->
keyframe
=
!
get_bits1
(
&
gb
);
if
(
!
s
->
all_fragments
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Data packet without prior valid headers
\n
"
);
return
-
1
;
}
if
(
!
s
->
theora
)
skip_bits
(
&
gb
,
1
);
for
(
i
=
0
;
i
<
3
;
i
++
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment