Go to the documentation of this file.
43 #define BITSTREAM_READER_LE
51 #define PALETTE_COUNT 256
82 int current_offset =
s->pixel_ptr - dst->
data[0];
83 int x = (current_offset % dst->
linesize[0]) / (1 +
s->is_16bpp);
84 int y = current_offset / dst->
linesize[0];
85 int dx = delta_x + x - ((delta_x + x >=
width) - (delta_x + x < 0)) *
width;
86 int dy = delta_y + y + (delta_x + x >=
width) - (delta_x + x < 0);
87 int motion_offset = dy *
src->linesize[0] + dx * (1 +
s->is_16bpp);
89 if (motion_offset < 0) {
92 }
else if (motion_offset >
s->upper_motion_limit_offset) {
94 motion_offset,
s->upper_motion_limit_offset);
101 s->hdsp.put_pixels_tab[!
s->is_16bpp][0](
s->pixel_ptr,
src->data[0] + motion_offset,
123 B = bytestream2_get_byte(&
s->stream_ptr);
125 B = bytestream2_get_byte(&
s->mv_ptr);
132 x = -14 + ((
B - 56) % 29);
133 y = 8 + ((
B - 56) / 29);
136 ff_tlog(
s->avctx,
"motion byte = %d, (x, y) = (%d, %d)\n",
B, x, y);
149 B = bytestream2_get_byte(&
s->stream_ptr);
151 B = bytestream2_get_byte(&
s->mv_ptr);
158 x = -(-14 + ((
B - 56) % 29));
159 y = -( 8 + ((
B - 56) / 29));
162 ff_tlog(
s->avctx,
"motion byte = %d, (x, y) = (%d, %d)\n",
B, x, y);
169 unsigned char B,
BL, BH;
173 B = bytestream2_get_byte(&
s->stream_ptr);
175 B = bytestream2_get_byte(&
s->mv_ptr);
179 BH = (
B >> 4) & 0x0F;
183 ff_tlog(
s->avctx,
"motion byte = %d, (x, y) = (%d, %d)\n",
B, x, y);
193 x = bytestream2_get_byte(&
s->stream_ptr);
194 y = bytestream2_get_byte(&
s->stream_ptr);
196 ff_tlog(
s->avctx,
"motion bytes = %d, %d\n", x, y);
221 P[0] = bytestream2_get_byte(&
s->stream_ptr);
222 P[1] = bytestream2_get_byte(&
s->stream_ptr);
227 for (y = 0; y < 8; y++) {
228 flags = bytestream2_get_byte(&
s->stream_ptr) | 0x100;
230 *
s->pixel_ptr++ =
P[
flags & 1];
231 s->pixel_ptr +=
s->line_inc;
237 flags = bytestream2_get_le16(&
s->stream_ptr);
238 for (y = 0; y < 8; y += 2) {
239 for (x = 0; x < 8; x += 2, flags >>= 1) {
241 s->pixel_ptr[x + 1 ] =
242 s->pixel_ptr[x +
s->stride] =
243 s->pixel_ptr[x + 1 +
s->stride] =
P[
flags & 1];
245 s->pixel_ptr +=
s->stride * 2;
257 unsigned int flags = 0;
266 P[0] = bytestream2_get_byte(&
s->stream_ptr);
267 P[1] = bytestream2_get_byte(&
s->stream_ptr);
270 for (y = 0; y < 16; y++) {
274 P[0] = bytestream2_get_byte(&
s->stream_ptr);
275 P[1] = bytestream2_get_byte(&
s->stream_ptr);
277 flags = bytestream2_get_le16(&
s->stream_ptr);
280 for (x = 0; x < 4; x++, flags >>= 1)
281 *
s->pixel_ptr++ =
P[
flags & 1];
282 s->pixel_ptr +=
s->stride - 4;
284 if (y == 7)
s->pixel_ptr -= 8 *
s->stride - 4;
288 flags = bytestream2_get_le32(&
s->stream_ptr);
289 P[2] = bytestream2_get_byte(&
s->stream_ptr);
290 P[3] = bytestream2_get_byte(&
s->stream_ptr);
296 for (y = 0; y < 16; y++) {
297 for (x = 0; x < 4; x++, flags >>= 1)
298 *
s->pixel_ptr++ =
P[
flags & 1];
299 s->pixel_ptr +=
s->stride - 4;
302 s->pixel_ptr -= 8 *
s->stride - 4;
305 flags = bytestream2_get_le32(&
s->stream_ptr);
313 for (y = 0; y < 8; y++) {
317 flags = bytestream2_get_le32(&
s->stream_ptr);
320 for (x = 0; x < 8; x++, flags >>= 1)
321 *
s->pixel_ptr++ =
P[
flags & 1];
322 s->pixel_ptr +=
s->line_inc;
348 for (y = 0; y < 8; y++) {
350 int flags = bytestream2_get_le16(&
s->stream_ptr);
351 for (x = 0; x < 8; x++, flags >>= 2)
352 *
s->pixel_ptr++ =
P[
flags & 0x03];
353 s->pixel_ptr +=
s->line_inc;
360 flags = bytestream2_get_le32(&
s->stream_ptr);
362 for (y = 0; y < 8; y += 2) {
363 for (x = 0; x < 8; x += 2, flags >>= 2) {
365 s->pixel_ptr[x + 1 ] =
366 s->pixel_ptr[x +
s->stride] =
367 s->pixel_ptr[x + 1 +
s->stride] =
P[
flags & 0x03];
369 s->pixel_ptr +=
s->stride * 2;
377 flags = bytestream2_get_le64(&
s->stream_ptr);
379 for (y = 0; y < 8; y++) {
380 for (x = 0; x < 8; x += 2, flags >>= 2) {
382 s->pixel_ptr[x + 1] =
P[
flags & 0x03];
384 s->pixel_ptr +=
s->stride;
387 for (y = 0; y < 8; y += 2) {
388 for (x = 0; x < 8; x++, flags >>= 2) {
390 s->pixel_ptr[x +
s->stride] =
P[
flags & 0x03];
392 s->pixel_ptr +=
s->stride * 2;
419 for (y = 0; y < 16; y++) {
423 flags = bytestream2_get_le32(&
s->stream_ptr);
426 for (x = 0; x < 4; x++, flags >>= 2)
427 *
s->pixel_ptr++ =
P[
flags & 0x03];
429 s->pixel_ptr +=
s->stride - 4;
431 if (y == 7)
s->pixel_ptr -= 8 *
s->stride - 4;
437 uint64_t
flags = bytestream2_get_le64(&
s->stream_ptr);
445 for (y = 0; y < 16; y++) {
446 for (x = 0; x < 4; x++, flags >>= 2)
447 *
s->pixel_ptr++ =
P[
flags & 0x03];
450 s->pixel_ptr +=
s->stride - 4;
452 if (y == 7)
s->pixel_ptr -= 8 *
s->stride - 4;
453 }
else if (y & 1)
s->pixel_ptr +=
s->line_inc;
458 flags = bytestream2_get_le64(&
s->stream_ptr);
472 for (y = 0; y < 8; y++) {
474 s->pixel_ptr +=
s->stride;
486 for (y = 0; y < 8; y += 2) {
487 for (x = 0; x < 8; x += 2) {
489 s->pixel_ptr[x + 1 ] =
490 s->pixel_ptr[x +
s->stride] =
491 s->pixel_ptr[x + 1 +
s->stride] = bytestream2_get_byte(&
s->stream_ptr);
493 s->pixel_ptr +=
s->stride * 2;
511 for (y = 0; y < 8; y++) {
513 P[0] = bytestream2_get_byte(&
s->stream_ptr);
514 P[1] = bytestream2_get_byte(&
s->stream_ptr);
516 memset(
s->pixel_ptr,
P[0], 4);
517 memset(
s->pixel_ptr + 4,
P[1], 4);
518 s->pixel_ptr +=
s->stride;
531 pix = bytestream2_get_byte(&
s->stream_ptr);
533 for (y = 0; y < 8; y++) {
534 memset(
s->pixel_ptr, pix, 8);
535 s->pixel_ptr +=
s->stride;
548 sample[0] = bytestream2_get_byte(&
s->stream_ptr);
549 sample[1] = bytestream2_get_byte(&
s->stream_ptr);
551 for (y = 0; y < 8; y++) {
552 for (x = 0; x < 8; x += 2) {
553 *
s->pixel_ptr++ =
sample[ y & 1 ];
554 *
s->pixel_ptr++ =
sample[!(y & 1)];
556 s->pixel_ptr +=
s->line_inc;
568 x = bytestream2_get_byte(&
s->stream_ptr);
569 y = bytestream2_get_byte(&
s->stream_ptr);
571 ff_tlog(
s->avctx,
"motion bytes = %d, %d\n", x, y);
580 uint16_t *pixel_ptr = (uint16_t*)
s->pixel_ptr;
583 P[0] = bytestream2_get_le16(&
s->stream_ptr);
584 P[1] = bytestream2_get_le16(&
s->stream_ptr);
586 if (!(
P[0] & 0x8000)) {
588 for (y = 0; y < 8; y++) {
589 flags = bytestream2_get_byte(&
s->stream_ptr) | 0x100;
591 *pixel_ptr++ =
P[
flags & 1];
592 pixel_ptr +=
s->line_inc;
597 flags = bytestream2_get_le16(&
s->stream_ptr);
598 for (y = 0; y < 8; y += 2) {
599 for (x = 0; x < 8; x += 2, flags >>= 1) {
602 pixel_ptr[x +
s->stride] =
603 pixel_ptr[x + 1 +
s->stride] =
P[
flags & 1];
605 pixel_ptr +=
s->stride * 2;
616 unsigned int flags = 0;
617 uint16_t *pixel_ptr = (uint16_t*)
s->pixel_ptr;
621 P[0] = bytestream2_get_le16(&
s->stream_ptr);
622 P[1] = bytestream2_get_le16(&
s->stream_ptr);
624 if (!(
P[0] & 0x8000)) {
626 for (y = 0; y < 16; y++) {
630 P[0] = bytestream2_get_le16(&
s->stream_ptr);
631 P[1] = bytestream2_get_le16(&
s->stream_ptr);
633 flags = bytestream2_get_le16(&
s->stream_ptr);
636 for (x = 0; x < 4; x++, flags >>= 1)
637 *pixel_ptr++ =
P[
flags & 1];
638 pixel_ptr +=
s->stride - 4;
640 if (y == 7) pixel_ptr -= 8 *
s->stride - 4;
645 flags = bytestream2_get_le32(&
s->stream_ptr);
646 P[2] = bytestream2_get_le16(&
s->stream_ptr);
647 P[3] = bytestream2_get_le16(&
s->stream_ptr);
649 if (!(
P[2] & 0x8000)) {
653 for (y = 0; y < 16; y++) {
654 for (x = 0; x < 4; x++, flags >>= 1)
655 *pixel_ptr++ =
P[
flags & 1];
656 pixel_ptr +=
s->stride - 4;
659 pixel_ptr -= 8 *
s->stride - 4;
662 flags = bytestream2_get_le32(&
s->stream_ptr);
670 for (y = 0; y < 8; y++) {
674 flags = bytestream2_get_le32(&
s->stream_ptr);
677 for (x = 0; x < 8; x++, flags >>= 1)
678 *pixel_ptr++ =
P[
flags & 1];
679 pixel_ptr +=
s->line_inc;
692 uint16_t *pixel_ptr = (uint16_t*)
s->pixel_ptr;
695 for (x = 0; x < 4; x++)
696 P[x] = bytestream2_get_le16(&
s->stream_ptr);
698 if (!(
P[0] & 0x8000)) {
699 if (!(
P[2] & 0x8000)) {
702 for (y = 0; y < 8; y++) {
704 int flags = bytestream2_get_le16(&
s->stream_ptr);
705 for (x = 0; x < 8; x++, flags >>= 2)
706 *pixel_ptr++ =
P[
flags & 0x03];
707 pixel_ptr +=
s->line_inc;
714 flags = bytestream2_get_le32(&
s->stream_ptr);
716 for (y = 0; y < 8; y += 2) {
717 for (x = 0; x < 8; x += 2, flags >>= 2) {
720 pixel_ptr[x +
s->stride] =
721 pixel_ptr[x + 1 +
s->stride] =
P[
flags & 0x03];
723 pixel_ptr +=
s->stride * 2;
731 flags = bytestream2_get_le64(&
s->stream_ptr);
732 if (!(
P[2] & 0x8000)) {
733 for (y = 0; y < 8; y++) {
734 for (x = 0; x < 8; x += 2, flags >>= 2) {
736 pixel_ptr[x + 1] =
P[
flags & 0x03];
738 pixel_ptr +=
s->stride;
741 for (y = 0; y < 8; y += 2) {
742 for (x = 0; x < 8; x++, flags >>= 2) {
744 pixel_ptr[x +
s->stride] =
P[
flags & 0x03];
746 pixel_ptr +=
s->stride * 2;
760 uint16_t *pixel_ptr = (uint16_t*)
s->pixel_ptr;
762 for (x = 0; x < 4; x++)
763 P[x] = bytestream2_get_le16(&
s->stream_ptr);
767 if (!(
P[0] & 0x8000)) {
770 for (y = 0; y < 16; y++) {
774 for (x = 0; x < 4; x++)
775 P[x] = bytestream2_get_le16(&
s->stream_ptr);
776 flags = bytestream2_get_le32(&
s->stream_ptr);
779 for (x = 0; x < 4; x++, flags >>= 2)
780 *pixel_ptr++ =
P[
flags & 0x03];
782 pixel_ptr +=
s->stride - 4;
784 if (y == 7) pixel_ptr -= 8 *
s->stride - 4;
790 uint64_t
flags = bytestream2_get_le64(&
s->stream_ptr);
792 for (x = 4; x < 8; x++)
793 P[x] = bytestream2_get_le16(&
s->stream_ptr);
794 vert = !(
P[4] & 0x8000);
799 for (y = 0; y < 16; y++) {
800 for (x = 0; x < 4; x++, flags >>= 2)
801 *pixel_ptr++ =
P[
flags & 0x03];
804 pixel_ptr +=
s->stride - 4;
806 if (y == 7) pixel_ptr -= 8 *
s->stride - 4;
807 }
else if (y & 1) pixel_ptr +=
s->line_inc;
812 flags = bytestream2_get_le64(&
s->stream_ptr);
824 uint16_t *pixel_ptr = (uint16_t*)
s->pixel_ptr;
827 for (y = 0; y < 8; y++) {
828 for (x = 0; x < 8; x++)
829 pixel_ptr[x] = bytestream2_get_le16(&
s->stream_ptr);
830 pixel_ptr +=
s->stride;
840 uint16_t *pixel_ptr = (uint16_t*)
s->pixel_ptr;
843 for (y = 0; y < 8; y += 2) {
844 for (x = 0; x < 8; x += 2) {
847 pixel_ptr[x +
s->stride] =
848 pixel_ptr[x + 1 +
s->stride] = bytestream2_get_le16(&
s->stream_ptr);
850 pixel_ptr +=
s->stride * 2;
861 uint16_t *pixel_ptr = (uint16_t*)
s->pixel_ptr;
864 for (y = 0; y < 8; y++) {
866 P[0] = bytestream2_get_le16(&
s->stream_ptr);
867 P[1] = bytestream2_get_le16(&
s->stream_ptr);
869 for (x = 0; x < 8; x++)
870 pixel_ptr[x] =
P[x >> 2];
871 pixel_ptr +=
s->stride;
882 uint16_t *pixel_ptr = (uint16_t*)
s->pixel_ptr;
885 pix = bytestream2_get_le16(&
s->stream_ptr);
887 for (y = 0; y < 8; y++) {
888 for (x = 0; x < 8; x++)
890 pixel_ptr +=
s->stride;
926 s->pixel_ptr +=
s->stride;
930 if (
s->avctx->frame_number > 2)
940 off_x = ((uint16_t)opcode - 0xC000) %
frame->width;
941 off_y = ((uint16_t)opcode - 0xC000) /
frame->width;
943 }
else if (opcode > 0) {
944 off_x = ((uint16_t)opcode - 0x4000) %
frame->width;
945 off_y = ((uint16_t)opcode - 0x4000) /
frame->width;
962 s->stride =
frame->linesize[0];
964 s->line_inc =
s->stride - 8;
965 s->upper_motion_limit_offset = (
s->avctx->height - 8) *
frame->linesize[0]
966 + (
s->avctx->width - 8) * (1 +
s->is_16bpp);
972 for (y = 0; y <
s->avctx->height; y += 8) {
973 for (x = 0; x <
s->avctx->width; x += 8) {
974 opcode = bytestream2_get_le16(&decoding_map_ptr);
977 " block @ (%3d, %3d): opcode 0x%X, data ptr offset %d\n",
980 s->pixel_ptr =
frame->data[0] + x + y *
frame->linesize[0];
988 "decode finished with %d bytes left over\n",
1000 s->pixel_ptr +=
s->stride;
1010 off_x = ((uint16_t)opcode - 0xC000) %
s->cur_decode_frame->width;
1011 off_y = ((uint16_t)opcode - 0xC000) /
s->cur_decode_frame->width;
1012 copy_from(
s,
s->prev_decode_frame,
s->cur_decode_frame, off_x, off_y);
1013 }
else if (opcode > 0) {
1014 off_x = ((uint16_t)opcode - 0x4000) %
s->cur_decode_frame->width;
1015 off_y = ((uint16_t)opcode - 0x4000) /
s->cur_decode_frame->width;
1016 copy_from(
s,
s->cur_decode_frame,
s->cur_decode_frame, off_x, off_y);
1026 int pass, x, y, changed_block;
1027 int16_t opcode, skip;
1035 s->stride =
frame->linesize[0];
1037 s->line_inc =
s->stride - 8;
1038 s->upper_motion_limit_offset = (
s->avctx->height - 8) *
frame->linesize[0]
1039 + (
s->avctx->width - 8) * (1 +
s->is_16bpp);
1047 skip = bytestream2_get_le16(&skip_map_ptr);
1049 for (y = 0; y <
s->avctx->height; y += 8) {
1050 for (x = 0; x <
s->avctx->width; x += 8) {
1051 s->pixel_ptr =
s->cur_decode_frame->data[0] + x + y *
s->cur_decode_frame->linesize[0];
1054 if (skip != -0x8000 && skip) {
1055 opcode = bytestream2_get_le16(&decoding_map_ptr);
1061 skip = bytestream2_get_le16(&skip_map_ptr);
1069 skip = bytestream2_get_le16(&skip_map_ptr);
1070 for (y = 0; y <
s->avctx->height; y += 8) {
1071 for (x = 0; x <
s->avctx->width; x += 8) {
1073 s->pixel_ptr =
frame->data[0] + x + y*
frame->linesize[0];
1076 if (skip != -0x8000 && skip) {
1082 skip = bytestream2_get_le16(&skip_map_ptr);
1085 if (changed_block) {
1089 if (
s->avctx->frame_number)
1100 "decode finished with %d bytes left over\n",
1108 unsigned char opcode;
1117 s->stride =
frame->linesize[0];
1119 s->stride =
frame->linesize[0] >> 1;
1120 s->mv_ptr =
s->stream_ptr;
1123 s->line_inc =
s->stride - 8;
1124 s->upper_motion_limit_offset = (
s->avctx->height - 8) *
frame->linesize[0]
1125 + (
s->avctx->width - 8) * (1 +
s->is_16bpp);
1128 for (y = 0; y <
s->avctx->height; y += 8) {
1129 for (x = 0; x <
s->avctx->width; x += 8) {
1135 " block @ (%3d, %3d): encoding 0x%X, data ptr offset %d\n",
1139 s->pixel_ptr =
frame->data[0] + x
1140 + y*
frame->linesize[0];
1143 s->pixel_ptr =
frame->data[0] + x*2
1144 + y*
frame->linesize[0];
1149 s->avctx->frame_number, x, y);
1156 "decode finished with %d bytes left over\n",
1176 if (!
s->last_frame || !
s->second_last_frame ||
1177 !
s->cur_decode_frame || !
s->prev_decode_frame) {
1181 s->cur_decode_frame->width = avctx->
width;
1182 s->prev_decode_frame->width = avctx->
width;
1183 s->cur_decode_frame->height = avctx->
height;
1184 s->prev_decode_frame->height = avctx->
height;
1185 s->cur_decode_frame->format = avctx->
pix_fmt;
1186 s->prev_decode_frame->format = avctx->
pix_fmt;
1192 void *
data,
int *got_frame,
1195 const uint8_t *buf = avpkt->
data;
1196 int buf_size = avpkt->
size;
1202 int video_data_size;
1211 if (!
s->cur_decode_frame->data[0]) {
1226 frame_format =
AV_RL8(buf);
1227 send_buffer =
AV_RL8(buf + 1);
1228 video_data_size =
AV_RL16(buf + 2);
1229 s->decoding_map_size =
AV_RL16(buf + 4);
1230 s->skip_map_size =
AV_RL16(buf + 6);
1232 switch (frame_format) {
1234 if (
s->decoding_map_size) {
1239 if (
s->skip_map_size) {
1250 s->decoding_map_size = ((
s->avctx->width / 8) * (
s->avctx->height / 8)) * 2;
1251 s->decoding_map = buf + 8 + 14;
1252 video_data_size -=
s->decoding_map_size + 14;
1253 if (video_data_size <= 0 || s->decoding_map_size == 0)
1256 if (buf_size < 8 + s->decoding_map_size + 14 + video_data_size)
1259 bytestream2_init(&
s->stream_ptr, buf + 8 +
s->decoding_map_size + 14, video_data_size);
1264 if (!
s->decoding_map_size) {
1269 if (!
s->skip_map_size) {
1279 if (buf_size < 8 + video_data_size + s->decoding_map_size +
s->skip_map_size)
1283 s->decoding_map = buf + 8 + video_data_size;
1284 s->skip_map = buf + 8 + video_data_size +
s->decoding_map_size;
1289 if (!
s->decoding_map_size) {
1294 if (
s->skip_map_size) {
1299 if (buf_size < 8 + video_data_size + s->decoding_map_size)
1303 s->decoding_map = buf + 8 + video_data_size;
1312 if (buf_size < 8 + s->decoding_map_size + video_data_size +
s->skip_map_size) {
1324 switch (frame_format) {
1336 *got_frame = send_buffer;
1361 .
name =
"interplayvideo",
const unsigned char * decoding_map
static av_cold int ipvideo_decode_init(AVCodecContext *avctx)
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
static int ipvideo_decode_block_opcode_0xB(IpvideoContext *s, AVFrame *frame)
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.
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)
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
const unsigned char * skip_map
#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_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
const AVCodec ff_interplay_video_decoder
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.
#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_0xC_16(IpvideoContext *s, AVFrame *frame)
#define AV_PIX_FMT_RGB555
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.
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)