diff options
Diffstat (limited to 'libavcodec/libxavs.c')
-rw-r--r-- | libavcodec/libxavs.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/libavcodec/libxavs.c b/libavcodec/libxavs.c index 16026ac..442fc0ee 100644 --- a/libavcodec/libxavs.c +++ b/libavcodec/libxavs.c @@ -2,20 +2,20 @@ * AVS encoding using the xavs library * Copyright (C) 2010 Amanda, Y.N. Wu <amanda11192003@gmail.com> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -89,10 +89,8 @@ static int encode_nals(AVCodecContext *ctx, AVPacket *pkt, for (i = 0; i < nnal; i++) size += nals[i].i_payload; - if ((ret = ff_alloc_packet(pkt, size)) < 0) { - av_log(ctx, AV_LOG_ERROR, "Error getting output packet of size %d.\n", size); + if ((ret = ff_alloc_packet2(ctx, pkt, size)) < 0) return ret; - } p = pkt->data; /* Write the SEI as part of the first frame. */ @@ -146,7 +144,7 @@ static int XAVS_frame(AVCodecContext *ctx, AVPacket *pkt, if (!ret) { if (!frame && !(x4->end_of_stream)) { - if ((ret = ff_alloc_packet(pkt, 4)) < 0) + if ((ret = ff_alloc_packet2(ctx, pkt, 4)) < 0) return ret; pkt->data[0] = 0x0; @@ -390,10 +388,10 @@ static av_cold int XAVS_init(AVCodecContext *avctx) #define OFFSET(x) offsetof(XavsContext, x) #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM static const AVOption options[] = { - { "crf", "Select the quality for constant quality mode", OFFSET(crf), AV_OPT_TYPE_FLOAT, {-1 }, -1, FLT_MAX, VE }, + { "crf", "Select the quality for constant quality mode", OFFSET(crf), AV_OPT_TYPE_FLOAT, {.dbl = -1 }, -1, FLT_MAX, VE }, { "qp", "Constant quantization parameter rate control method",OFFSET(cqp), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, INT_MAX, VE }, { "b-bias", "Influences how often B-frames are used", OFFSET(b_bias), AV_OPT_TYPE_INT, {.i64 = INT_MIN}, INT_MIN, INT_MAX, VE }, - { "cplxblur", "Reduce fluctuations in QP (before curve compression)", OFFSET(cplxblur), AV_OPT_TYPE_FLOAT, {-1 }, -1, FLT_MAX, VE}, + { "cplxblur", "Reduce fluctuations in QP (before curve compression)", OFFSET(cplxblur), AV_OPT_TYPE_FLOAT, {.dbl = -1 }, -1, FLT_MAX, VE}, { "direct-pred", "Direct MV prediction mode", OFFSET(direct_pred), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, INT_MAX, VE, "direct-pred" }, { "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = XAVS_DIRECT_PRED_NONE }, 0, 0, VE, "direct-pred" }, { "spatial", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = XAVS_DIRECT_PRED_SPATIAL }, 0, 0, VE, "direct-pred" }, |