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
7f045c44
Commit
7f045c44
authored
Apr 11, 2016
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: merge ff_h264_free_context() into h264_decode_end()
It is no longer called from outside the h264 decoder.
parent
99c554ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
46 deletions
+34
-46
h264.c
libavcodec/h264.c
+34
-40
h264.h
libavcodec/h264.h
+0
-6
No files found.
libavcodec/h264.c
View file @
7f045c44
...
...
@@ -323,6 +323,39 @@ static int h264_init_context(AVCodecContext *avctx, H264Context *h)
return
0
;
}
static
av_cold
int
h264_decode_end
(
AVCodecContext
*
avctx
)
{
H264Context
*
h
=
avctx
->
priv_data
;
int
i
;
ff_h264_free_tables
(
h
);
for
(
i
=
0
;
i
<
H264_MAX_PICTURE_COUNT
;
i
++
)
{
ff_h264_unref_picture
(
h
,
&
h
->
DPB
[
i
]);
av_frame_free
(
&
h
->
DPB
[
i
].
f
);
}
h
->
cur_pic_ptr
=
NULL
;
for
(
i
=
0
;
i
<
h
->
nb_slice_ctx
;
i
++
)
av_freep
(
&
h
->
slice_ctx
[
i
].
rbsp_buffer
);
av_freep
(
&
h
->
slice_ctx
);
h
->
nb_slice_ctx
=
0
;
for
(
i
=
0
;
i
<
MAX_SPS_COUNT
;
i
++
)
av_buffer_unref
(
&
h
->
ps
.
sps_list
[
i
]);
for
(
i
=
0
;
i
<
MAX_PPS_COUNT
;
i
++
)
av_buffer_unref
(
&
h
->
ps
.
pps_list
[
i
]);
ff_h2645_packet_uninit
(
&
h
->
pkt
);
ff_h264_unref_picture
(
h
,
&
h
->
cur_pic
);
av_frame_free
(
&
h
->
cur_pic
.
f
);
return
0
;
}
static
AVOnce
h264_vlc_init
=
AV_ONCE_INIT
;
av_cold
int
ff_h264_decode_init
(
AVCodecContext
*
avctx
)
...
...
@@ -351,7 +384,7 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx)
&
h
->
ps
,
&
h
->
is_avc
,
&
h
->
nal_length_size
,
avctx
->
err_recognition
,
avctx
);
if
(
ret
<
0
)
{
ff_h264_free_context
(
h
);
h264_decode_end
(
avctx
);
return
ret
;
}
}
...
...
@@ -1064,45 +1097,6 @@ out:
return
get_consumed_bytes
(
buf_index
,
buf_size
);
}
av_cold
void
ff_h264_free_context
(
H264Context
*
h
)
{
int
i
;
ff_h264_free_tables
(
h
);
for
(
i
=
0
;
i
<
H264_MAX_PICTURE_COUNT
;
i
++
)
{
ff_h264_unref_picture
(
h
,
&
h
->
DPB
[
i
]);
av_frame_free
(
&
h
->
DPB
[
i
].
f
);
}
h
->
cur_pic_ptr
=
NULL
;
for
(
i
=
0
;
i
<
h
->
nb_slice_ctx
;
i
++
)
av_freep
(
&
h
->
slice_ctx
[
i
].
rbsp_buffer
);
av_freep
(
&
h
->
slice_ctx
);
h
->
nb_slice_ctx
=
0
;
for
(
i
=
0
;
i
<
MAX_SPS_COUNT
;
i
++
)
av_buffer_unref
(
&
h
->
ps
.
sps_list
[
i
]);
for
(
i
=
0
;
i
<
MAX_PPS_COUNT
;
i
++
)
av_buffer_unref
(
&
h
->
ps
.
pps_list
[
i
]);
ff_h2645_packet_uninit
(
&
h
->
pkt
);
}
static
av_cold
int
h264_decode_end
(
AVCodecContext
*
avctx
)
{
H264Context
*
h
=
avctx
->
priv_data
;
ff_h264_free_context
(
h
);
ff_h264_unref_picture
(
h
,
&
h
->
cur_pic
);
av_frame_free
(
&
h
->
cur_pic
.
f
);
return
0
;
}
#define OFFSET(x) offsetof(H264Context, x)
#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
static
const
AVOption
h264_options
[]
=
{
...
...
libavcodec/h264.h
View file @
7f045c44
...
...
@@ -668,12 +668,6 @@ int ff_h264_decode_seq_parameter_set(GetBitContext *gb, AVCodecContext *avctx,
int
ff_h264_decode_picture_parameter_set
(
GetBitContext
*
gb
,
AVCodecContext
*
avctx
,
H264ParamSets
*
ps
,
int
bit_length
);
/**
* Free any data that may have been allocated in the H264 context
* like SPS, PPS etc.
*/
void
ff_h264_free_context
(
H264Context
*
h
);
/**
* Reconstruct bitstream slice_type.
*/
...
...
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