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
08303d77
Commit
08303d77
authored
Nov 09, 2013
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hwaccel: Simplify ff_find_hwaccel
It is always called by passing fields from an AVCodecContext.
parent
d42db44c
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
9 deletions
+11
-9
h263dec.c
libavcodec/h263dec.c
+1
-1
h264.c
libavcodec/h264.c
+1
-1
internal.h
libavcodec/internal.h
+2
-3
mpeg12dec.c
libavcodec/mpeg12dec.c
+2
-2
utils.c
libavcodec/utils.c
+4
-1
vc1dec.c
libavcodec/vc1dec.c
+1
-1
No files found.
libavcodec/h263dec.c
View file @
08303d77
...
@@ -108,7 +108,7 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
...
@@ -108,7 +108,7 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
return
AVERROR
(
ENOSYS
);
return
AVERROR
(
ENOSYS
);
}
}
s
->
codec_id
=
avctx
->
codec
->
id
;
s
->
codec_id
=
avctx
->
codec
->
id
;
avctx
->
hwaccel
=
ff_find_hwaccel
(
avctx
->
codec
->
id
,
avctx
->
pix_fmt
);
avctx
->
hwaccel
=
ff_find_hwaccel
(
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
&&
...
...
libavcodec/h264.c
View file @
08303d77
...
@@ -3144,7 +3144,7 @@ static int h264_slice_header_init(H264Context *h, int reinit)
...
@@ -3144,7 +3144,7 @@ static int h264_slice_header_init(H264Context *h, int reinit)
h
->
sps
.
num_units_in_tick
,
den
,
1
<<
30
);
h
->
sps
.
num_units_in_tick
,
den
,
1
<<
30
);
}
}
h
->
avctx
->
hwaccel
=
ff_find_hwaccel
(
h
->
avctx
->
codec
->
id
,
h
->
avctx
->
pix_fmt
);
h
->
avctx
->
hwaccel
=
ff_find_hwaccel
(
h
->
avctx
);
if
(
reinit
)
if
(
reinit
)
free_tables
(
h
,
0
);
free_tables
(
h
,
0
);
...
...
libavcodec/internal.h
View file @
08303d77
...
@@ -105,11 +105,10 @@ struct AVCodecDefault {
...
@@ -105,11 +105,10 @@ struct AVCodecDefault {
* Return the hardware accelerated codec for codec codec_id and
* Return the hardware accelerated codec for codec codec_id and
* pixel format pix_fmt.
* pixel format pix_fmt.
*
*
* @param codec_id the codec to match
* @param avctx The codec context containing the codec_id and pixel format.
* @param pix_fmt the pixel format to match
* @return the hardware accelerated codec, or NULL if none was found.
* @return the hardware accelerated codec, or NULL if none was found.
*/
*/
AVHWAccel
*
ff_find_hwaccel
(
enum
AVCodecID
codec_id
,
enum
AVPixelFormat
pix_fmt
);
AVHWAccel
*
ff_find_hwaccel
(
AVCodecContext
*
avctx
);
/**
/**
* Return the index into tab at which {a,b} match elements {[0],[1]} of tab.
* Return the index into tab at which {a,b} match elements {[0],[1]} of tab.
...
...
libavcodec/mpeg12dec.c
View file @
08303d77
...
@@ -1227,7 +1227,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
...
@@ -1227,7 +1227,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
}
// MPEG-2
}
// MPEG-2
avctx
->
pix_fmt
=
mpeg_get_pixelformat
(
avctx
);
avctx
->
pix_fmt
=
mpeg_get_pixelformat
(
avctx
);
avctx
->
hwaccel
=
ff_find_hwaccel
(
avctx
->
codec
->
id
,
avctx
->
pix_fmt
);
avctx
->
hwaccel
=
ff_find_hwaccel
(
avctx
);
// until then pix_fmt may be changed right after codec init
// until then pix_fmt may be changed right after codec init
if
(
avctx
->
pix_fmt
==
AV_PIX_FMT_XVMC_MPEG2_IDCT
||
if
(
avctx
->
pix_fmt
==
AV_PIX_FMT_XVMC_MPEG2_IDCT
||
avctx
->
hwaccel
)
avctx
->
hwaccel
)
...
@@ -1988,7 +1988,7 @@ static int vcr2_init_sequence(AVCodecContext *avctx)
...
@@ -1988,7 +1988,7 @@ static int vcr2_init_sequence(AVCodecContext *avctx)
s
->
low_delay
=
1
;
s
->
low_delay
=
1
;
avctx
->
pix_fmt
=
mpeg_get_pixelformat
(
avctx
);
avctx
->
pix_fmt
=
mpeg_get_pixelformat
(
avctx
);
avctx
->
hwaccel
=
ff_find_hwaccel
(
avctx
->
codec
->
id
,
avctx
->
pix_fmt
);
avctx
->
hwaccel
=
ff_find_hwaccel
(
avctx
);
if
(
avctx
->
pix_fmt
==
AV_PIX_FMT_XVMC_MPEG2_IDCT
||
avctx
->
hwaccel
)
if
(
avctx
->
pix_fmt
==
AV_PIX_FMT_XVMC_MPEG2_IDCT
||
avctx
->
hwaccel
)
if
(
avctx
->
idct_algo
==
FF_IDCT_AUTO
)
if
(
avctx
->
idct_algo
==
FF_IDCT_AUTO
)
...
...
libavcodec/utils.c
View file @
08303d77
...
@@ -2137,8 +2137,11 @@ AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel)
...
@@ -2137,8 +2137,11 @@ AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel)
return
hwaccel
?
hwaccel
->
next
:
first_hwaccel
;
return
hwaccel
?
hwaccel
->
next
:
first_hwaccel
;
}
}
AVHWAccel
*
ff_find_hwaccel
(
enum
AVCodecID
codec_id
,
enum
AVPixelFormat
pix_fmt
)
AVHWAccel
*
ff_find_hwaccel
(
AVCodecContext
*
avctx
)
{
{
enum
AVCodecID
codec_id
=
avctx
->
codec
->
id
;
enum
AVPixelFormat
pix_fmt
=
avctx
->
pix_fmt
;
AVHWAccel
*
hwaccel
=
NULL
;
AVHWAccel
*
hwaccel
=
NULL
;
while
((
hwaccel
=
av_hwaccel_next
(
hwaccel
)))
while
((
hwaccel
=
av_hwaccel_next
(
hwaccel
)))
...
...
libavcodec/vc1dec.c
View file @
08303d77
...
@@ -5580,7 +5580,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
...
@@ -5580,7 +5580,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
avctx
->
pix_fmt
=
avctx
->
get_format
(
avctx
,
avctx
->
codec
->
pix_fmts
);
avctx
->
pix_fmt
=
avctx
->
get_format
(
avctx
,
avctx
->
codec
->
pix_fmts
);
else
else
avctx
->
pix_fmt
=
AV_PIX_FMT_GRAY8
;
avctx
->
pix_fmt
=
AV_PIX_FMT_GRAY8
;
avctx
->
hwaccel
=
ff_find_hwaccel
(
avctx
->
codec
->
id
,
avctx
->
pix_fmt
);
avctx
->
hwaccel
=
ff_find_hwaccel
(
avctx
);
v
->
s
.
avctx
=
avctx
;
v
->
s
.
avctx
=
avctx
;
avctx
->
flags
|=
CODEC_FLAG_EMU_EDGE
;
avctx
->
flags
|=
CODEC_FLAG_EMU_EDGE
;
v
->
s
.
flags
|=
CODEC_FLAG_EMU_EDGE
;
v
->
s
.
flags
|=
CODEC_FLAG_EMU_EDGE
;
...
...
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