avcodec/rv10enc: Set encode_picture_header in rv10_encode_init()

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-06-28 05:10:42 +02:00
parent 8a431cd8ba
commit 76a005dccf
4 changed files with 10 additions and 9 deletions

View File

@@ -72,7 +72,7 @@
#include "mpeg4videoenc.h"
#include "internal.h"
#include "bytestream.h"
#include "rv10enc.h"
#include "rv20enc.h"
#include "libavutil/refstruct.h"
#include <limits.h>
#include "sp5x.h"
@@ -930,7 +930,6 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
break;
#if CONFIG_RV10_ENCODER
case AV_CODEC_ID_RV10:
m->encode_picture_header = ff_rv10_encode_picture_header;
s->c.out_format = FMT_H263;
avctx->delay = 0;
s->c.low_delay = 1;

View File

@@ -29,9 +29,8 @@
#include "mpegvideo.h"
#include "mpegvideoenc.h"
#include "put_bits.h"
#include "rv10enc.h"
int ff_rv10_encode_picture_header(MPVMainEncContext *const m)
static int rv10_encode_picture_header(MPVMainEncContext *const m)
{
MPVEncContext *const s = &m->s;
int full_frame= 0;
@@ -63,6 +62,10 @@ int ff_rv10_encode_picture_header(MPVMainEncContext *const m)
static av_cold int rv10_encode_init(AVCodecContext *avctx)
{
MPVMainEncContext *const m = avctx->priv_data;
m->encode_picture_header = rv10_encode_picture_header;
if ((avctx->width | avctx->height) & 15) {
av_log(avctx, AV_LOG_ERROR, "width and height must be a multiple of 16\n");
return AVERROR(EINVAL);

View File

@@ -32,7 +32,7 @@
#include "h263data.h"
#include "h263enc.h"
#include "put_bits.h"
#include "rv10enc.h"
#include "rv20enc.h"
int ff_rv20_encode_picture_header(MPVMainEncContext *const m)
{

View File

@@ -18,12 +18,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_RV10ENC_H
#define AVCODEC_RV10ENC_H
#ifndef AVCODEC_RV20ENC_H
#define AVCODEC_RV20ENC_H
typedef struct MPVMainEncContext MPVMainEncContext;
int ff_rv10_encode_picture_header(MPVMainEncContext *m);
int ff_rv20_encode_picture_header(MPVMainEncContext *m);
#endif /* AVCODEC_RV10ENC_H */
#endif /* AVCODEC_RV20ENC_H */