MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / decode_idat

Function decode_idat

libavcodec/lscrdec.c:77–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77static int decode_idat(LSCRContext *s, z_stream *zstream, int length)
78{
79 int ret;
80 zstream->avail_in = FFMIN(length, bytestream2_get_bytes_left(&s->gb));
81 zstream->next_in = s->gb.buffer;
82
83 if (length <= 0)
84 return AVERROR_INVALIDDATA;
85
86 bytestream2_skip(&s->gb, length);
87
88 /* decode one line if possible */
89 while (zstream->avail_in > 0) {
90 ret = inflate(zstream, Z_PARTIAL_FLUSH);
91 if (ret != Z_OK && ret != Z_STREAM_END) {
92 av_log(s->avctx, AV_LOG_ERROR, "inflate returned error %d\n", ret);
93 return AVERROR_EXTERNAL;
94 }
95 if (zstream->avail_out == 0) {
96 if (s->y < s->cur_h) {
97 handle_row(s);
98 }
99 zstream->avail_out = s->crow_size;
100 zstream->next_out = s->crow_buf;
101 }
102 if (ret == Z_STREAM_END && zstream->avail_in > 0) {
103 av_log(s->avctx, AV_LOG_WARNING,
104 "%d undecompressed bytes left in buffer\n", zstream->avail_in);
105 return 0;
106 }
107 }
108 return 0;
109}
110
111static int decode_frame_lscr(AVCodecContext *avctx, AVFrame *rframe,
112 int *got_frame, AVPacket *avpkt)

Callers 1

decode_frame_lscrFunction · 0.85

Calls 5

bytestream2_skipFunction · 0.85
inflateFunction · 0.85
av_logFunction · 0.85
handle_rowFunction · 0.85

Tested by

no test coverage detected