Go to the documentation of this file.
   43 #define BITSTREAM_READER_LE 
   52 #define PALETTE_COUNT 256 
   83     int current_offset = 
s->pixel_ptr - dst->
data[0];
 
   84     int x = (current_offset % dst->
linesize[0]) / (1 + 
s->is_16bpp);
 
   85     int y = current_offset / dst->
linesize[0];
 
   86     int dx = delta_x + x - ((delta_x + x >= 
width) - (delta_x + x < 0)) * 
width;
 
   87     int dy = delta_y + y + (delta_x + x >= 
width) - (delta_x + x < 0);
 
   88     int motion_offset = dy * 
src->linesize[0] + dx * (1 + 
s->is_16bpp);
 
   90     if (motion_offset < 0) {
 
   93     } 
else if (motion_offset > 
s->upper_motion_limit_offset) {
 
   95             motion_offset, 
s->upper_motion_limit_offset);
 
  102     s->hdsp.put_pixels_tab[!
s->is_16bpp][0](
s->pixel_ptr, 
src->data[0] + motion_offset,
 
  124         B = bytestream2_get_byte(&
s->stream_ptr);
 
  126         B = bytestream2_get_byte(&
s->mv_ptr);
 
  133         x = -14 + ((
B - 56) % 29);
 
  134         y =   8 + ((
B - 56) / 29);
 
  137     ff_tlog(
s->avctx, 
"motion byte = %d, (x, y) = (%d, %d)\n", 
B, x, y);
 
  150         B = bytestream2_get_byte(&
s->stream_ptr);
 
  152         B = bytestream2_get_byte(&
s->mv_ptr);
 
  159         x = -(-14 + ((
B - 56) % 29));
 
  160         y = -(  8 + ((
B - 56) / 29));
 
  163     ff_tlog(
s->avctx, 
"motion byte = %d, (x, y) = (%d, %d)\n", 
B, x, y);
 
  170     unsigned char B, 
BL, BH;
 
  174         B = bytestream2_get_byte(&
s->stream_ptr);
 
  176         B = bytestream2_get_byte(&
s->mv_ptr);
 
  180     BH = (
B >> 4) & 0x0F;
 
  184     ff_tlog(
s->avctx, 
"motion byte = %d, (x, y) = (%d, %d)\n", 
B, x, y);
 
  194     x = bytestream2_get_byte(&
s->stream_ptr);
 
  195     y = bytestream2_get_byte(&
s->stream_ptr);
 
  197     ff_tlog(
s->avctx, 
"motion bytes = %d, %d\n", x, y);
 
  222     P[0] = bytestream2_get_byte(&
s->stream_ptr);
 
  223     P[1] = bytestream2_get_byte(&
s->stream_ptr);
 
  228         for (y = 0; y < 8; y++) {
 
  229             flags = bytestream2_get_byte(&
s->stream_ptr) | 0x100;
 
  231                 *
s->pixel_ptr++ = 
P[
flags & 1];
 
  232             s->pixel_ptr += 
s->line_inc;
 
  238         flags = bytestream2_get_le16(&
s->stream_ptr);
 
  239         for (y = 0; y < 8; y += 2) {
 
  240             for (x = 0; x < 8; x += 2, flags >>= 1) {
 
  242                 s->pixel_ptr[x + 1            ] =
 
  243                 s->pixel_ptr[x +     
s->stride] =
 
  244                 s->pixel_ptr[x + 1 + 
s->stride] = 
P[
flags & 1];
 
  246             s->pixel_ptr += 
s->stride * 2;
 
  258     unsigned int flags = 0;
 
  267     P[0] = bytestream2_get_byte(&
s->stream_ptr);
 
  268     P[1] = bytestream2_get_byte(&
s->stream_ptr);
 
  271         for (y = 0; y < 16; y++) {
 
  275                     P[0]  = bytestream2_get_byte(&
s->stream_ptr);
 
  276                     P[1]  = bytestream2_get_byte(&
s->stream_ptr);
 
  278                 flags = bytestream2_get_le16(&
s->stream_ptr);
 
  281             for (x = 0; x < 4; x++, flags >>= 1)
 
  282                 *
s->pixel_ptr++ = 
P[
flags & 1];
 
  283             s->pixel_ptr += 
s->stride - 4;
 
  285             if (y == 7) 
s->pixel_ptr -= 8 * 
s->stride - 4;
 
  289         flags = bytestream2_get_le32(&
s->stream_ptr);
 
  290         P[2] = bytestream2_get_byte(&
s->stream_ptr);
 
  291         P[3] = bytestream2_get_byte(&
s->stream_ptr);
 
  297             for (y = 0; y < 16; y++) {
 
  298                 for (x = 0; x < 4; x++, flags >>= 1)
 
  299                     *
s->pixel_ptr++ = 
P[
flags & 1];
 
  300                 s->pixel_ptr += 
s->stride - 4;
 
  303                     s->pixel_ptr -= 8 * 
s->stride - 4;
 
  306                     flags = bytestream2_get_le32(&
s->stream_ptr);
 
  314             for (y = 0; y < 8; y++) {
 
  318                     flags = bytestream2_get_le32(&
s->stream_ptr);
 
  321                 for (x = 0; x < 8; x++, flags >>= 1)
 
  322                     *
s->pixel_ptr++ = 
P[
flags & 1];
 
  323                 s->pixel_ptr += 
s->line_inc;
 
  349             for (y = 0; y < 8; y++) {
 
  351                 int flags = bytestream2_get_le16(&
s->stream_ptr);
 
  352                 for (x = 0; x < 8; x++, flags >>= 2)
 
  353                     *
s->pixel_ptr++ = 
P[
flags & 0x03];
 
  354                 s->pixel_ptr += 
s->line_inc;
 
  361             flags = bytestream2_get_le32(&
s->stream_ptr);
 
  363             for (y = 0; y < 8; y += 2) {
 
  364                 for (x = 0; x < 8; x += 2, flags >>= 2) {
 
  366                     s->pixel_ptr[x + 1            ] =
 
  367                     s->pixel_ptr[x +     
s->stride] =
 
  368                     s->pixel_ptr[x + 1 + 
s->stride] = 
P[
flags & 0x03];
 
  370                 s->pixel_ptr += 
s->stride * 2;
 
  378         flags = bytestream2_get_le64(&
s->stream_ptr);
 
  380             for (y = 0; y < 8; y++) {
 
  381                 for (x = 0; x < 8; x += 2, flags >>= 2) {
 
  383                     s->pixel_ptr[x + 1] = 
P[
flags & 0x03];
 
  385                 s->pixel_ptr += 
s->stride;
 
  388             for (y = 0; y < 8; y += 2) {
 
  389                 for (x = 0; x < 8; x++, flags >>= 2) {
 
  391                     s->pixel_ptr[x + 
s->stride] = 
P[
flags & 0x03];
 
  393                 s->pixel_ptr += 
s->stride * 2;
 
  420         for (y = 0; y < 16; y++) {
 
  424                 flags = bytestream2_get_le32(&
s->stream_ptr);
 
  427             for (x = 0; x < 4; x++, flags >>= 2)
 
  428                 *
s->pixel_ptr++ = 
P[
flags & 0x03];
 
  430             s->pixel_ptr += 
s->stride - 4;
 
  432             if (y == 7) 
s->pixel_ptr -= 8 * 
s->stride - 4;
 
  438         uint64_t 
flags = bytestream2_get_le64(&
s->stream_ptr);
 
  446         for (y = 0; y < 16; y++) {
 
  447             for (x = 0; x < 4; x++, flags >>= 2)
 
  448                 *
s->pixel_ptr++ = 
P[
flags & 0x03];
 
  451                 s->pixel_ptr += 
s->stride - 4;
 
  453                 if (y == 7) 
s->pixel_ptr -= 8 * 
s->stride - 4;
 
  454             } 
else if (y & 1) 
s->pixel_ptr += 
s->line_inc;
 
  459                 flags = bytestream2_get_le64(&
s->stream_ptr);
 
  473     for (y = 0; y < 8; y++) {
 
  475         s->pixel_ptr  += 
s->stride;
 
  487     for (y = 0; y < 8; y += 2) {
 
  488         for (x = 0; x < 8; x += 2) {
 
  490             s->pixel_ptr[x + 1            ] =
 
  491             s->pixel_ptr[x +     
s->stride] =
 
  492             s->pixel_ptr[x + 1 + 
s->stride] = bytestream2_get_byte(&
s->stream_ptr);
 
  494         s->pixel_ptr += 
s->stride * 2;
 
  512     for (y = 0; y < 8; y++) {
 
  514             P[0] = bytestream2_get_byte(&
s->stream_ptr);
 
  515             P[1] = bytestream2_get_byte(&
s->stream_ptr);
 
  517         memset(
s->pixel_ptr,     
P[0], 4);
 
  518         memset(
s->pixel_ptr + 4, 
P[1], 4);
 
  519         s->pixel_ptr += 
s->stride;
 
  532     pix = bytestream2_get_byte(&
s->stream_ptr);
 
  534     for (y = 0; y < 8; y++) {
 
  535         memset(
s->pixel_ptr, pix, 8);
 
  536         s->pixel_ptr += 
s->stride;
 
  549     sample[0] = bytestream2_get_byte(&
s->stream_ptr);
 
  550     sample[1] = bytestream2_get_byte(&
s->stream_ptr);
 
  552     for (y = 0; y < 8; y++) {
 
  553         for (x = 0; x < 8; x += 2) {
 
  554             *
s->pixel_ptr++ = 
sample[  y & 1 ];
 
  555             *
s->pixel_ptr++ = 
sample[!(y & 1)];
 
  557         s->pixel_ptr += 
s->line_inc;
 
  569     x = bytestream2_get_byte(&
s->stream_ptr);
 
  570     y = bytestream2_get_byte(&
s->stream_ptr);
 
  572     ff_tlog(
s->avctx, 
"motion bytes = %d, %d\n", x, y);
 
  581     uint16_t *pixel_ptr = (uint16_t*)
s->pixel_ptr;
 
  584     P[0] = bytestream2_get_le16(&
s->stream_ptr);
 
  585     P[1] = bytestream2_get_le16(&
s->stream_ptr);
 
  587     if (!(
P[0] & 0x8000)) {
 
  589         for (y = 0; y < 8; y++) {
 
  590             flags = bytestream2_get_byte(&
s->stream_ptr) | 0x100;
 
  592                 *pixel_ptr++ = 
P[
flags & 1];
 
  593             pixel_ptr += 
s->line_inc;
 
  598         flags = bytestream2_get_le16(&
s->stream_ptr);
 
  599         for (y = 0; y < 8; y += 2) {
 
  600             for (x = 0; x < 8; x += 2, flags >>= 1) {
 
  603                 pixel_ptr[x +     
s->stride] =
 
  604                 pixel_ptr[x + 1 + 
s->stride] = 
P[
flags & 1];
 
  606             pixel_ptr += 
s->stride * 2;
 
  617     unsigned int flags = 0;
 
  618     uint16_t *pixel_ptr = (uint16_t*)
s->pixel_ptr;
 
  622     P[0] = bytestream2_get_le16(&
s->stream_ptr);
 
  623     P[1] = bytestream2_get_le16(&
s->stream_ptr);
 
  625     if (!(
P[0] & 0x8000)) {
 
  627         for (y = 0; y < 16; y++) {
 
  631                     P[0] = bytestream2_get_le16(&
s->stream_ptr);
 
  632                     P[1] = bytestream2_get_le16(&
s->stream_ptr);
 
  634                 flags = bytestream2_get_le16(&
s->stream_ptr);
 
  637             for (x = 0; x < 4; x++, flags >>= 1)
 
  638                 *pixel_ptr++ = 
P[
flags & 1];
 
  639             pixel_ptr += 
s->stride - 4;
 
  641             if (y == 7) pixel_ptr -= 8 * 
s->stride - 4;
 
  646         flags = bytestream2_get_le32(&
s->stream_ptr);
 
  647         P[2]  = bytestream2_get_le16(&
s->stream_ptr);
 
  648         P[3]  = bytestream2_get_le16(&
s->stream_ptr);
 
  650         if (!(
P[2] & 0x8000)) {
 
  654             for (y = 0; y < 16; y++) {
 
  655                 for (x = 0; x < 4; x++, flags >>= 1)
 
  656                     *pixel_ptr++ = 
P[
flags & 1];
 
  657                 pixel_ptr += 
s->stride - 4;
 
  660                     pixel_ptr -= 8 * 
s->stride - 4;
 
  663                     flags = bytestream2_get_le32(&
s->stream_ptr);
 
  671             for (y = 0; y < 8; y++) {
 
  675                     flags = bytestream2_get_le32(&
s->stream_ptr);
 
  678                 for (x = 0; x < 8; x++, flags >>= 1)
 
  679                     *pixel_ptr++ = 
P[
flags & 1];
 
  680                 pixel_ptr += 
s->line_inc;
 
  693     uint16_t *pixel_ptr = (uint16_t*)
s->pixel_ptr;
 
  696     for (x = 0; x < 4; x++)
 
  697         P[x] = bytestream2_get_le16(&
s->stream_ptr);
 
  699     if (!(
P[0] & 0x8000)) {
 
  700         if (!(
P[2] & 0x8000)) {
 
  703             for (y = 0; y < 8; y++) {
 
  705                 int flags = bytestream2_get_le16(&
s->stream_ptr);
 
  706                 for (x = 0; x < 8; x++, flags >>= 2)
 
  707                     *pixel_ptr++ = 
P[
flags & 0x03];
 
  708                 pixel_ptr += 
s->line_inc;
 
  715             flags = bytestream2_get_le32(&
s->stream_ptr);
 
  717             for (y = 0; y < 8; y += 2) {
 
  718                 for (x = 0; x < 8; x += 2, flags >>= 2) {
 
  721                     pixel_ptr[x +     
s->stride] =
 
  722                     pixel_ptr[x + 1 + 
s->stride] = 
P[
flags & 0x03];
 
  724                 pixel_ptr += 
s->stride * 2;
 
  732         flags = bytestream2_get_le64(&
s->stream_ptr);
 
  733         if (!(
P[2] & 0x8000)) {
 
  734             for (y = 0; y < 8; y++) {
 
  735                 for (x = 0; x < 8; x += 2, flags >>= 2) {
 
  737                     pixel_ptr[x + 1] = 
P[
flags & 0x03];
 
  739                 pixel_ptr += 
s->stride;
 
  742             for (y = 0; y < 8; y += 2) {
 
  743                 for (x = 0; x < 8; x++, flags >>= 2) {
 
  745                     pixel_ptr[x + 
s->stride] = 
P[
flags & 0x03];
 
  747                 pixel_ptr += 
s->stride * 2;
 
  761     uint16_t *pixel_ptr = (uint16_t*)
s->pixel_ptr;
 
  763     for (x = 0; x < 4; x++)
 
  764         P[x] = bytestream2_get_le16(&
s->stream_ptr);
 
  768     if (!(
P[0] & 0x8000)) {
 
  771         for (y = 0; y < 16; y++) {
 
  775                     for (x = 0; x < 4; x++)
 
  776                         P[x] = bytestream2_get_le16(&
s->stream_ptr);
 
  777                 flags = bytestream2_get_le32(&
s->stream_ptr);
 
  780             for (x = 0; x < 4; x++, flags >>= 2)
 
  781                 *pixel_ptr++ = 
P[
flags & 0x03];
 
  783             pixel_ptr += 
s->stride - 4;
 
  785             if (y == 7) pixel_ptr -= 8 * 
s->stride - 4;
 
  791         uint64_t 
flags = bytestream2_get_le64(&
s->stream_ptr);
 
  793         for (x = 4; x < 8; x++)
 
  794             P[x] = bytestream2_get_le16(&
s->stream_ptr);
 
  795         vert = !(
P[4] & 0x8000);
 
  800         for (y = 0; y < 16; y++) {
 
  801             for (x = 0; x < 4; x++, flags >>= 2)
 
  802                 *pixel_ptr++ = 
P[
flags & 0x03];
 
  805                 pixel_ptr += 
s->stride - 4;
 
  807                 if (y == 7) pixel_ptr -= 8 * 
s->stride - 4;
 
  808             } 
else if (y & 1) pixel_ptr += 
s->line_inc;
 
  813                 flags = bytestream2_get_le64(&
s->stream_ptr);
 
  825     uint16_t *pixel_ptr = (uint16_t*)
s->pixel_ptr;
 
  828     for (y = 0; y < 8; y++) {
 
  829         for (x = 0; x < 8; x++)
 
  830             pixel_ptr[x] = bytestream2_get_le16(&
s->stream_ptr);
 
  831         pixel_ptr  += 
s->stride;
 
  841     uint16_t *pixel_ptr = (uint16_t*)
s->pixel_ptr;
 
  844     for (y = 0; y < 8; y += 2) {
 
  845         for (x = 0; x < 8; x += 2) {
 
  848             pixel_ptr[x +     
s->stride] =
 
  849             pixel_ptr[x + 1 + 
s->stride] = bytestream2_get_le16(&
s->stream_ptr);
 
  851         pixel_ptr += 
s->stride * 2;
 
  862     uint16_t *pixel_ptr = (uint16_t*)
s->pixel_ptr;
 
  865     for (y = 0; y < 8; y++) {
 
  867             P[0] = bytestream2_get_le16(&
s->stream_ptr);
 
  868             P[1] = bytestream2_get_le16(&
s->stream_ptr);
 
  870         for (x = 0; x < 8; x++)
 
  871             pixel_ptr[x] = 
P[x >> 2];
 
  872         pixel_ptr += 
s->stride;
 
  883     uint16_t *pixel_ptr = (uint16_t*)
s->pixel_ptr;
 
  886     pix = bytestream2_get_le16(&
s->stream_ptr);
 
  888     for (y = 0; y < 8; y++) {
 
  889         for (x = 0; x < 8; x++)
 
  891         pixel_ptr += 
s->stride;
 
  927             s->pixel_ptr += 
s->stride;
 
  931         if (
s->avctx->frame_number > 2)
 
  941         off_x = ((uint16_t)opcode - 0xC000) % 
frame->width;
 
  942         off_y = ((uint16_t)opcode - 0xC000) / 
frame->width;
 
  944     } 
else if (opcode > 0) {
 
  945         off_x = ((uint16_t)opcode - 0x4000) % 
frame->width;
 
  946         off_y = ((uint16_t)opcode - 0x4000) / 
frame->width;
 
  963     s->stride = 
frame->linesize[0];
 
  965     s->line_inc = 
s->stride - 8;
 
  966     s->upper_motion_limit_offset = (
s->avctx->height - 8) * 
frame->linesize[0]
 
  967                                   + (
s->avctx->width - 8) * (1 + 
s->is_16bpp);
 
  973         for (y = 0; y < 
s->avctx->height; y += 8) {
 
  974             for (x = 0; x < 
s->avctx->width; x += 8) {
 
  975                 opcode = bytestream2_get_le16(&decoding_map_ptr);
 
  978                         "  block @ (%3d, %3d): opcode 0x%X, data ptr offset %d\n",
 
  981                 s->pixel_ptr = 
frame->data[0] + x + y * 
frame->linesize[0];
 
  989                "decode finished with %d bytes left over\n",
 
 1001             s->pixel_ptr += 
s->stride;
 
 1011         off_x = ((uint16_t)opcode - 0xC000) % 
s->cur_decode_frame->width;
 
 1012         off_y = ((uint16_t)opcode - 0xC000) / 
s->cur_decode_frame->width;
 
 1013         copy_from(
s, 
s->prev_decode_frame, 
s->cur_decode_frame, off_x, off_y);
 
 1014     } 
else if (opcode > 0) {
 
 1015         off_x = ((uint16_t)opcode - 0x4000) % 
s->cur_decode_frame->width;
 
 1016         off_y = ((uint16_t)opcode - 0x4000) / 
s->cur_decode_frame->width;
 
 1017         copy_from(
s, 
s->cur_decode_frame, 
s->cur_decode_frame, off_x, off_y);
 
 1027     int pass, x, y, changed_block;
 
 1028     int16_t opcode, skip;
 
 1036     s->stride = 
frame->linesize[0];
 
 1038     s->line_inc = 
s->stride - 8;
 
 1039     s->upper_motion_limit_offset = (
s->avctx->height - 8) * 
frame->linesize[0]
 
 1040                                   + (
s->avctx->width - 8) * (1 + 
s->is_16bpp);
 
 1048         skip = bytestream2_get_le16(&skip_map_ptr);
 
 1050         for (y = 0; y < 
s->avctx->height; y += 8) {
 
 1051             for (x = 0; x < 
s->avctx->width; x += 8) {
 
 1052                 s->pixel_ptr = 
s->cur_decode_frame->data[0] + x + y * 
s->cur_decode_frame->linesize[0];
 
 1055                     if (skip != -0x8000 && skip) {
 
 1056                         opcode = bytestream2_get_le16(&decoding_map_ptr);
 
 1062                     skip = bytestream2_get_le16(&skip_map_ptr);
 
 1070     skip = bytestream2_get_le16(&skip_map_ptr);
 
 1071     for (y = 0; y < 
s->avctx->height; y += 8) {
 
 1072         for (x = 0; x < 
s->avctx->width; x += 8) {
 
 1074             s->pixel_ptr = 
frame->data[0] + x + y*
frame->linesize[0];
 
 1077                 if (skip != -0x8000 && skip) {
 
 1083                 skip = bytestream2_get_le16(&skip_map_ptr);
 
 1086             if (changed_block) {
 
 1090                 if (
s->avctx->frame_number)
 
 1101                "decode finished with %d bytes left over\n",
 
 1109     unsigned char opcode;
 
 1118         s->stride = 
frame->linesize[0];
 
 1120         s->stride = 
frame->linesize[0] >> 1;
 
 1121         s->mv_ptr = 
s->stream_ptr;
 
 1124     s->line_inc = 
s->stride - 8;
 
 1125     s->upper_motion_limit_offset = (
s->avctx->height - 8) * 
frame->linesize[0]
 
 1126                                   + (
s->avctx->width - 8) * (1 + 
s->is_16bpp);
 
 1129     for (y = 0; y < 
s->avctx->height; y += 8) {
 
 1130         for (x = 0; x < 
s->avctx->width; x += 8) {
 
 1136                     "  block @ (%3d, %3d): encoding 0x%X, data ptr offset %d\n",
 
 1140                 s->pixel_ptr = 
frame->data[0] + x
 
 1141                               + y*
frame->linesize[0];
 
 1144                 s->pixel_ptr = 
frame->data[0] + x*2
 
 1145                               + y*
frame->linesize[0];
 
 1150                        s->avctx->frame_number, x, y);
 
 1157                "decode finished with %d bytes left over\n",
 
 1177     if (!
s->last_frame || !
s->second_last_frame ||
 
 1178         !
s->cur_decode_frame || !
s->prev_decode_frame) {
 
 1182     s->cur_decode_frame->width   = avctx->
width;
 
 1183     s->prev_decode_frame->width  = avctx->
width;
 
 1184     s->cur_decode_frame->height  = avctx->
height;
 
 1185     s->prev_decode_frame->height = avctx->
height;
 
 1186     s->cur_decode_frame->format  = avctx->
pix_fmt;
 
 1187     s->prev_decode_frame->format = avctx->
pix_fmt;
 
 1195     const uint8_t *buf = avpkt->
data;
 
 1196     int buf_size = avpkt->
size;
 
 1201     int video_data_size;
 
 1210     if (!
s->cur_decode_frame->data[0]) {
 
 1225     frame_format         = 
AV_RL8(buf);
 
 1226     send_buffer          = 
AV_RL8(buf + 1);
 
 1227     video_data_size      = 
AV_RL16(buf + 2);
 
 1228     s->decoding_map_size = 
AV_RL16(buf + 4);
 
 1229     s->skip_map_size     = 
AV_RL16(buf + 6);
 
 1231     switch (frame_format) {
 
 1233         if (
s->decoding_map_size) {
 
 1238         if (
s->skip_map_size) {
 
 1249         s->decoding_map_size = ((
s->avctx->width / 8) * (
s->avctx->height / 8)) * 2;
 
 1250         s->decoding_map = buf + 8 + 14; 
 
 1251         video_data_size -= 
s->decoding_map_size + 14;
 
 1252         if (video_data_size <= 0 || s->decoding_map_size == 0)
 
 1255         if (buf_size < 8 + s->decoding_map_size + 14 + video_data_size)
 
 1258         bytestream2_init(&
s->stream_ptr, buf + 8 + 
s->decoding_map_size + 14, video_data_size);
 
 1263         if (! 
s->decoding_map_size) {
 
 1268         if (! 
s->skip_map_size) {
 
 1278         if (buf_size < 8 + video_data_size + s->decoding_map_size + 
s->skip_map_size)
 
 1282         s->decoding_map = buf + 8 + video_data_size;
 
 1283         s->skip_map = buf + 8 + video_data_size + 
s->decoding_map_size;
 
 1288         if (! 
s->decoding_map_size) {
 
 1293         if (
s->skip_map_size) {
 
 1298         if (buf_size < 8 + video_data_size + s->decoding_map_size)
 
 1302         s->decoding_map = buf + 8 + video_data_size;
 
 1311     if (buf_size < 8 + s->decoding_map_size + video_data_size + 
s->skip_map_size) {
 
 1323     switch (frame_format) {
 
 1335     *got_frame = send_buffer;
 
 1360     .
p.
name         = 
"interplayvideo",
 
  
const unsigned char * decoding_map
 
static av_cold int ipvideo_decode_init(AVCodecContext *avctx)
 
static int ipvideo_decode_block_opcode_0xB(IpvideoContext *s, AVFrame *frame)
 
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
 
static int ipvideo_decode_block_opcode_0x3(IpvideoContext *s, AVFrame *frame)
 
static int get_bits_left(GetBitContext *gb)
 
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
 
static void(*const ipvideo_format_10_passes[])(IpvideoContext *s, AVFrame *frame, int16_t op)
 
@ AV_PKT_DATA_PARAM_CHANGE
An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
 
static int ipvideo_decode_block_opcode_0x2(IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0xC(IpvideoContext *s, AVFrame *frame)
 
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
 
static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s, AVFrame *frame)
 
static av_always_inline int bytestream2_seek(GetByteContext *g, int offset, int whence)
 
This structure describes decoded (raw) audio or video data.
 
AVFrame * cur_decode_frame
 
static void ipvideo_format_10_secondpass(IpvideoContext *s, AVFrame *frame, int16_t opcode)
 
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
 
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
 
static void(*const ipvideo_format_06_passes[])(IpvideoContext *s, AVFrame *frame, int16_t op)
 
static int(*const ipvideo_decode_block[])(IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0x7_16(IpvideoContext *s, AVFrame *frame)
 
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
 
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
 
AVCodec p
The public AVCodec.
 
int flags
AV_CODEC_FLAG_*.
 
static void ipvideo_decode_format_10_opcodes(IpvideoContext *s, AVFrame *frame)
 
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
 
AVFrame * prev_decode_frame
 
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
 
static int ipvideo_decode_block_opcode_0x8_16(IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0x4(IpvideoContext *s, AVFrame *frame)
 
#define FF_CODEC_DECODE_CB(func)
 
const unsigned char * skip_map
 
static int ipvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
 
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
 
static int op(uint8_t **dst, const uint8_t *dst_end, GetByteContext *gb, int pixel, int count, int *x, int width, int linesize)
Perform decode operation.
 
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
 
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
 
int upper_motion_limit_offset
 
static int ipvideo_decode_block_opcode_0x6(IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0x9_16(IpvideoContext *s, AVFrame *frame)
 
GetByteContext stream_ptr
 
av_cold void ff_hpeldsp_init(HpelDSPContext *c, int flags)
 
static int ipvideo_decode_block_opcode_0xA(IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0x1(IpvideoContext *s, AVFrame *frame)
 
static void ipvideo_format_10_firstpass(IpvideoContext *s, AVFrame *frame, int16_t opcode)
 
@ AV_CODEC_ID_INTERPLAY_VIDEO
 
static int ipvideo_decode_block_opcode_0x6_16(IpvideoContext *s, AVFrame *frame)
 
static void ipvideo_decode_format_11_opcodes(IpvideoContext *s, AVFrame *frame)
 
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
 
static void ipvideo_format_06_firstpass(IpvideoContext *s, AVFrame *frame, int16_t opcode)
 
static int ipvideo_decode_block_opcode_0xE(IpvideoContext *s, AVFrame *frame)
 
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
 
static av_always_inline int bytestream2_tell(GetByteContext *g)
 
static av_cold int ipvideo_decode_end(AVCodecContext *avctx)
 
AVFrame * second_last_frame
 
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
 
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
 
static int ipvideo_decode_block_opcode_0x0(IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0x8(IpvideoContext *s, AVFrame *frame)
 
#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.
 
static void ipvideo_format_06_secondpass(IpvideoContext *s, AVFrame *frame, int16_t opcode)
 
static int ipvideo_decode_block_opcode_0x5(IpvideoContext *s, AVFrame *frame)
 
static int ipvideo_decode_block_opcode_0xB_16(IpvideoContext *s, AVFrame *frame)
 
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
 
static int copy_from(IpvideoContext *s, AVFrame *src, AVFrame *dst, int delta_x, int delta_y)
 
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, size_t *size)
Get side information from packet.
 
static int ipvideo_decode_block_opcode_0xC_16(IpvideoContext *s, AVFrame *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...
 
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
 
const char * name
Name of the codec implementation.
 
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
 
static int ipvideo_decode_block_opcode_0xF(IpvideoContext *s, AVFrame *frame)
 
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
 
#define FFSWAP(type, a, b)
 
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
 
main external API structure.
 
static int ipvideo_decode_block_opcode_0x7(IpvideoContext *s, AVFrame *frame)
 
static void ipvideo_decode_format_06_opcodes(IpvideoContext *s, AVFrame *frame)
 
#define AV_CODEC_CAP_PARAM_CHANGE
Codec supports changed parameters at any point.
 
const FFCodec ff_interplay_video_decoder
 
static int ipvideo_decode_block_opcode_0xE_16(IpvideoContext *s, AVFrame *frame)
 
This structure stores compressed data.
 
static int(*const ipvideo_decode_block16[])(IpvideoContext *s, AVFrame *frame)
 
int width
picture width / height.
 
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
 
#define flags(name, subs,...)
 
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
 
static int ipvideo_decode_block_opcode_0xD(IpvideoContext *s, AVFrame *frame)
 
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
 
unsigned char * pixel_ptr
 
int ff_copy_palette(void *dst, const AVPacket *src, void *logctx)
Check whether the side-data of src contains a palette of size AVPALETTE_SIZE; if so,...
 
static int ipvideo_decode_block_opcode_0xD_16(IpvideoContext *s, AVFrame *frame)
 
The official guide to swscale for confused that consecutive non overlapping rectangles of slice_bottom special converter These generally are unscaled converters of common like for each output line the vertical scaler pulls lines from a ring buffer When the ring buffer does not contain the wanted line
 
static int ipvideo_decode_block_opcode_0xA_16(IpvideoContext *s, AVFrame *frame)