Merge commit 'f32aefcf349f2f1367f0143782397643416d18f3'
* commit 'f32aefcf349f2f1367f0143782397643416d18f3': faxcompr: K&R formatting cosmetics Conflicts: libavcodec/faxcompr.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
a5a9bcc876
@ -124,7 +124,8 @@ av_cold void ff_ccitt_unpack_init(void)
|
||||
|
||||
|
||||
static int decode_group3_1d_line(AVCodecContext *avctx, GetBitContext *gb,
|
||||
unsigned int pix_left, int *runs, const int *runend)
|
||||
unsigned int pix_left, int *runs,
|
||||
const int *runend)
|
||||
{
|
||||
int mode = 0;
|
||||
unsigned int run = 0;
|
||||
@ -157,7 +158,8 @@ static int decode_group3_1d_line(AVCodecContext *avctx, GetBitContext *gb,
|
||||
}
|
||||
|
||||
static int decode_group3_2d_line(AVCodecContext *avctx, GetBitContext *gb,
|
||||
unsigned int width, int *runs, const int *runend, const int *ref)
|
||||
unsigned int width, int *runs,
|
||||
const int *runend, const int *ref)
|
||||
{
|
||||
int mode = 0, saved_run = 0, t;
|
||||
int run_off = *ref++;
|
||||
@ -209,7 +211,8 @@ static int decode_group3_2d_line(AVCodecContext *avctx, GetBitContext *gb,
|
||||
mode = !mode;
|
||||
}
|
||||
} else if (cmode == 9 || cmode == 10) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Special modes are not supported (yet)\n");
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Special modes are not supported (yet)\n");
|
||||
return -1;
|
||||
} else { //vertical mode
|
||||
run = run_off - offs + (cmode - 5);
|
||||
@ -274,8 +277,7 @@ static int find_group3_syncmarker(GetBitContext *gb, int srcsize)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int ff_ccitt_unpack(AVCodecContext *avctx,
|
||||
const uint8_t *src, int srcsize,
|
||||
int ff_ccitt_unpack(AVCodecContext *avctx, const uint8_t *src, int srcsize,
|
||||
uint8_t *dst, int height, int stride,
|
||||
enum TiffCompr compr, int opts)
|
||||
{
|
||||
@ -302,19 +304,24 @@ int ff_ccitt_unpack(AVCodecContext *avctx,
|
||||
for (j = 0; j < height; j++) {
|
||||
runend = runs + runsize;
|
||||
if (compr == TIFF_G4) {
|
||||
ret = decode_group3_2d_line(avctx, &gb, avctx->width, runs, runend, ref);
|
||||
ret = decode_group3_2d_line(avctx, &gb, avctx->width, runs, runend,
|
||||
ref);
|
||||
if (ret < 0) {
|
||||
err = -1;
|
||||
goto fail;
|
||||
}
|
||||
} else {
|
||||
int g3d1 = (compr == TIFF_G3) && !(opts & 1);
|
||||
if(compr!=TIFF_CCITT_RLE && has_eol && find_group3_syncmarker(&gb, srcsize*8) < 0)
|
||||
if (compr != TIFF_CCITT_RLE &&
|
||||
has_eol &&
|
||||
find_group3_syncmarker(&gb, srcsize * 8) < 0)
|
||||
break;
|
||||
if (compr == TIFF_CCITT_RLE || g3d1 || get_bits1(&gb))
|
||||
ret = decode_group3_1d_line(avctx, &gb, avctx->width, runs, runend);
|
||||
ret = decode_group3_1d_line(avctx, &gb, avctx->width, runs,
|
||||
runend);
|
||||
else
|
||||
ret = decode_group3_2d_line(avctx, &gb, avctx->width, runs, runend, ref);
|
||||
ret = decode_group3_2d_line(avctx, &gb, avctx->width, runs,
|
||||
runend, ref);
|
||||
if (compr == TIFF_CCITT_RLE)
|
||||
align_get_bits(&gb);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user