Go to the documentation of this file.
42 int w =
r->s.width,
h =
r->s.height;
58 if (rpr >
r->max_rpr) {
65 "Insufficient extradata - need at least %d bytes, got %d\n",
70 w =
r->s.avctx->extradata[6 + rpr*2] << 2;
71 h =
r->s.avctx->extradata[7 + rpr*2] << 2;
78 mb_size = ((
w + 15) >> 4) * ((
h + 15) >> 4);
92 for(
i = 0;
i < 4;
i++, dst +=
r->intra_types_stride - 4){
93 for(j = 0; j < 4; j+= 2){
99 for(k = 0; k < 2; k++){
100 int A = dst[-
r->intra_types_stride] + 1;
133 return rv30_p_types[
code];
135 return rv30_b_types[
code];
139 const int stride,
const int lim)
144 for(
i = 0;
i < 4;
i++){
159 int loc_lim, cur_lim, left_lim = 0, top_lim = 0;
161 mb_pos = row *
s->mb_stride;
162 for(mb_x = 0; mb_x <
s->mb_width; mb_x++, mb_pos++){
163 int mbtype =
s->current_picture_ptr->mb_type[mb_pos];
165 r->deblock_coefs[mb_pos] = 0xFFFF;
167 r->cbp_chroma[mb_pos] = 0xFF;
173 mb_pos = row *
s->mb_stride;
174 for(mb_x = 0; mb_x <
s->mb_width; mb_x++, mb_pos++){
178 for(j = 0; j < 16; j += 4){
179 Y =
s->current_picture_ptr->f->data[0] + mb_x*16 + (row*16 + j) *
s->linesize + 4 * !mb_x;
180 for(
i = !mb_x;
i < 4;
i++,
Y += 4){
183 if(
r->deblock_coefs[mb_pos] & (1 << ij))
185 else if(!
i &&
r->deblock_coefs[mb_pos - 1] & (1 << (ij + 3)))
187 else if(
i &&
r->deblock_coefs[mb_pos] & (1 << (ij - 1)))
193 for(k = 0; k < 2; k++){
194 int cur_cbp, left_cbp = 0;
195 cur_cbp = (
r->cbp_chroma[mb_pos] >> (k*4)) & 0xF;
197 left_cbp = (
r->cbp_chroma[mb_pos - 1] >> (k*4)) & 0xF;
198 for(j = 0; j < 8; j += 4){
199 C =
s->current_picture_ptr->f->data[k + 1] + mb_x*8 + (row*8 + j) *
s->uvlinesize + 4 * !mb_x;
200 for(
i = !mb_x;
i < 2;
i++,
C += 4){
201 int ij =
i + (j >> 1);
203 if (cur_cbp & (1 << ij))
205 else if(!
i && left_cbp & (1 << (ij + 1)))
207 else if(
i && cur_cbp & (1 << (ij - 1)))
215 mb_pos = row *
s->mb_stride;
216 for(mb_x = 0; mb_x <
s->mb_width; mb_x++, mb_pos++){
220 for(j = 4*!row; j < 16; j += 4){
221 Y =
s->current_picture_ptr->f->data[0] + mb_x*16 + (row*16 + j) *
s->linesize;
222 for(
i = 0;
i < 4;
i++,
Y += 4){
225 if(
r->deblock_coefs[mb_pos] & (1 << ij))
227 else if(!j &&
r->deblock_coefs[mb_pos -
s->mb_stride] & (1 << (ij + 12)))
229 else if( j &&
r->deblock_coefs[mb_pos] & (1 << (ij - 4)))
235 for(k = 0; k < 2; k++){
236 int cur_cbp, top_cbp = 0;
237 cur_cbp = (
r->cbp_chroma[mb_pos] >> (k*4)) & 0xF;
239 top_cbp = (
r->cbp_chroma[mb_pos -
s->mb_stride] >> (k*4)) & 0xF;
240 for(j = 4*!row; j < 8; j += 4){
241 C =
s->current_picture_ptr->f->data[k+1] + mb_x*8 + (row*8 + j) *
s->uvlinesize;
242 for(
i = 0;
i < 2;
i++,
C += 4){
243 int ij =
i + (j >> 1);
245 if (
r->cbp_chroma[mb_pos] & (1 << ij))
247 else if(!j && top_cbp & (1 << (ij + 2)))
249 else if( j && cur_cbp & (1 << (ij - 2)))
#define AV_LOG_WARNING
Something somehow does not look correct.
av_cold int ff_rv34_decode_end(AVCodecContext *avctx)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
int ff_rv34_get_start_offset(GetBitContext *gb, int mb_size)
Decode starting slice position.
static unsigned get_interleaved_ue_golomb(GetBitContext *gb)
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But a word about which is also called distortion Distortion can be quantified by almost any quality measurement one chooses the sum of squared differences is used but more complex methods that consider psychovisual effects can be used as well It makes no difference in this discussion First step
int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
@ RV34_MB_B_FORWARD
B-frame macroblock, forward prediction.
AVCodec p
The public AVCodec.
av_cold void ff_rv30dsp_init(RV34DSPContext *c)
@ RV34_MB_B_DIRECT
Bidirectionally predicted B-frame macroblock, no motion vectors.
static int rv30_parse_slice_header(RV34DecContext *r, GetBitContext *gb, SliceInfo *si)
s EdgeDetect Foobar g libavfilter vf_edgedetect c libavfilter vf_foobar c edit libavfilter and add an entry for foobar following the pattern of the other filters edit libavfilter allfilters and add an entry for foobar following the pattern of the other filters configure make j< whatever > ffmpeg ffmpeg i you should get a foobar png with Lena edge detected That s your new playground is ready Some little details about what s going which in turn will define variables for the build system and the C
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
av_cold int ff_rv34_decode_init(AVCodecContext *avctx)
Initialize decoder.
#define FF_CODEC_DECODE_CB(func)
static void rv30_loop_filter(RV34DecContext *r, int row)
#define CODEC_LONG_NAME(str)
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
const FFCodec ff_rv30_decoder
@ RV34_MB_SKIP
Skipped block.
static int rv30_decode_mb_info(RV34DecContext *r)
Decode macroblock information.
int type
slice type (intra, inter)
static int rv30_decode_intra_types(RV34DecContext *r, GetBitContext *gb, int8_t *dst)
Decode 4x4 intra types array.
static unsigned int get_bits1(GetBitContext *s)
#define UPDATE_THREAD_CONTEXT(func)
static void rv30_weak_loop_filter(uint8_t *src, const int step, const int stride, const int lim)
int quant
quantizer used for this slice
@ RV34_MB_P_8x8
P-frame macroblock, 8x8 motion compensation partitions.
int(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
@ RV34_MB_B_BACKWARD
B-frame macroblock, backward prediction.
int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict, int *got_picture_ptr, AVPacket *avpkt)
#define FF_CODEC_CAP_ALLOCATE_PROGRESS
static av_always_inline int diff(const struct color_info *a, const struct color_info *b, const int trans_thresh)
void ff_mpeg_flush(AVCodecContext *avctx)
static void skip_bits1(GetBitContext *s)
@ RV34_MB_TYPE_INTRA16x16
Intra macroblock with DCs in a separate 4x4 block.
#define i(width, name, range_min, range_max)
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some it can consider them to be part of the FIFO and delay acknowledging a status change accordingly Example code
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
@ RV34_MB_TYPE_INTRA
Intra macroblock.
const char * name
Name of the codec implementation.
static const uint8_t rv30_luma_dc_quant[32]
DC quantizer mapping for RV30.
essential slice information
main external API structure.
@ AV_PICTURE_TYPE_B
Bi-dir predicted.
#define IS_SEPARATE_DC(a)
static const uint8_t rv30_loop_filt_lim[32]
Loop filter limits are taken from this table.
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
static av_cold int rv30_decode_init(AVCodecContext *avctx)
Initialize decoder.
int coded_width
Bitstream width / height, may be different from width/height e.g.
@ RV34_MB_P_16x16
P-frame macroblock, one motion frame.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static const uint8_t rv30_itype_from_context[900]
This table is used for retrieving the current intra type based on its neighbors and adjustment provid...
static const uint8_t rv30_itype_code[9 *9 *2]
This table is used for storing the differences between the predicted and the real intra type.