Lines Matching defs:out
1996 void (*idct_block_kernel)(stbi_uc *out, int out_stride, short data[64]);
1997 void (*YCbCr_to_RGB_kernel)(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step);
1998 stbi_uc *(*resample_row_hv_2_kernel)(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs);
2136 if(c < 0 || c >= 256) // symbol id out of bounds!
2156 if (j->code_bits < n) return 0; // ran out of bits from stream, return 0s intead of continuing
2171 if (j->code_bits < n) return 0; // ran out of bits from stream, return 0s intead of continuing
2183 if (j->code_bits < 1) return 0; // ran out of bits from stream, return 0s intead of continuing
2465 static void stbi__idct_block(stbi_uc *out, int out_stride, short data[64])
2498 for (i=0, v=val, o=out; i < 8; ++i,v+=8,o+=out_stride) {
2499 // no fast case since the first 1D IDCT spread components out
2512 // if any were out of range, but that was slower
2528 static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64])
2537 // out(0) = c0[even]*x + c0[odd]*y (c0, x, y 16-bit, out 32-bit)
2538 // out(1) = c1[even]*x + c1[odd]*y
2547 // out = in << 12 (in 16-bit, out 32-bit)
2548 #define dct_widen(out, in) \
2549 __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \
2550 __m128i out##_h = _mm_srai_epi32(_mm_unpackhi_epi16(_mm_setzero_si128(), (in)), 4)
2553 #define dct_wadd(out, a, b) \
2554 __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
2555 __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
2558 #define dct_wsub(out, a, b) \
2559 __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \
2560 __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)
2682 _mm_storel_epi64((__m128i *) out, p0); out += out_stride;
2683 _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p0, 0x4e)); out += out_stride;
2684 _mm_storel_epi64((__m128i *) out, p2); out += out_stride;
2685 _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p2, 0x4e)); out += out_stride;
2686 _mm_storel_epi64((__m128i *) out, p1); out += out_stride;
2687 _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p1, 0x4e)); out += out_stride;
2688 _mm_storel_epi64((__m128i *) out, p3); out += out_stride;
2689 _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p3, 0x4e));
2709 static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64])
2726 #define dct_long_mul(out, inq, coeff) \
2727 int32x4_t out##_l = vmull_s16(vget_low_s16(inq), coeff); \
2728 int32x4_t out##_h = vmull_s16(vget_high_s16(inq), coeff)
2730 #define dct_long_mac(out, acc, inq, coeff) \
2731 int32x4_t out##_l = vmlal_s16(acc##_l, vget_low_s16(inq), coeff); \
2732 int32x4_t out##_h = vmlal_s16(acc##_h, vget_high_s16(inq), coeff)
2734 #define dct_widen(out, inq) \
2735 int32x4_t out##_l = vshll_n_s16(vget_low_s16(inq), 12); \
2736 int32x4_t out##_h = vshll_n_s16(vget_high_s16(inq), 12)
2739 #define dct_wadd(out, a, b) \
2740 int32x4_t out##_l = vaddq_s32(a##_l, b##_l); \
2741 int32x4_t out##_h = vaddq_s32(a##_h, b##_h)
2744 #define dct_wsub(out, a, b) \
2745 int32x4_t out##_l = vsubq_s32(a##_l, b##_l); \
2746 int32x4_t out##_h = vsubq_s32(a##_h, b##_h)
2888 vst1_u8(out, p0); out += out_stride;
2889 vst1_u8(out, p1); out += out_stride;
2890 vst1_u8(out, p2); out += out_stride;
2891 vst1_u8(out, p3); out += out_stride;
2892 vst1_u8(out, p4); out += out_stride;
2893 vst1_u8(out, p5); out += out_stride;
2894 vst1_u8(out, p6); out += out_stride;
2895 vst1_u8(out, p7);
2985 // scan out an mcu's worth of this component; that's just determined
3045 // scan out an mcu's worth of this component; that's just determined
3449 typedef stbi_uc *(*resample_row_func)(stbi_uc *out, stbi_uc *in0, stbi_uc *in1,
3454 static stbi_uc *resample_row_1(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
3456 STBI_NOTUSED(out);
3463 static stbi_uc* stbi__resample_row_v_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
3469 out[i] = stbi__div4(3*in_near[i] + in_far[i] + 2);
3470 return out;
3473 static stbi_uc* stbi__resample_row_h_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
3481 out[0] = out[1] = input[0];
3482 return out;
3485 out[0] = input[0];
3486 out[1] = stbi__div4(input[0]*3 + input[1] + 2);
3489 out[i*2+0] = stbi__div4(n+input[i-1]);
3490 out[i*2+1] = stbi__div4(n+input[i+1]);
3492 out[i*2+0] = stbi__div4(input[w-2]*3 + input[w-1] + 2);
3493 out[i*2+1] = input[w-1];
3498 return out;
3503 static stbi_uc *stbi__resample_row_hv_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
3508 out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2);
3509 return out;
3513 out[0] = stbi__div4(t1+2);
3517 out[i*2-1] = stbi__div16(3*t0 + t1 + 8);
3518 out[i*2 ] = stbi__div16(3*t1 + t0 + 8);
3520 out[w*2-1] = stbi__div4(t1+2);
3524 return out;
3528 static stbi_uc *stbi__resample_row_hv_2_simd(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
3534 out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2);
3535 return out;
3585 _mm_storeu_si128((__m128i *) (out + i*2), outv);
3619 vst2_u8(out + i*2, o);
3628 out[i*2] = stbi__div16(3*t1 + t0 + 8);
3633 out[i*2-1] = stbi__div16(3*t0 + t1 + 8);
3634 out[i*2 ] = stbi__div16(3*t1 + t0 + 8);
3636 out[w*2-1] = stbi__div4(t1+2);
3640 return out;
3644 static stbi_uc *stbi__resample_row_generic(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
3651 out[i*hs+j] = in_near[i];
3652 return out;
3658 static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step)
3675 out[0] = (stbi_uc)r;
3676 out[1] = (stbi_uc)g;
3677 out[2] = (stbi_uc)b;
3678 out[3] = 255;
3679 out += step;
3684 static void stbi__YCbCr_to_RGB_simd(stbi_uc *out, stbi_uc const *y, stbi_uc const *pcb, stbi_uc const *pcr, int count, int step)
3742 _mm_storeu_si128((__m128i *) (out + 0), o0);
3743 _mm_storeu_si128((__m128i *) (out + 16), o1);
3744 out += 32;
3789 vst4_u8(out, o);
3790 out += 8*4;
3809 out[0] = (stbi_uc)r;
3810 out[1] = (stbi_uc)g;
3811 out[2] = (stbi_uc)b;
3812 out[3] = 255;
3813 out += step;
3925 stbi_uc *out = output + n * z->s->img_x * j;
3945 out[0] = y[i];
3946 out[1] = coutput[1][i];
3947 out[2] = coutput[2][i];
3948 out[3] = 255;
3949 out += n;
3952 z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n);
3958 out[0] = stbi__blinn_8x8(coutput[0][i], m);
3959 out[1] = stbi__blinn_8x8(coutput[1][i], m);
3960 out[2] = stbi__blinn_8x8(coutput[2][i], m);
3961 out[3] = 255;
3962 out += n;
3965 z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n);
3968 out[0] = stbi__blinn_8x8(255 - out[0], m);
3969 out[1] = stbi__blinn_8x8(255 - out[1], m);
3970 out[2] = stbi__blinn_8x8(255 - out[2], m);
3971 out += n;
3974 z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n);
3978 out[0] = out[1] = out[2] = y[i];
3979 out[3] = 255; // not used if n==3
3980 out += n;
3986 *out++ = stbi__compute_y(coutput[0][i], coutput[1][i], coutput[2][i]);
3988 for (i=0; i < z->s->img_x; ++i, out += 2) {
3989 out[0] = stbi__compute_y(coutput[0][i], coutput[1][i], coutput[2][i]);
3990 out[1] = 255;
3999 out[0] = stbi__compute_y(r, g, b);
4000 out[1] = 255;
4001 out += n;
4005 out[0] = stbi__blinn_8x8(255 - coutput[0][i], coutput[3][i]);
4006 out[1] = 255;
4007 out += n;
4012 for (i=0; i < z->s->img_x; ++i) out[i] = y[i];
4014 for (i=0; i < z->s->img_x; ++i) { *out++ = y[i]; *out++ = 255; }
4611 stbi_uc *idata, *expanded, *out;
4664 a->out = (stbi_uc *) stbi__malloc_mad3(x, y, output_bytes, 0); // extra bytes to write off the end into
4665 if (!a->out) return stbi__err("outofmem", "Out of memory");
4677 stbi_uc *cur = a->out + stride*j;
4766 cur = a->out + stride*j; // start at the beginning of the row again
4779 stbi_uc *cur = a->out + stride*j;
4780 stbi_uc *in = a->out + stride*j + x*out_n - img_width_bytes;
4786 // we can allocate enough data that this never writes out of memory, but it
4829 cur = a->out + stride*j;
4851 stbi_uc *cur = a->out;
4894 a->out + (j*x+i)*out_bytes, out_bytes);
4897 STBI_FREE(a->out);
4902 a->out = final;
4911 stbi_uc *p = z->out;
4936 stbi__uint16 *p = (stbi__uint16*) z->out;
4960 stbi_uc *p, *temp_out, *orig = a->out;
4965 // between here and free(out) below, exitting would leak
4986 STBI_FREE(a->out);
4987 a->out = temp_out;
5038 stbi_uc *p = z->out;
5090 z->out = NULL;
5273 result = p->out;
5274 p->out = NULL;
5287 STBI_FREE(p->out); p->out = NULL;
5532 stbi_uc *out;
5596 out = (stbi_uc *) stbi__malloc_mad3(target, s->img_x, s->img_y, 0);
5597 if (!out) return stbi__errpuc("outofmem", "Out of memory");
5600 if (psize == 0 || psize > 256) { STBI_FREE(out); return stbi__errpuc("invalid", "Corrupt BMP"); }
5612 else { STBI_FREE(out); return stbi__errpuc("bad bpp", "Corrupt BMP"); }
5619 out[z++] = pal[color][0];
5620 out[z++] = pal[color][1];
5621 out[z++] = pal[color][2];
5622 if (target == 4) out[z++] = 255;
5639 out[z++] = pal[v][0];
5640 out[z++] = pal[v][1];
5641 out[z++] = pal[v][2];
5642 if (target == 4) out[z++] = 255;
5645 out[z++] = pal[v][0];
5646 out[z++] = pal[v][1];
5647 out[z++] = pal[v][2];
5648 if (target == 4) out[z++] = 255;
5669 if (!mr || !mg || !mb) { STBI_FREE(out); return stbi__errpuc("bad masks", "Corrupt BMP"); }
5675 if (rcount > 8 || gcount > 8 || bcount > 8 || acount > 8) { STBI_FREE(out); return stbi__errpuc("bad masks", "Corrupt BMP"); }
5681 out[z+2] = stbi__get8(s);
5682 out[z+1] = stbi__get8(s);
5683 out[z+0] = stbi__get8(s);
5687 if (target == 4) out[z++] = a;
5694 out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mr, rshift, rcount));
5695 out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mg, gshift, gcount));
5696 out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mb, bshift, bcount));
5699 if (target == 4) out[z++] = STBI__BYTECAST(a);
5709 out[i] = 255;
5714 stbi_uc *p1 = out + j *s->img_x*target;
5715 stbi_uc *p2 = out + (s->img_y-1-j)*s->img_x*target;
5723 out = stbi__convert_format(out, target, req_comp, s->img_x, s->img_y);
5724 if (out == NULL) return out; // stbi__convert_format frees input on failure
5730 return out;
5851 static void stbi__tga_read_rgb16(stbi__context *s, stbi_uc* out)
5860 out[0] = (stbi_uc)((r * 255)/31);
5861 out[1] = (stbi_uc)((g * 255)/31);
5862 out[2] = (stbi_uc)((b * 255)/31);
5916 return stbi__errpuc("bad format", "Can't find out TGA pixelformat");
6132 stbi_uc *out;
6185 // Find out if the data is compressed.
6200 out = (stbi_uc *) stbi__malloc_mad3(8, w, h, 0);
6203 out = (stbi_uc *) stbi__malloc(4 * w*h);
6205 if (!out) return stbi__errpuc("outofmem", "Out of memory");
6209 //memset( out, 0, pixelCount * 4 );
6229 p = out+channel;
6237 STBI_FREE(out);
6252 stbi__uint16 *q = ((stbi__uint16 *) out) + channel;
6257 stbi_uc *p = out+channel;
6264 stbi__uint16 *q = ((stbi__uint16 *) out) + channel;
6268 stbi_uc *p = out+channel;
6285 stbi__uint16 *pixel = (stbi__uint16 *) out + 4*i;
6297 unsigned char *pixel = out + 4*i;
6313 out = (stbi_uc *) stbi__convert_format16((stbi__uint16 *) out, 4, req_comp, w, h);
6315 out = stbi__convert_format(out, 4, req_comp, w, h);
6316 if (out == NULL) return out; // stbi__convert_format frees input on failure
6323 return out;
6562 stbi_uc *out; // output buffer (always 4 components)
6666 p = &g->out[idx];
6722 return g->out;
6742 return g->out;
6787 if (g->out == 0) {
6792 g->out = (stbi_uc *) stbi__malloc(4 * pcount);
6795 if (!g->out || !g->background || !g->history)
6801 memset(g->out, 0x00, 4 * pcount);
6817 memcpy( &g->out[pi * 4], &two_back[pi * 4], 4 );
6824 memcpy( &g->out[pi * 4], &g->background[pi * 4], 4 );
6834 // background is what out is after the undoing of the previou frame;
6835 memcpy( g->background, g->out, 4 * g->w * g->h );
6899 memcpy( &g->out[pi * 4], &g->pal[g->bgindex], 4 );
6951 static void *stbi__load_gif_main_outofmem(stbi__gif *g, stbi_uc *out, int **delays)
6953 STBI_FREE(g->out);
6957 if (out) STBI_FREE(out);
6967 stbi_uc *out = 0;
6992 if (out) {
6993 void *tmp = (stbi_uc*) STBI_REALLOC_SIZED( out, out_size, layers * stride );
6995 void *ret = stbi__load_gif_main_outofmem(&g, out, delays);
7000 out = (stbi_uc*) tmp;
7007 return stbi__load_gif_main_outofmem(&g, out, delays);
7012 out = (stbi_uc*)stbi__malloc( layers * stride );
7013 if (!out) {
7014 void *ret = stbi__load_gif_main_outofmem(&g, out, delays);
7022 return stbi__load_gif_main_outofmem(&g, out, delays);
7026 memcpy( out + ((layers - 1) * stride), u, stride );
7028 two_back = out + (layers - 2) * stride;
7038 STBI_FREE(g.out);
7044 out = stbi__convert_format(out, 4, req_comp, layers * g.w, g.h);
7047 return out;
7070 } else if (g.out) {
7072 STBI_FREE(g.out);
7513 stbi_uc *out;
7530 out = (stbi_uc *) stbi__malloc_mad4(s->img_n, s->img_x, s->img_y, ri->bits_per_channel / 8, 0);
7531 if (!out) return stbi__errpuc("outofmem", "Out of memory");
7532 if (!stbi__getn(s, out, s->img_n * s->img_x * s->img_y * (ri->bits_per_channel / 8))) {
7533 STBI_FREE(out);
7539 out = (stbi_uc *) stbi__convert_format16((stbi__uint16 *) out, s->img_n, req_comp, s->img_x, s->img_y);
7541 out = stbi__convert_format(out, s->img_n, req_comp, s->img_x, s->img_y);
7543 if (out == NULL) return out; // stbi__convert_format frees input on failure
7545 return out;