Lines Matching refs:hnm
70 Hnm4VideoContext *hnm = avctx->priv_data;
81 if (writeoffset >= hnm->width * hnm->height) {
86 hnm->current[writeoffset++] = bytestream2_get_byte(&gb);
103 if (offset < 0 || offset + count >= hnm->width * hnm->height) {
106 } else if (writeoffset + count >= hnm->width * hnm->height) {
112 hnm->current[writeoffset++] = hnm->current[offset++];
120 Hnm4VideoContext *hnm = avctx->priv_data;
122 int width = hnm->width;
124 for (y = 0; y < hnm->height; y++) {
125 uint8_t *dst = hnm->processed + y * width;
126 const uint8_t *src = hnm->current;
138 Hnm4VideoContext *hnm = avctx->priv_data;
139 uint8_t *src = hnm->processed;
143 for (y = 0; y < hnm->height; y++) {
144 memcpy(dst, src, hnm->width);
145 src += hnm->width;
152 Hnm4VideoContext *hnm = avctx->priv_data;
167 if (writeoffset + 2 > hnm->width * hnm->height) {
171 hnm->current[writeoffset++] = bytestream2_get_byte(&gb);
172 hnm->current[writeoffset++] = bytestream2_get_byte(&gb);
181 if (writeoffset + count > hnm->width * hnm->height) {
186 hnm->current[writeoffset++] = bytestream2_peek_byte(&gb);
193 if (writeoffset > hnm->width * hnm->height) {
209 if (!backward && offset + 2*count > hnm->width * hnm->height) {
212 } else if (backward && offset + 1 >= hnm->width * hnm->height) {
215 } else if (writeoffset + 2*count > hnm->width * hnm->height) {
222 if (offset < (!!backline)*(2 * hnm->width - 1) + 2*(left-1)) {
227 if (offset < (!!backline)*(2 * hnm->width - 1)) {
236 hnm->current[writeoffset++] = hnm->previous[offset - (2 * hnm->width) + 1];
237 hnm->current[writeoffset++] = hnm->previous[offset++];
240 hnm->current[writeoffset++] = hnm->previous[offset++];
241 hnm->current[writeoffset++] = hnm->previous[offset++];
250 hnm->current[writeoffset++] = hnm->current[offset - (2 * hnm->width) + 1];
251 hnm->current[writeoffset++] = hnm->current[offset++];
254 hnm->current[writeoffset++] = hnm->current[offset++];
255 hnm->current[writeoffset++] = hnm->current[offset++];
267 swap = hnm->current[writeoffset];
268 hnm->current[writeoffset] = hnm->current[writeoffset + 1];
269 hnm->current[writeoffset + 1] = swap;
282 Hnm4VideoContext *hnm = avctx->priv_data;
297 if (writeoffset + hnm->width >= hnm->width * hnm->height) {
301 hnm->current[writeoffset] = bytestream2_get_byte(&gb);
302 hnm->current[writeoffset + hnm->width] = bytestream2_get_byte(&gb);
305 writeoffset += hnm->width;
309 if (writeoffset > hnm->width * hnm->height) {
329 if (offset + hnm->width + count >= hnm->width * hnm->height) {
332 } else if (writeoffset + hnm->width + count >= hnm->width * hnm->height) {
339 hnm->current[writeoffset] = hnm->previous[offset];
340 hnm->current[writeoffset + hnm->width] = hnm->previous[offset + hnm->width];
347 hnm->current[writeoffset] = hnm->current[offset];
348 hnm->current[writeoffset + hnm->width] = hnm->current[offset + hnm->width];
361 Hnm4VideoContext *hnm = avctx->priv_data;
367 eight_bit_colors = src[7] & 0x80 && hnm->version == 0x4a;
381 hnm->palette[writeoffset] = bytestream2_get_be24(&gb);
383 hnm->palette[writeoffset] <<= 2;
384 hnm->palette[writeoffset] |= (0xFFU << 24);
394 Hnm4VideoContext *hnm = avctx->priv_data;
416 memcpy(hnm->previous, hnm->current, hnm->width * hnm->height);
417 if (hnm->version == 0x4a)
418 memcpy(hnm->processed, hnm->current, hnm->width * hnm->height);
424 memcpy(frame->data[1], hnm->palette, 256 * 4);
430 if (hnm->version == 0x4a) {
432 memcpy(hnm->processed, hnm->current, hnm->width * hnm->height);
442 memcpy(frame->data[1], hnm->palette, 256 * 4);
444 FFSWAP(uint8_t *, hnm->current, hnm->previous);
455 Hnm4VideoContext *hnm = avctx->priv_data;
470 hnm->version = avctx->extradata[0];
472 hnm->width = avctx->width;
473 hnm->height = avctx->height;
474 hnm->buffer1 = av_mallocz(avctx->width * avctx->height);
475 hnm->buffer2 = av_mallocz(avctx->width * avctx->height);
476 hnm->processed = av_mallocz(avctx->width * avctx->height);
478 if (!hnm->buffer1 || !hnm->buffer2 || !hnm->processed) {
483 hnm->current = hnm->buffer1;
484 hnm->previous = hnm->buffer2;
491 Hnm4VideoContext *hnm = avctx->priv_data;
493 av_freep(&hnm->buffer1);
494 av_freep(&hnm->buffer2);
495 av_freep(&hnm->processed);