annotate ffmpeg/libavcodec/rv10enc.c @ 13:844d341cf643 tip

Back up before ISMIR
author Yading Song <yading.song@eecs.qmul.ac.uk>
date Thu, 31 Oct 2013 13:17:06 +0000
parents 6840f77b83aa
children
rev   line source
yading@10 1 /*
yading@10 2 * RV10 encoder
yading@10 3 * Copyright (c) 2000,2001 Fabrice Bellard
yading@10 4 * Copyright (c) 2002-2004 Michael Niedermayer
yading@10 5 *
yading@10 6 * This file is part of FFmpeg.
yading@10 7 *
yading@10 8 * FFmpeg is free software; you can redistribute it and/or
yading@10 9 * modify it under the terms of the GNU Lesser General Public
yading@10 10 * License as published by the Free Software Foundation; either
yading@10 11 * version 2.1 of the License, or (at your option) any later version.
yading@10 12 *
yading@10 13 * FFmpeg is distributed in the hope that it will be useful,
yading@10 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
yading@10 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
yading@10 16 * Lesser General Public License for more details.
yading@10 17 *
yading@10 18 * You should have received a copy of the GNU Lesser General Public
yading@10 19 * License along with FFmpeg; if not, write to the Free Software
yading@10 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
yading@10 21 */
yading@10 22
yading@10 23 /**
yading@10 24 * @file
yading@10 25 * RV10 encoder
yading@10 26 */
yading@10 27
yading@10 28 #include "mpegvideo.h"
yading@10 29 #include "put_bits.h"
yading@10 30
yading@10 31 void ff_rv10_encode_picture_header(MpegEncContext *s, int picture_number)
yading@10 32 {
yading@10 33 int full_frame= 0;
yading@10 34
yading@10 35 avpriv_align_put_bits(&s->pb);
yading@10 36
yading@10 37 put_bits(&s->pb, 1, 1); /* marker */
yading@10 38
yading@10 39 put_bits(&s->pb, 1, (s->pict_type == AV_PICTURE_TYPE_P));
yading@10 40
yading@10 41 put_bits(&s->pb, 1, 0); /* not PB frame */
yading@10 42
yading@10 43 put_bits(&s->pb, 5, s->qscale);
yading@10 44
yading@10 45 if (s->pict_type == AV_PICTURE_TYPE_I) {
yading@10 46 /* specific MPEG like DC coding not used */
yading@10 47 }
yading@10 48 /* if multiple packets per frame are sent, the position at which
yading@10 49 to display the macroblocks is coded here */
yading@10 50 if(!full_frame){
yading@10 51 put_bits(&s->pb, 6, 0); /* mb_x */
yading@10 52 put_bits(&s->pb, 6, 0); /* mb_y */
yading@10 53 put_bits(&s->pb, 12, s->mb_width * s->mb_height);
yading@10 54 }
yading@10 55
yading@10 56 put_bits(&s->pb, 3, 0); /* ignored */
yading@10 57 }
yading@10 58
yading@10 59 FF_MPV_GENERIC_CLASS(rv10)
yading@10 60
yading@10 61 AVCodec ff_rv10_encoder = {
yading@10 62 .name = "rv10",
yading@10 63 .type = AVMEDIA_TYPE_VIDEO,
yading@10 64 .id = AV_CODEC_ID_RV10,
yading@10 65 .priv_data_size = sizeof(MpegEncContext),
yading@10 66 .init = ff_MPV_encode_init,
yading@10 67 .encode2 = ff_MPV_encode_picture,
yading@10 68 .close = ff_MPV_encode_end,
yading@10 69 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
yading@10 70 .long_name = NULL_IF_CONFIG_SMALL("RealVideo 1.0"),
yading@10 71 .priv_class = &rv10_class,
yading@10 72 };