[SCM] libav/experimental: using Juanjo's way to pass forced type - especially as I_TYPE/P_TYPE defines aren't exported in the public interface, and the flagged method matches the way as qscale forcing work
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Jun 30 15:31:17 UTC 2013
The following commit has been merged in the experimental branch:
commit 60e575acc86aa5f1cfd87598f21cdb7b920ab5d5
Author: Arpi <arpi at thot.banki.hu>
Date: Thu Mar 28 23:07:54 2002 +0000
using Juanjo's way to pass forced type - especially as I_TYPE/P_TYPE defines aren't exported in the public interface, and the flagged method matches the way as qscale forcing work
Originally committed as revision 366 to svn://svn.ffmpeg.org/ffmpeg/trunk
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 6b60473..8306ad9 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -69,6 +69,7 @@ extern int motion_estimation_method;
#define CODEC_FLAG_B 0x0008 /* use B frames */
#define CODEC_FLAG_QPEL 0x0010 /* use qpel MC */
#define CODEC_FLAG_GMC 0x0020 /* use GMC */
+#define CODEC_FLAG_TYPE 0x0040 /* fixed I/P frame type, from avctx->key_frame */
/* codec capabilities */
@@ -121,8 +122,6 @@ typedef struct AVCodecContext {
int qmax; /* max qscale */
int max_qdiff; /* max qscale difference between frames */
- int force_type; /* 0= no force, otherwise I_TYPE, P_TYPE, ... */
-
struct AVCodec *codec;
void *priv_data;
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 2a7aca2..55159c6 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -514,7 +514,8 @@ int MPV_encode_picture(AVCodecContext *avctx,
init_put_bits(&s->pb, buf, buf_size, NULL, NULL);
- s->force_type= avctx->force_type;
+ s->force_type= (avctx->flags&CODEC_FLAG_TYPE) ?
+ (avctx->key_frame ? I_TYPE : P_TYPE) : 0;
if (!s->intra_only) {
/* first picture of GOP is intra */
if (s->picture_in_gop_number % s->gop_size==0 || s->force_type==I_TYPE){
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list