return -1; }
static int decode_p_frame(FourXContext *f, uint8_t *buf, int length){    int x, y;    const int width= f->avctx->width;    const int height= f->avctx->height;    uint16_t *src= (uint16_t*)f->last_picture.data[0];    uint16_t *dst= (uint16_t*)f->current_picture.data[0];    const int stride= f->current_picture.linesize[0]>>1;    const int bitstream_size= get32(buf+8);    const int bytestream_size= get32(buf+16);    const int wordstream_size= get32(buf+12);        if(bitstream_size+ bytestream_size+ wordstream_size + 20 != length)        av_log(f->avctx, AV_LOG_ERROR, "lengths %d %d %d %d\n", bitstream_size, bytestream_size, wordstream_size,         bitstream_size+ bytestream_size+ wordstream_size - length);        f->bitstream_buffer= av_fast_realloc(f->bitstream_buffer, &f->bitstream_buffer_size, bitstream_size + FF_INPUT_BUFFER_PADDING_SIZE);    f->dsp.bswap_buf((uint32_t*)f->bitstream_buffer, (uint32_t*)(buf + 20), bitstream_size/4);    init_get_bits(&f->gb, f->bitstream_buffer, 8*bitstream_size);    f->wordstream= (uint16_t*)(buf + 20 + bitstream_size);    f->bytestream= buf + 20 + bitstream_size + wordstream_size;        init_mv(f);        for(y=0; y<height; y+=8){        for(x=0; x<width; x+=8){            decode_p_block(f, dst + x, src + x, 3, 3, stride);        }        src += 8*stride;         dst += 8*stride;     }        if(bitstream_size != (get_bits_count(&f->gb)+31)/32*4)        av_log(f->avctx, AV_LOG_ERROR, " %d %d %d bytes left\n",             bitstream_size - (get_bits_count(&f->gb)+31)/32*4,             bytestream_size - (f->bytestream - (buf + 20 + bitstream_size + wordstream_size)),            wordstream_size - (((uint8_t*)f->wordstream) - (buf + 20 + bitstream_size))        );        return 0;}