mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
lavc/hevc_parse: Don't take a HEVCContext
It's not even used anymore, and the checks are no longer functionally important. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
This commit is contained in:
parent
9ac154d1fa
commit
4791a910c0
@ -2866,7 +2866,7 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)
|
|||||||
|
|
||||||
/* split the input packet into NAL units, so we know the upper bound on the
|
/* split the input packet into NAL units, so we know the upper bound on the
|
||||||
* number of slices in the frame */
|
* number of slices in the frame */
|
||||||
ret = ff_hevc_split_packet(s, &s->pkt, buf, length, s->avctx, s->is_nalff,
|
ret = ff_hevc_split_packet(&s->pkt, buf, length, s->avctx, s->is_nalff,
|
||||||
s->nal_length_size);
|
s->nal_length_size);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR,
|
av_log(s->avctx, AV_LOG_ERROR,
|
||||||
|
@ -1080,13 +1080,13 @@ void ff_hevc_hls_mvd_coding(HEVCContext *s, int x0, int y0, int log2_cb_size);
|
|||||||
/**
|
/**
|
||||||
* Extract the raw (unescaped) HEVC bitstream.
|
* Extract the raw (unescaped) HEVC bitstream.
|
||||||
*/
|
*/
|
||||||
int ff_hevc_extract_rbsp(HEVCContext *s, const uint8_t *src, int length,
|
int ff_hevc_extract_rbsp(const uint8_t *src, int length,
|
||||||
HEVCNAL *nal);
|
HEVCNAL *nal);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Split an input packet into NAL units.
|
* Split an input packet into NAL units.
|
||||||
*/
|
*/
|
||||||
int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, int length,
|
int ff_hevc_split_packet(HEVCPacket *pkt, const uint8_t *buf, int length,
|
||||||
AVCodecContext *avctx, int is_nalff, int nal_length_size);
|
AVCodecContext *avctx, int is_nalff, int nal_length_size);
|
||||||
|
|
||||||
int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id,
|
int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id,
|
||||||
|
@ -29,14 +29,13 @@
|
|||||||
|
|
||||||
/* FIXME: This is adapted from ff_h264_decode_nal, avoiding duplication
|
/* FIXME: This is adapted from ff_h264_decode_nal, avoiding duplication
|
||||||
* between these functions would be nice. */
|
* between these functions would be nice. */
|
||||||
int ff_hevc_extract_rbsp(HEVCContext *s, const uint8_t *src, int length,
|
int ff_hevc_extract_rbsp(const uint8_t *src, int length,
|
||||||
HEVCNAL *nal)
|
HEVCNAL *nal)
|
||||||
{
|
{
|
||||||
int i, si, di;
|
int i, si, di;
|
||||||
uint8_t *dst;
|
uint8_t *dst;
|
||||||
|
|
||||||
if (s)
|
nal->skipped_bytes = 0;
|
||||||
nal->skipped_bytes = 0;
|
|
||||||
#define STARTCODE_TEST \
|
#define STARTCODE_TEST \
|
||||||
if (i + 2 < length && src[i + 1] == 0 && src[i + 2] <= 3) { \
|
if (i + 2 < length && src[i + 1] == 0 && src[i + 2] <= 3) { \
|
||||||
if (src[i + 2] != 3) { \
|
if (src[i + 2] != 3) { \
|
||||||
@ -110,7 +109,7 @@ int ff_hevc_extract_rbsp(HEVCContext *s, const uint8_t *src, int length,
|
|||||||
dst[di++] = 0;
|
dst[di++] = 0;
|
||||||
si += 3;
|
si += 3;
|
||||||
|
|
||||||
if (s && nal->skipped_bytes_pos) {
|
if (nal->skipped_bytes_pos) {
|
||||||
nal->skipped_bytes++;
|
nal->skipped_bytes++;
|
||||||
if (nal->skipped_bytes_pos_size < nal->skipped_bytes) {
|
if (nal->skipped_bytes_pos_size < nal->skipped_bytes) {
|
||||||
nal->skipped_bytes_pos_size *= 2;
|
nal->skipped_bytes_pos_size *= 2;
|
||||||
@ -205,7 +204,7 @@ static int hls_nal_unit(HEVCNAL *nal, AVCodecContext *avctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, int length,
|
int ff_hevc_split_packet(HEVCPacket *pkt, const uint8_t *buf, int length,
|
||||||
AVCodecContext *avctx, int is_nalff, int nal_length_size)
|
AVCodecContext *avctx, int is_nalff, int nal_length_size)
|
||||||
{
|
{
|
||||||
int consumed, ret = 0;
|
int consumed, ret = 0;
|
||||||
@ -269,7 +268,7 @@ int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, in
|
|||||||
}
|
}
|
||||||
nal = &pkt->nals[pkt->nb_nals];
|
nal = &pkt->nals[pkt->nb_nals];
|
||||||
|
|
||||||
consumed = ff_hevc_extract_rbsp(s, buf, extract_length, nal);
|
consumed = ff_hevc_extract_rbsp(buf, extract_length, nal);
|
||||||
if (consumed < 0)
|
if (consumed < 0)
|
||||||
return consumed;
|
return consumed;
|
||||||
|
|
||||||
|
@ -239,7 +239,7 @@ static inline int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
|
|||||||
src_length = 20;
|
src_length = 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
consumed = ff_hevc_extract_rbsp(NULL, buf, src_length, nal);
|
consumed = ff_hevc_extract_rbsp(buf, src_length, nal);
|
||||||
if (consumed < 0)
|
if (consumed < 0)
|
||||||
return consumed;
|
return consumed;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user