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
33452aed
Commit
33452aed
authored
Dec 10, 2013
by
Gildas Cocherel
Committed by
Anton Khirnov
Dec 11, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hevc: store the VPS list as an AVBufferRef, just like the others *PS
Signed-off-by:
Anton Khirnov
<
anton@khirnov.net
>
parent
b769cf4b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
10 deletions
+20
-10
hevc.c
libavcodec/hevc.c
+11
-2
hevc.h
libavcodec/hevc.h
+1
-1
hevc_ps.c
libavcodec/hevc_ps.c
+8
-7
No files found.
libavcodec/hevc.c
View file @
33452aed
...
...
@@ -431,7 +431,7 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps)
}
s
->
sps
=
sps
;
s
->
vps
=
s
->
vps_list
[
s
->
sps
->
vps_id
]
;
s
->
vps
=
(
HEVCVPS
*
)
s
->
vps_list
[
s
->
sps
->
vps_id
]
->
data
;
return
0
;
fail:
...
...
@@ -2924,7 +2924,7 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx)
}
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
s
->
vps_list
);
i
++
)
av_
freep
(
&
s
->
vps_list
[
i
]);
av_
buffer_unref
(
&
s
->
vps_list
[
i
]);
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
s
->
sps_list
);
i
++
)
av_buffer_unref
(
&
s
->
sps_list
[
i
]);
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
s
->
pps_list
);
i
++
)
...
...
@@ -2999,6 +2999,15 @@ static int hevc_update_thread_context(AVCodecContext *dst,
}
}
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
s
->
vps_list
);
i
++
)
{
av_buffer_unref
(
&
s
->
vps_list
[
i
]);
if
(
s0
->
vps_list
[
i
])
{
s
->
vps_list
[
i
]
=
av_buffer_ref
(
s0
->
vps_list
[
i
]);
if
(
!
s
->
vps_list
[
i
])
return
AVERROR
(
ENOMEM
);
}
}
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
s
->
sps_list
);
i
++
)
{
av_buffer_unref
(
&
s
->
sps_list
[
i
]);
if
(
s0
->
sps_list
[
i
])
{
...
...
libavcodec/hevc.h
View file @
33452aed
...
...
@@ -843,7 +843,7 @@ typedef struct HEVCContext {
const
HEVCVPS
*
vps
;
const
HEVCSPS
*
sps
;
const
HEVCPPS
*
pps
;
HEVCVPS
*
vps_list
[
MAX_VPS_COUNT
];
AVBufferRef
*
vps_list
[
MAX_VPS_COUNT
];
AVBufferRef
*
sps_list
[
MAX_SPS_COUNT
];
AVBufferRef
*
pps_list
[
MAX_PPS_COUNT
];
...
...
libavcodec/hevc_ps.c
View file @
33452aed
...
...
@@ -328,12 +328,13 @@ int ff_hevc_decode_nal_vps(HEVCContext *s)
GetBitContext
*
gb
=
&
s
->
HEVClc
.
gb
;
int
vps_id
=
0
;
HEVCVPS
*
vps
;
AVBufferRef
*
vps_buf
=
av_buffer_allocz
(
sizeof
(
*
vps
));
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"Decoding VPS
\n
"
);
if
(
!
vps_buf
)
return
AVERROR
(
ENOMEM
);
vps
=
(
HEVCVPS
*
)
vps_buf
->
data
;
vps
=
av_mallocz
(
sizeof
(
*
vps
));
if
(
!
vps
)
return
AVERROR
(
ENOMEM
);
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"Decoding VPS
\n
"
);
vps_id
=
get_bits
(
gb
,
4
);
if
(
vps_id
>=
MAX_VPS_COUNT
)
{
...
...
@@ -410,12 +411,12 @@ int ff_hevc_decode_nal_vps(HEVCContext *s)
}
get_bits1
(
gb
);
/* vps_extension_flag */
av_
free
(
s
->
vps_list
[
vps_id
]);
s
->
vps_list
[
vps_id
]
=
vps
;
av_
buffer_unref
(
&
s
->
vps_list
[
vps_id
]);
s
->
vps_list
[
vps_id
]
=
vps
_buf
;
return
0
;
err:
av_
free
(
vps
);
av_
buffer_unref
(
&
vps_buf
);
return
AVERROR_INVALIDDATA
;
}
...
...
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