1 /*
2 * FLV decoding.
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
22
27
29 {
31
32 /* picture header */
36 }
38 if (format != 0 && format != 1) {
41 }
45 switch (format) {
46 case 0:
49 break;
50 case 1:
53 break;
54 case 2:
55 width = 352;
56 height = 288;
57 break;
58 case 3:
59 width = 176;
60 height = 144;
61 break;
62 case 4:
63 width = 128;
64 height = 96;
65 break;
66 case 5:
67 width = 320;
68 height = 240;
69 break;
70 case 6:
71 width = 160;
72 height = 120;
73 break;
74 default:
75 width = height = 0;
76 break;
77 }
82
87
90
92
95
96 /* PEI */
99
101
104
109 }
110
112
113 return 0;
114 }
115
126 .max_lowres = 3,
129 };
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
const uint8_t * y_dc_scale_table
qscale -> y_dc_scale table
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static av_cold int init(AVCodecContext *avctx)
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel...
const uint8_t ff_mpeg1_dc_scale_table[128]
#define FF_DEBUG_PICT_INFO
char av_get_picture_type_char(enum AVPictureType pict_type)
Return a single letter to describe the given picture type pict_type.
int h263_plus
h263 plus headers
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int unrestricted_mv
mv can point outside of the coded picture
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
const char * name
Name of the codec implementation.
int ff_h263_decode_init(AVCodecContext *avctx)
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
#define AV_CODEC_CAP_DRAW_HORIZ_BAND
Decoder can use draw_horiz_band callback.
int h263_flv
use flv h263 header
static const char * format
int height
picture size. must be a multiple of 16
BYTE int const BYTE int int int height
static void skip_bits1(GetBitContext *s)
rational number numerator/denominator
int f_code
forward MV resolution
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
static enum AVPixelFormat pix_fmts[]
const uint8_t * c_dc_scale_table
qscale -> c_dc_scale table
struct AVCodecContext * avctx
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
int ff_h263_decode_end(AVCodecContext *avctx)
int chroma_qscale
chroma QP
static int skip_1stop_8data_bits(GetBitContext *gb)
int ff_flv_decode_picture_header(MpegEncContext *s)
int h263_long_vectors
use horrible h263v1 long vector mode
AVPixelFormat
Pixel format.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.