|
|
@ -263,18 +263,26 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
case 2: |
|
|
|
case 3: |
|
|
|
|
|
|
|
case 4: |
|
|
|
case 4: |
|
|
|
|
|
|
|
frame->key_frame = 1; |
|
|
|
|
|
|
|
frame->pict_type = AV_PICTURE_TYPE_I; |
|
|
|
|
|
|
|
for (j = 0; j < avctx->height; j++) { |
|
|
|
|
|
|
|
memcpy(outptr, srcptr, avctx->width); |
|
|
|
|
|
|
|
outptr += stride; |
|
|
|
|
|
|
|
srcptr += avctx->width; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 3: |
|
|
|
case 5: |
|
|
|
case 5: |
|
|
|
if (!tmpptr && (compr & 1)) { |
|
|
|
if (!tmpptr) { |
|
|
|
av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n"); |
|
|
|
av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n"); |
|
|
|
if (!(avctx->flags2 & CODEC_FLAG2_SHOW_ALL)) |
|
|
|
if (!(avctx->flags2 & CODEC_FLAG2_SHOW_ALL)) |
|
|
|
return AVERROR_INVALIDDATA; |
|
|
|
return AVERROR_INVALIDDATA; |
|
|
|
} |
|
|
|
} |
|
|
|
frame->key_frame = !(compr & 1); |
|
|
|
frame->key_frame = 0; |
|
|
|
frame->pict_type = (compr & 1) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I; |
|
|
|
frame->pict_type = AV_PICTURE_TYPE_P; |
|
|
|
for(j = 0; j < avctx->height; j++){ |
|
|
|
for (j = 0; j < avctx->height; j++) { |
|
|
|
if((compr & 1) && tmpptr){ |
|
|
|
if(tmpptr){ |
|
|
|
for(i = 0; i < avctx->width; i++) |
|
|
|
for(i = 0; i < avctx->width; i++) |
|
|
|
outptr[i] = srcptr[i] ^ tmpptr[i]; |
|
|
|
outptr[i] = srcptr[i] ^ tmpptr[i]; |
|
|
|
tmpptr += stride; |
|
|
|
tmpptr += stride; |
|
|
|