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
1f29e5d7
Commit
1f29e5d7
authored
Oct 08, 2014
by
Rémi Denis-Courmont
Committed by
Janne Grunau
Oct 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h263dec: call get_format after setting resolution and profile
Bug-Id: 541
parent
76c70e33
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
h263dec.c
libavcodec/h263dec.c
+12
-5
No files found.
libavcodec/h263dec.c
View file @
1f29e5d7
...
@@ -40,6 +40,14 @@
...
@@ -40,6 +40,14 @@
#include "qpeldsp.h"
#include "qpeldsp.h"
#include "thread.h"
#include "thread.h"
static
enum
AVPixelFormat
h263_get_format
(
AVCodecContext
*
avctx
)
{
if
(
avctx
->
codec
->
id
==
AV_CODEC_ID_MSS2
)
return
AV_PIX_FMT_YUV420P
;
return
avctx
->
pix_fmt
=
ff_get_format
(
avctx
,
avctx
->
codec
->
pix_fmts
);
}
av_cold
int
ff_h263_decode_init
(
AVCodecContext
*
avctx
)
av_cold
int
ff_h263_decode_init
(
AVCodecContext
*
avctx
)
{
{
MpegEncContext
*
s
=
avctx
->
priv_data
;
MpegEncContext
*
s
=
avctx
->
priv_data
;
...
@@ -56,10 +64,6 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
...
@@ -56,10 +64,6 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
s
->
quant_precision
=
5
;
s
->
quant_precision
=
5
;
s
->
decode_mb
=
ff_h263_decode_mb
;
s
->
decode_mb
=
ff_h263_decode_mb
;
s
->
low_delay
=
1
;
s
->
low_delay
=
1
;
if
(
avctx
->
codec
->
id
==
AV_CODEC_ID_MSS2
)
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P
;
else
avctx
->
pix_fmt
=
ff_get_format
(
avctx
,
avctx
->
codec
->
pix_fmts
);
s
->
unrestricted_mv
=
1
;
s
->
unrestricted_mv
=
1
;
/* select sub codec */
/* select sub codec */
...
@@ -114,6 +118,7 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
...
@@ -114,6 +118,7 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
/* for h263, we allocate the images after having read the header */
/* for h263, we allocate the images after having read the header */
if
(
avctx
->
codec
->
id
!=
AV_CODEC_ID_H263
&&
if
(
avctx
->
codec
->
id
!=
AV_CODEC_ID_H263
&&
avctx
->
codec
->
id
!=
AV_CODEC_ID_MPEG4
)
{
avctx
->
codec
->
id
!=
AV_CODEC_ID_MPEG4
)
{
avctx
->
pix_fmt
=
h263_get_format
(
avctx
);
ff_mpv_idct_init
(
s
);
ff_mpv_idct_init
(
s
);
if
((
ret
=
ff_mpv_common_init
(
s
))
<
0
)
if
((
ret
=
ff_mpv_common_init
(
s
))
<
0
)
return
ret
;
return
ret
;
...
@@ -454,9 +459,11 @@ int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
...
@@ -454,9 +459,11 @@ int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
return
ret
;
return
ret
;
}
}
if
(
!
s
->
context_initialized
)
if
(
!
s
->
context_initialized
)
{
avctx
->
pix_fmt
=
h263_get_format
(
avctx
);
if
((
ret
=
ff_mpv_common_init
(
s
))
<
0
)
if
((
ret
=
ff_mpv_common_init
(
s
))
<
0
)
return
ret
;
return
ret
;
}
if
(
!
s
->
current_picture_ptr
||
s
->
current_picture_ptr
->
f
->
data
[
0
])
{
if
(
!
s
->
current_picture_ptr
||
s
->
current_picture_ptr
->
f
->
data
[
0
])
{
int
i
=
ff_find_unused_picture
(
s
,
0
);
int
i
=
ff_find_unused_picture
(
s
,
0
);
...
...
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