Go to the documentation of this file.
   56 #define CHECK_BLOCK()                                                         \ 
   57     if (total_blocks < 1) {                                                    \ 
   58         av_log(s->avctx, AV_LOG_ERROR,                                         \ 
   59                "Block counter just went negative (this should not happen)\n"); \ 
   60         return AVERROR_INVALIDDATA;                                            \ 
   63 #define ADVANCE_BLOCK()             \ 
   66         if (pixel_ptr >= width)     \ 
   69             row_ptr  += stride * 4; \ 
   76     int width = 
s->avctx->width;
 
   79     uint16_t colorA = 0, colorB;
 
   91     if (bytestream2_peek_byte(&
s->gb) != 0xe1)
 
   93                bytestream2_peek_byte(&
s->gb));
 
   96     chunk_size = bytestream2_get_be32(&
s->gb) & 0x00FFFFFF;
 
  101                "MOV chunk size %d != encoded chunk size %d\n",
 
  107     total_blocks = ((
s->avctx->width + 3) / 4) * ((
s->avctx->height + 3) / 4);
 
  114     pixels = (uint16_t *)
s->frame->data[0];
 
  115     stride = 
s->frame->linesize[0] / 2;
 
  120         uint8_t opcode = bytestream2_get_byte(&
s->gb); 
 
  122         int n_blocks = (opcode & 0x1f) + 1; 
 
  125         if ((opcode & 0x80) == 0) {
 
  126             colorA = (opcode << 8) | bytestream2_get_byte(&
s->gb);
 
  128             if ((bytestream2_peek_byte(&
s->gb) & 0x80) != 0) {
 
  137         n_blocks = 
FFMIN(n_blocks, total_blocks);
 
  139         switch (opcode & 0xe0) {
 
  151             colorA = bytestream2_get_be16(&
s->gb);
 
  154                 block_ptr = row_ptr + pixel_ptr;
 
  155                 for (pixel_y = 0; pixel_y < 4; pixel_y++) {
 
  156                     for (pixel_x = 0; pixel_x < 4; pixel_x++){
 
  157                         pixels[block_ptr] = colorA;
 
  160                     block_ptr += row_inc;
 
  168             colorA = bytestream2_get_be16(&
s->gb);
 
  170             colorB = bytestream2_get_be16(&
s->gb);
 
  179             ta = (colorA >> 10) & 0x1F;
 
  180             tb = (colorB >> 10) & 0x1F;
 
  181             color4[1] |= ((11 * 
ta + 21 * 
tb) >> 5) << 10;
 
  182             color4[2] |= ((21 * 
ta + 11 * 
tb) >> 5) << 10;
 
  185             ta = (colorA >> 5) & 0x1F;
 
  186             tb = (colorB >> 5) & 0x1F;
 
  187             color4[1] |= ((11 * 
ta + 21 * 
tb) >> 5) << 5;
 
  188             color4[2] |= ((21 * 
ta + 11 * 
tb) >> 5) << 5;
 
  193             color4[1] |= ((11 * 
ta + 21 * 
tb) >> 5);
 
  194             color4[2] |= ((21 * 
ta + 11 * 
tb) >> 5);
 
  200                 block_ptr = row_ptr + pixel_ptr;
 
  201                 for (pixel_y = 0; pixel_y < 4; pixel_y++) {
 
  202                     uint8_t 
index = bytestream2_get_byteu(&
s->gb);
 
  203                     for (pixel_x = 0; pixel_x < 4; pixel_x++){
 
  204                         uint8_t idx = (
index >> (2 * (3 - pixel_x))) & 0x03;
 
  205                         pixels[block_ptr] = color4[idx];
 
  208                     block_ptr += row_inc;
 
  219             block_ptr = row_ptr + pixel_ptr;
 
  220             for (pixel_y = 0; pixel_y < 4; pixel_y++) {
 
  221                 for (pixel_x = 0; pixel_x < 4; pixel_x++){
 
  223                     if ((pixel_y != 0) || (pixel_x != 0))
 
  224                         colorA = bytestream2_get_be16u(&
s->gb);
 
  225                     pixels[block_ptr] = colorA;
 
  228                 block_ptr += row_inc;
 
  236                  " Skip remaining %d bytes of chunk data.\n", opcode,
 
  
#define AV_LOG_WARNING
Something somehow does not look correct.
 
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
 
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
 
This structure describes decoded (raw) audio or video data.
 
const FFCodec ff_rpza_decoder
 
static av_cold int rpza_decode_end(AVCodecContext *avctx)
 
AVCodec p
The public AVCodec.
 
static int rpza_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
 
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
 
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
 
#define FF_CODEC_DECODE_CB(func)
 
static int rpza_decode_stream(RpzaContext *s)
 
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
 
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
 
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
 
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
 
#define AV_PIX_FMT_RGB555
 
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
 
const char * name
Name of the codec implementation.
 
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
 
int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Identical in function to ff_get_buffer(), except it reuses the existing buffer if available.
 
main external API structure.
 
static av_cold int rpza_decode_init(AVCodecContext *avctx)
 
This structure stores compressed data.
 
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
 
#define AVERROR_INVALIDDATA
Invalid data found when processing input.