aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-09-19 09:13:43 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-09-19 09:13:43 +0000
commita949d72e0e4d0c42991b96374291092ac10c29f2 (patch)
tree067931817a2182e701f2642ca15a81a72fafc2b4 /libavcodec/utils.c
parent947ac25a4432192ff5dff5288f2e28334333e59a (diff)
downloadffmpeg-a949d72e0e4d0c42991b96374291092ac10c29f2.tar.gz
avcodec_alloc_context()
Originally committed as revision 954 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 943614da65..1c696e7935 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -49,6 +49,27 @@ void register_avcodec(AVCodec *format)
format->next = NULL;
}
+void avcodec_get_context_defaults(AVCodecContext *s){
+ s->qmin= 2;
+ s->qmax= 31;
+ s->rc_eq= "tex^qComp";
+ s->qcompress= 0.5;
+}
+
+/**
+ * allocates a AVCodecContext and set it to defaults.
+ * this can be deallocated by simply calling free()
+ */
+AVCodecContext *avcodec_alloc_context(){
+ AVCodecContext *avctx= av_mallocz(sizeof(AVCodecContext));
+
+ if(avctx==NULL) return NULL;
+
+ avcodec_get_context_defaults(avctx);
+
+ return avctx;
+}
+
int avcodec_open(AVCodecContext *avctx, AVCodec *codec)
{
int ret;