From patchwork Wed Apr 3 09:22:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baptiste Coudurier X-Patchwork-Id: 12602 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 57BBB447C89 for ; Wed, 3 Apr 2019 12:22:44 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3841568AE74; Wed, 3 Apr 2019 12:22:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 810E768AE53 for ; Wed, 3 Apr 2019 12:22:37 +0300 (EEST) Received: by mail-wr1-f66.google.com with SMTP id s15so1015461wra.12 for ; Wed, 03 Apr 2019 02:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4OP8AgZsIR/TsRn1aouRC34siUuuCePE0SdyJ9nqsR4=; b=im2ffKa7rH3CquGNt6B2UPGCu1MidqtQEa+kgVMXHU4Z4r0UvmWjO1Hlqx4ciiEnkm 2TIAt+AOQaOZtTQJf6La+YTAvwZOcahXLXp04DlCQKbQQ+9TfsaxdJjJgE9rdee0rz/Z Zk0XRg7aqt1hYYgCB37Ch2Uh7SQzr3NdF8H+QIn5M4uXJmr8aQbQjm0QZjhXHqGXjICe v5do3iVVO5GN1JXSO0wpXtLHa3vlMlJLUH7quZn/O8LotljBwFrM7kxtASQ8i5H8FXY9 vJl7H4R6Eh3/SZR7UC0iZd/64GLBd9vrtPnh7ZEHaOu9psFHgM6fw3BXfZH6abfUd/iN ww8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4OP8AgZsIR/TsRn1aouRC34siUuuCePE0SdyJ9nqsR4=; b=mOvWV5X6OljkB7lz9gV7qxZCjd4YXl5lxny2BLyeouk2ZOoBmSb7akqd8XzpUvGr3q GvvpiSlbilW7mg8f/tKwxmqevgAuXdfcVJfDgw8uQfwKWO1f37gpFNkrMKuXtaCmF59P IvgtnSt2KT+Dl46bLPgcGx5aaQ4/kvrIBpQdsW+FcJNzTW7OaKyWx/5dGNBHIA3gDbAn FLMi+Qv8p3u8rmo1uYJqlCSC2OBgnwPrRhMUjFZ3jrnnjPS41uLc2Zrha8WB8snSwq7o z3lK7D0AjmF24Vu04wz6gD1I4RtZaITSFnlSfjwR8mzL8uKKo8bz0B2XlvO/q7IWmv4m Bg5g== X-Gm-Message-State: APjAAAVghTdC6FIxDZgKNKaHtroHEUdRX0YH/DE+cf1VKSG6/+FCMmwN x83D6/U5D22wSoi+7j3GtBnZC+fcMI0= X-Google-Smtp-Source: APXvYqw6vdDQ8tkD1/u4fxzRst5/kwdsnhNo7iOJiZ/VFXDA8ruD5Ue/ycUDWyaox+b/ZIMZMLpwPA== X-Received: by 2002:adf:d84d:: with SMTP id k13mr52948764wrl.154.1554283356668; Wed, 03 Apr 2019 02:22:36 -0700 (PDT) Received: from localhost.localdomain ([109.190.253.14]) by smtp.gmail.com with ESMTPSA id f10sm17396964wrs.17.2019.04.03.02.22.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Apr 2019 02:22:35 -0700 (PDT) From: Baptiste Coudurier To: ffmpeg-devel@ffmpeg.org Date: Wed, 3 Apr 2019 02:22:01 -0700 Message-Id: <20190403092202.31392-1-baptiste.coudurier@gmail.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/h264_parse: change prefix to avpriv for usage in avformat mxf muxer X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Baptiste Coudurier Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavcodec/cbs_h2645.c | 28 ++++++++++++++-------------- libavcodec/extract_extradata_bsf.c | 4 ++-- libavcodec/h2645_parse.c | 6 +++--- libavcodec/h2645_parse.h | 6 +++--- libavcodec/h264_parse.c | 4 ++-- libavcodec/h264_parser.c | 4 ++-- libavcodec/h264_ps.c | 4 ++-- libavcodec/h264_ps.h | 4 ++-- libavcodec/h264_slice.c | 2 +- libavcodec/h264data.c | 2 +- libavcodec/h264data.h | 3 ++- libavcodec/h264dec.c | 10 +++++----- libavcodec/hevc_parse.c | 2 +- libavcodec/hevc_parser.c | 4 ++-- libavcodec/hevcdec.c | 4 ++-- libavcodec/svq3.c | 2 +- 16 files changed, 45 insertions(+), 44 deletions(-) diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c index e74f8dce81..d1f7b2138f 100644 --- a/libavcodec/cbs_h2645.c +++ b/libavcodec/cbs_h2645.c @@ -599,9 +599,9 @@ static int cbs_h2645_split_fragment(CodedBitstreamContext *ctx, } end = bytestream2_tell(&gbc); - err = ff_h2645_packet_split(&priv->read_packet, - frag->data + start, end - start, - ctx->log_ctx, 1, 2, AV_CODEC_ID_H264, 1, 1); + err = avpriv_h2645_packet_split(&priv->read_packet, + frag->data + start, end - start, + ctx->log_ctx, 1, 2, AV_CODEC_ID_H264, 1, 1); if (err < 0) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Failed to split AVCC SPS array.\n"); return err; @@ -623,9 +623,9 @@ static int cbs_h2645_split_fragment(CodedBitstreamContext *ctx, } end = bytestream2_tell(&gbc); - err = ff_h2645_packet_split(&priv->read_packet, - frag->data + start, end - start, - ctx->log_ctx, 1, 2, AV_CODEC_ID_H264, 1, 1); + err = avpriv_h2645_packet_split(&priv->read_packet, + frag->data + start, end - start, + ctx->log_ctx, 1, 2, AV_CODEC_ID_H264, 1, 1); if (err < 0) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Failed to split AVCC PPS array.\n"); return err; @@ -677,9 +677,9 @@ static int cbs_h2645_split_fragment(CodedBitstreamContext *ctx, } end = bytestream2_tell(&gbc); - err = ff_h2645_packet_split(&priv->read_packet, - frag->data + start, end - start, - ctx->log_ctx, 1, 2, AV_CODEC_ID_HEVC, 1, 1); + err = avpriv_h2645_packet_split(&priv->read_packet, + frag->data + start, end - start, + ctx->log_ctx, 1, 2, AV_CODEC_ID_HEVC, 1, 1); if (err < 0) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Failed to split " "HVCC array %d (%d NAL units of type %d).\n", @@ -694,11 +694,11 @@ static int cbs_h2645_split_fragment(CodedBitstreamContext *ctx, } else { // Annex B, or later MP4 with already-known parameters. - err = ff_h2645_packet_split(&priv->read_packet, - frag->data, frag->data_size, - ctx->log_ctx, - priv->mp4, priv->nal_length_size, - codec_id, 1, 1); + err = avpriv_h2645_packet_split(&priv->read_packet, + frag->data, frag->data_size, + ctx->log_ctx, + priv->mp4, priv->nal_length_size, + codec_id, 1, 1); if (err < 0) return err; diff --git a/libavcodec/extract_extradata_bsf.c b/libavcodec/extract_extradata_bsf.c index 17e5deb96b..01ef9bed2a 100644 --- a/libavcodec/extract_extradata_bsf.c +++ b/libavcodec/extract_extradata_bsf.c @@ -156,8 +156,8 @@ static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt, nb_extradata_nal_types = FF_ARRAY_ELEMS(extradata_nal_types_h264); } - ret = ff_h2645_packet_split(&s->h2645_pkt, pkt->data, pkt->size, - ctx, 0, 0, ctx->par_in->codec_id, 1, 0); + ret = avpriv_h2645_packet_split(&s->h2645_pkt, pkt->data, pkt->size, + ctx, 0, 0, ctx->par_in->codec_id, 1, 0); if (ret < 0) return ret; diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c index 24658b3dfa..a20a262af1 100644 --- a/libavcodec/h2645_parse.c +++ b/libavcodec/h2645_parse.c @@ -385,9 +385,9 @@ fail: return; } -int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length, - void *logctx, int is_nalff, int nal_length_size, - enum AVCodecID codec_id, int small_padding, int use_ref) +int avpriv_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length, + void *logctx, int is_nalff, int nal_length_size, + enum AVCodecID codec_id, int small_padding, int use_ref) { GetByteContext bc; int consumed, ret = 0; diff --git a/libavcodec/h2645_parse.h b/libavcodec/h2645_parse.h index 2c29ca517c..c11e7a6d75 100644 --- a/libavcodec/h2645_parse.h +++ b/libavcodec/h2645_parse.h @@ -100,9 +100,9 @@ int ff_h2645_extract_rbsp(const uint8_t *src, int length, H2645RBSP *rbsp, * If use_ref is set, rbsp_buffer will be reference-counted and owned by * the underlying AVBuffer of rbsp_buffer_ref. */ -int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length, - void *logctx, int is_nalff, int nal_length_size, - enum AVCodecID codec_id, int small_padding, int use_ref); +int avpriv_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length, + void *logctx, int is_nalff, int nal_length_size, + enum AVCodecID codec_id, int small_padding, int use_ref); /** * Free all the allocated memory in the packet. diff --git a/libavcodec/h264_parse.c b/libavcodec/h264_parse.c index a075443d17..d791ea838b 100644 --- a/libavcodec/h264_parse.c +++ b/libavcodec/h264_parse.c @@ -364,7 +364,7 @@ static int decode_extradata_ps(const uint8_t *data, int size, H264ParamSets *ps, H2645Packet pkt = { 0 }; int i, ret = 0; - ret = ff_h2645_packet_split(&pkt, data, size, logctx, is_avc, 2, AV_CODEC_ID_H264, 1, 0); + ret = avpriv_h2645_packet_split(&pkt, data, size, logctx, is_avc, 2, AV_CODEC_ID_H264, 1, 0); if (ret < 0) { ret = 0; goto fail; @@ -374,7 +374,7 @@ static int decode_extradata_ps(const uint8_t *data, int size, H264ParamSets *ps, H2645NAL *nal = &pkt.nals[i]; switch (nal->type) { case H264_NAL_SPS: - ret = ff_h264_decode_seq_parameter_set(&nal->gb, logctx, ps, 0); + ret = avpriv_h264_decode_seq_parameter_set(&nal->gb, logctx, ps, 0); if (ret < 0) goto fail; break; diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c index 5f9a9c46ef..8e9a74be23 100644 --- a/libavcodec/h264_parser.c +++ b/libavcodec/h264_parser.c @@ -323,7 +323,7 @@ static inline int parse_nal_units(AVCodecParserContext *s, switch (nal.type) { case H264_NAL_SPS: - ff_h264_decode_seq_parameter_set(&nal.gb, avctx, &p->ps, 0); + avpriv_h264_decode_seq_parameter_set(&nal.gb, avctx, &p->ps, 0); break; case H264_NAL_PPS: ff_h264_decode_picture_parameter_set(&nal.gb, avctx, &p->ps, @@ -343,7 +343,7 @@ static inline int parse_nal_units(AVCodecParserContext *s, case H264_NAL_SLICE: get_ue_golomb_long(&nal.gb); // skip first_mb_in_slice slice_type = get_ue_golomb_31(&nal.gb); - s->pict_type = ff_h264_golomb_to_pict_type[slice_type % 5]; + s->pict_type = avpriv_h264_golomb_to_pict_type[slice_type % 5]; if (p->sei.recovery_point.recovery_frame_cnt >= 0) { /* key frame, since recovery_frame_cnt is set */ s->key_frame = 1; diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c index 17bfa780ce..980b1e189d 100644 --- a/libavcodec/h264_ps.c +++ b/libavcodec/h264_ps.c @@ -330,8 +330,8 @@ void ff_h264_ps_uninit(H264ParamSets *ps) ps->sps = NULL; } -int ff_h264_decode_seq_parameter_set(GetBitContext *gb, AVCodecContext *avctx, - H264ParamSets *ps, int ignore_truncation) +int avpriv_h264_decode_seq_parameter_set(GetBitContext *gb, AVCodecContext *avctx, + H264ParamSets *ps, int ignore_truncation) { AVBufferRef *sps_buf; int profile_idc, level_idc, constraint_set_flags = 0; diff --git a/libavcodec/h264_ps.h b/libavcodec/h264_ps.h index e967b9cbcf..d422ce122e 100644 --- a/libavcodec/h264_ps.h +++ b/libavcodec/h264_ps.h @@ -149,8 +149,8 @@ typedef struct H264ParamSets { /** * Decode SPS */ -int ff_h264_decode_seq_parameter_set(GetBitContext *gb, AVCodecContext *avctx, - H264ParamSets *ps, int ignore_truncation); +int avpriv_h264_decode_seq_parameter_set(GetBitContext *gb, AVCodecContext *avctx, + H264ParamSets *ps, int ignore_truncation); /** * Decode PPS diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 1c9a270fb6..3258ad588d 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -1751,7 +1751,7 @@ static int h264_slice_header_parse(const H264Context *h, H264SliceContext *sl, } else sl->slice_type_fixed = 0; - slice_type = ff_h264_golomb_to_pict_type[slice_type]; + slice_type = avpriv_h264_golomb_to_pict_type[slice_type]; sl->slice_type = slice_type; sl->slice_type_nos = slice_type & 3; diff --git a/libavcodec/h264data.c b/libavcodec/h264data.c index a4c6d93cf0..91b388bded 100644 --- a/libavcodec/h264data.c +++ b/libavcodec/h264data.c @@ -34,7 +34,7 @@ #include "h264dec.h" #include "h264data.h" -const uint8_t ff_h264_golomb_to_pict_type[5] = { +const uint8_t avpriv_h264_golomb_to_pict_type[5] = { AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_SP, AV_PICTURE_TYPE_SI }; diff --git a/libavcodec/h264data.h b/libavcodec/h264data.h index 2968b08b7e..1e80fe3d01 100644 --- a/libavcodec/h264data.h +++ b/libavcodec/h264data.h @@ -23,7 +23,8 @@ #include "h264dec.h" -extern const uint8_t ff_h264_golomb_to_pict_type[5]; +extern const uint8_t avpriv_h264_golomb_to_pict_type[5]; + extern const uint8_t ff_h264_golomb_to_intra4x4_cbp[48]; extern const uint8_t ff_h264_golomb_to_inter_cbp[48]; diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index 837c3b7538..93896413be 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -622,8 +622,8 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size) h->is_avc = 1; } - ret = ff_h2645_packet_split(&h->pkt, buf, buf_size, avctx, h->is_avc, h->nal_length_size, - avctx->codec_id, avctx->flags2 & AV_CODEC_FLAG2_FAST, 0); + ret = avpriv_h2645_packet_split(&h->pkt, buf, buf_size, avctx, h->is_avc, h->nal_length_size, + avctx->codec_id, avctx->flags2 & AV_CODEC_FLAG2_FAST, 0); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Error splitting the input into NAL units.\n"); @@ -716,14 +716,14 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size) if (ret < 0) goto end; } - if (ff_h264_decode_seq_parameter_set(&tmp_gb, avctx, &h->ps, 0) >= 0) + if (avpriv_h264_decode_seq_parameter_set(&tmp_gb, avctx, &h->ps, 0) >= 0) break; av_log(h->avctx, AV_LOG_DEBUG, "SPS decoding failure, trying again with the complete NAL\n"); init_get_bits8(&tmp_gb, nal->raw_data + 1, nal->raw_size - 1); - if (ff_h264_decode_seq_parameter_set(&tmp_gb, avctx, &h->ps, 0) >= 0) + if (avpriv_h264_decode_seq_parameter_set(&tmp_gb, avctx, &h->ps, 0) >= 0) break; - ff_h264_decode_seq_parameter_set(&nal->gb, avctx, &h->ps, 1); + avpriv_h264_decode_seq_parameter_set(&nal->gb, avctx, &h->ps, 1); break; } case H264_NAL_PPS: diff --git a/libavcodec/hevc_parse.c b/libavcodec/hevc_parse.c index dddb293df6..ac0bf09583 100644 --- a/libavcodec/hevc_parse.c +++ b/libavcodec/hevc_parse.c @@ -29,7 +29,7 @@ static int hevc_decode_nal_units(const uint8_t *buf, int buf_size, HEVCParamSets int ret = 0; H2645Packet pkt = { 0 }; - ret = ff_h2645_packet_split(&pkt, buf, buf_size, logctx, is_nalff, + ret = avpriv_h2645_packet_split(&pkt, buf, buf_size, logctx, is_nalff, nal_length_size, AV_CODEC_ID_HEVC, 1, 0); if (ret < 0) { goto done; diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c index b444b99955..de927be84f 100644 --- a/libavcodec/hevc_parser.c +++ b/libavcodec/hevc_parser.c @@ -193,8 +193,8 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf, ff_hevc_reset_sei(sei); - ret = ff_h2645_packet_split(&ctx->pkt, buf, buf_size, avctx, ctx->is_avc, - ctx->nal_length_size, AV_CODEC_ID_HEVC, 1, 0); + ret = avpriv_h2645_packet_split(&ctx->pkt, buf, buf_size, avctx, ctx->is_avc, + ctx->nal_length_size, AV_CODEC_ID_HEVC, 1, 0); if (ret < 0) return ret; diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 857c10dd12..4e15e74067 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -3038,8 +3038,8 @@ 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 * number of slices in the frame */ - ret = ff_h2645_packet_split(&s->pkt, buf, length, s->avctx, s->is_nalff, - s->nal_length_size, s->avctx->codec_id, 1, 0); + ret = avpriv_h2645_packet_split(&s->pkt, buf, length, s->avctx, s->is_nalff, + s->nal_length_size, s->avctx->codec_id, 1, 0); if (ret < 0) { av_log(s->avctx, AV_LOG_ERROR, "Error splitting the input into NAL units.\n"); diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 18a4448ffa..0fffd078dc 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -1065,7 +1065,7 @@ static int svq3_decode_slice_header(AVCodecContext *avctx) return -1; } - s->slice_type = ff_h264_golomb_to_pict_type[slice_id]; + s->slice_type = avpriv_h264_golomb_to_pict_type[slice_id]; if ((header & 0x9F) == 2) { i = (s->mb_num < 64) ? 6 : (1 + av_log2(s->mb_num - 1));