Lines Matching refs:subsamp

183 static int checkBuf(unsigned char *buf, int w, int h, int pf, int subsamp,  in checkBuf()  argument
239 if (subsamp == TJSAMP_GRAY) { in checkBuf()
280 static int checkBufYUV(unsigned char *buf, int w, int h, int subsamp, in checkBufYUV() argument
284 int hsf = tjMCUWidth[subsamp] / 8, vsf = tjMCUHeight[subsamp] / 8; in checkBufYUV()
305 if (subsamp != TJSAMP_GRAY) { in checkBufYUV()
375 char *basename, int subsamp, int jpegQual, int flags) in compTest() argument
392 unsigned long yuvSize = tjBufSizeYUV2(w, pad, h, subsamp); in compTest()
403 subNameLong[subsamp]); in compTest()
404 TRY_TJ(tjEncodeYUV3(handle2, srcBuf, w, 0, h, pf, yuvBuf, pad, subsamp, in compTest()
407 if (checkBufYUV(yuvBuf, w, h, subsamp, sf)) fprintf(stderr, "Passed.\n"); in compTest()
410 fprintf(stderr, "YUV %s %s -> JPEG Q%d ... ", subNameLong[subsamp], in compTest()
412 TRY_TJ(tjCompressFromYUV(handle, yuvBuf, w, pad, h, subsamp, dstBuf, in compTest()
416 subNameLong[subsamp], jpegQual); in compTest()
417 TRY_TJ(tjCompress2(handle, srcBuf, w, 0, h, pf, dstBuf, dstSize, subsamp, in compTest()
422 buStr, subName[subsamp], jpegQual); in compTest()
434 char *basename, int subsamp, int flags, in _decompTest() argument
445 if (_hdrw != w || _hdrh != h || _hdrsubsamp != subsamp) in _decompTest()
455 subsamp); in _decompTest()
464 fprintf(stderr, "JPEG -> YUV %s ", subNameLong[subsamp]); in _decompTest()
470 if (checkBufYUV(yuvBuf, scaledWidth, scaledHeight, subsamp, sf)) in _decompTest()
474 fprintf(stderr, "YUV %s -> %s %s ... ", subNameLong[subsamp], in _decompTest()
477 TRY_TJ(tjDecodeYUV(handle2, yuvBuf, pad, subsamp, dstBuf, scaledWidth, 0, in _decompTest()
490 if (checkBuf(dstBuf, scaledWidth, scaledHeight, pf, subsamp, sf, flags)) in _decompTest()
503 char *basename, int subsamp, int flags) in decompTest() argument
511 if (subsamp == TJSAMP_444 || subsamp == TJSAMP_GRAY || in decompTest()
512 (subsamp == TJSAMP_411 && sf[i].num == 1 && in decompTest()
514 (subsamp != TJSAMP_411 && sf[i].num == 1 && in decompTest()
516 _decompTest(handle, jpegBuf, jpegSize, w, h, pf, basename, subsamp, in decompTest()
525 static void doTest(int w, int h, const int *formats, int nformats, int subsamp, in doTest() argument
534 size = tjBufSize(w, h, subsamp); in doTest()
547 if (subsamp == TJSAMP_422 || subsamp == TJSAMP_420 || in doTest()
548 subsamp == TJSAMP_440 || subsamp == TJSAMP_411) in doTest()
552 compTest(chandle, &dstBuf, &size, w, h, pf, basename, subsamp, 100, in doTest()
554 decompTest(dhandle, dstBuf, size, w, h, pf, basename, subsamp, flags); in doTest()
558 basename, subsamp, flags); in doTest()
612 int w, h, i, subsamp; in bufSizeTest() local
620 for (subsamp = 0; subsamp < TJ_NUMSAMP; subsamp++) { in bufSizeTest()
630 if (doYUV) dstSize = tjBufSizeYUV2(w, pad, h, subsamp); in bufSizeTest()
631 else dstSize = tjBufSize(w, h, subsamp); in bufSizeTest()
643 subsamp, 0)); in bufSizeTest()
646 &dstSize, subsamp, 100, in bufSizeTest()
657 if (doYUV) dstSize = tjBufSizeYUV2(h, pad, w, subsamp); in bufSizeTest()
658 else dstSize = tjBufSize(h, w, subsamp); in bufSizeTest()
670 subsamp, 0)); in bufSizeTest()
673 &dstSize, subsamp, 100, in bufSizeTest()