Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Chromium | third_party/libusb/src/libusb/os/windows_usb.c |
static int windows_cancel_transfer(struct usbi_transfer *itransfer) {
struct libusb_transfer *transfer =
USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
switch (transfer->type) {
case LIBUSB_TRANSFER_TYPE_CONTROL:
return windows_abort_control(itransfer);
case LIBUSB_TRANSFER_TYPE_BULK:
case LIBUSB_TR... | [
0,
0
] |
Chromium | third_party/libusb/src/libusb/os/windows_usb.c | static int unsupported_open(int sub_api,
struct libusb_device_handle *dev_handle) {
PRINT_UNSUPPORTED_API(open);
} | [
0,
0
] |
Chromium | third_party/libusb/src/libusb/os/windows_usb.c | static void unsupported_close(int sub_api,
struct libusb_device_handle *dev_handle) {
usbi_dbg("unsupported API call for 'close'");
} | [
0,
0
] |
Chromium | third_party/libusb/src/libusb/os/windows_usb.c | static int unsupported_configure_endpoints(
int sub_api, struct libusb_device_handle *dev_handle, int iface) {
PRINT_UNSUPPORTED_API(configure_endpoints);
} | [
0,
0
] |
Chromium | third_party/libusb/src/libusb/os/windows_usb.c | static int unsupported_claim_interface(int sub_api,
struct libusb_device_handle *dev_handle,
int iface) {
PRINT_UNSUPPORTED_API(claim_interface);
} | [
0,
0
] |
Chromium | third_party/libusb/src/libusb/os/windows_usb.c | static int
unsupported_set_interface_altsetting(int sub_api,
struct libusb_device_handle *dev_handle,
int iface, int altsetting) {
PRINT_UNSUPPORTED_API(set_interface_altsetting);
} | [
0,
0
] |
Chromium | third_party/libusb/src/libusb/os/windows_usb.c | static int unsupported_submit_bulk_transfer(int sub_api,
struct usbi_transfer *itransfer) {
PRINT_UNSUPPORTED_API(submit_bulk_transfer);
} | [
0,
0
] |
Chromium | third_party/libusb/src/libusb/os/windows_usb.c | static int
unsupported_submit_control_transfer(int sub_api,
struct usbi_transfer *itransfer) {
PRINT_UNSUPPORTED_API(submit_control_transfer);
} | [
0,
0
] |
Chromium | third_party/libusb/src/libusb/os/windows_usb.c | static int winusbx_init(int sub_api, struct libusb_context *ctx) {
return LIBUSB_SUCCESS;
} | [
0,
0
] |
Chromium | third_party/libusb/src/libusb/os/windows_usb.c | static int get_valid_interface(struct libusb_device_handle *dev_handle,
int api_id) {
struct windows_device_handle_priv *handle_priv =
_device_handle_priv(dev_handle);
struct windows_device_priv *priv = _device_priv(dev_handle->dev);
int i;
if ((api_id < USB_API_WINUSBX) ||... | [
1,
0
] |
Chromium | third_party/libusb/src/libusb/os/windows_usb.c | static int interface_by_endpoint(struct windows_device_priv *priv,
struct windows_device_handle_priv *handle_priv,
uint8_t endpoint_address) {
int i, j;
for (i = 0; i < USB_MAXINTERFACES; i++) {
if (handle_priv->interface_handle[i].api_handle == ... | [
0,
0
] |
Chromium | third_party/libusb/src/libusb/os/windows_usb.c |
static int winusbx_clear_halt(int sub_api,
struct libusb_device_handle *dev_handle,
unsigned char endpoint) {
struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
struct windows_device_handle_priv *handle_priv =
_device_handle_priv(dev_handle);... | [
0,
0
] |
Chromium | third_party/libusb/src/libusb/os/windows_usb.c |
static int composite_exit(int sub_api) { return LIBUSB_SUCCESS; } | [
0,
0
] |
Chromium | third_party/libusb/src/libusb/os/windows_usb.c |
static int composite_clear_halt(int sub_api,
struct libusb_device_handle *dev_handle,
unsigned char endpoint) {
struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
struct windows_device_handle_priv *handle_priv =
_device_handle_priv(dev_ha... | [
0,
0
] |
Chromium | third_party/libusb/src/libusb/os/windows_usb.c |
static int composite_copy_transfer_data(int sub_api,
struct usbi_transfer *itransfer,
uint32_t io_size) {
struct libusb_transfer *transfer =
USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
struct windows_transfer_priv *transfer_priv... | [
0,
0
] |
Chromium | third_party/libusb/src/libusb/os/windows_usb.h |
static inline struct windows_device_priv *
_device_priv(struct libusb_device *dev) {
return (struct windows_device_priv *)dev->os_priv;
} | [
0,
0
] |
Chromium | third_party/libusb/src/libusb/os/windows_usb.h |
static inline void windows_device_priv_release(libusb_device *dev) {
struct windows_device_priv *p = _device_priv(dev);
int i;
safe_free(p->path);
if ((dev->num_configurations > 0) && (p->config_descriptor != NULL)) {
for (i = 0; i < dev->num_configurations; i++)
safe_free(p->config_descriptor[i]);
... | [
0,
0
] |
Chromium | third_party/libusb/src/libusb/sync.c |
static int do_sync_bulk_transfer(struct libusb_device_handle *dev_handle,
unsigned char endpoint, unsigned char *buffer,
int length, int *transferred,
unsigned int timeout, unsigned char type) {
struct libusb_transfer ... | [
0,
0
] |
Chromium | third_party/libvpx/source/config/linux/arm/vpx_config.c | const char *vpx_codec_build_config(void) { return cfg; } | [
0,
0
] |
Chromium | third_party/libvpx/source/config/linux/mipsel/vpx_config.c | const char *vpx_codec_build_config(void) { return cfg; } | [
0,
0
] |
Chromium | third_party/libvpx/source/config/linux/x64/vpx_config.c | const char *vpx_codec_build_config(void) { return cfg; } | [
0,
0
] |
Chromium | third_party/libvpx/source/config/mac/x64/vpx_config.c | const char *vpx_codec_build_config(void) { return cfg; } | [
0,
0
] |
Chromium | third_party/libwebp/examples/cwebp.c |
static int ReadYUV(const uint8_t *const data, size_t data_size,
WebPPicture *const pic) {
const int use_argb = pic->use_argb;
const int uv_width = (pic->width + 1) / 2;
const int uv_height = (pic->height + 1) / 2;
const int y_plane_size = pic->width * pic->height;
const int uv_plane_size =... | [
0,
0
] |
Chromium | third_party/libwebp/examples/cwebp.c | static int ReadPicture(const char *const filename, WebPPicture *const pic,
int keep_alpha, Metadata *const metadata) {
const uint8_t *data = NULL;
size_t data_size = 0;
int ok = 0;
ok = ImgIoUtilReadFile(filename, &data, &data_size);
if (!ok)
goto End;
if (pic->width == 0 || pic... | [
1,
0
] |
Chromium | third_party/libwebp/examples/cwebp.c |
static void PrintByteCount(const int bytes[4], int total_size,
int *const totals) {
int s;
int total = 0;
for (s = 0; s < 4; ++s) {
fprintf(stderr, "| %7d ", bytes[s]);
total += bytes[s];
if (totals)
totals[s] += bytes[s];
}
fprintf(stderr, "| %7d (%.1f%%)\n", to... | [
1,
0
] |
Chromium | third_party/libwebp/examples/cwebp.c |
static void PrintPercents(const int counts[4]) {
int s;
const int total = counts[0] + counts[1] + counts[2] + counts[3];
for (s = 0; s < 4; ++s) {
fprintf(stderr, "| %3d%%", (int)(100. * counts[s] / total + .5));
}
fprintf(stderr, "| %7d\n", total);
} | [
0,
0
] |
Chromium | third_party/libwebp/examples/cwebp.c | static int DumpPicture(const WebPPicture *const picture, const char *PGM_name) {
int y;
const int uv_width = (picture->width + 1) / 2;
const int uv_height = (picture->height + 1) / 2;
const int stride = (picture->width + 1) & ~1;
const uint8_t *src_y = picture->y;
const uint8_t *src_u = picture->u;
const ... | [
1,
0
] |
Chromium | third_party/libwebp/examples/cwebp.c |
static void PrintMetadataInfo(const Metadata *const metadata,
int metadata_written) {
if (metadata == NULL || metadata_written == 0)
return;
fprintf(stderr, "Metadata:\n");
if (metadata_written & METADATA_ICC) {
fprintf(stderr, " * ICC profile: %6d bytes\n", (int)metadata... | [
0,
0
] |
Chromium | third_party/libwebp/examples/example_util.c |
void ExUtilDeleteCommandLineArguments(CommandLineArguments *const args) {
if (args != NULL) {
if (args->own_argv_) {
WebPFree((void *)args->argv_);
WebPDataClear(&args->argv_data_);
}
ResetCommandLineArguments(0, NULL, args);
}
} | [
0,
0
] |
Chromium | third_party/libwebp/examples/example_util.c | int ExUtilReadFileToWebPData(const char *const filename,
WebPData *const webp_data) {
const uint8_t *data;
size_t size;
if (webp_data == NULL)
return 0;
if (!ImgIoUtilReadFile(filename, &data, &size))
return 0;
webp_data->bytes = data;
webp_data->size = size;
return 1;... | [
0,
0
] |
Chromium | third_party/libwebp/examples/stopwatch.h |
static WEBP_INLINE double StopwatchReadAndReset(Stopwatch *watch) {
const LARGE_INTEGER old_value = *watch;
LARGE_INTEGER freq;
if (!QueryPerformanceCounter(watch))
return 0.0;
if (!QueryPerformanceFrequency(&freq))
return 0.0;
if (freq.QuadPart == 0)
return 0.0;
return (watch->QuadPart - old_v... | [
0,
0
] |
Chromium | third_party/libwebp/examples/stopwatch.h |
static WEBP_INLINE void StopwatchReset(Stopwatch *watch) {
gettimeofday(watch, NULL);
} | [
0,
0
] |
Chromium | third_party/libwebp/imageio/imageio_util.c | FILE *ImgIoUtilSetBinaryMode(FILE *file) {
#if defined(_WIN32)
if (_setmode(_fileno(file), _O_BINARY) == -1) {
fprintf(stderr, "Failed to reopen file in O_BINARY mode.\n");
return NULL;
}
#endif
return file;
} | [
0,
0
] |
Chromium | third_party/libwebp/imageio/imageio_util.c | int ImgIoUtilReadFromStdin(const uint8_t **data, size_t *data_size) {
static const size_t kBlockSize = 16384;
size_t max_size = 0;
size_t size = 0;
uint8_t *input = NULL;
if (data == NULL || data_size == NULL)
return 0;
*data = NULL;
*data_size = 0;
if (!ImgIoUtilSetBinaryMode(stdin))
return 0... | [
1,
0
] |
Chromium | third_party/libwebp/imageio/imageio_util.c | int ImgIoUtilReadFile(const char *const file_name, const uint8_t **data,
size_t *data_size) {
int ok;
uint8_t *file_data;
size_t file_size;
FILE *in;
const int from_stdin = (file_name == NULL) || !WSTRCMP(file_name, "-");
if (from_stdin)
return ImgIoUtilReadFromStdin(data, data_si... | [
1,
0
] |
Chromium | third_party/libwebp/imageio/imageio_util.c | int ImgIoUtilCheckSizeArgumentsOverflow(uint64_t nmemb, size_t size) {
const uint64_t total_size = nmemb * size;
int ok = (total_size == (size_t)total_size);
#if defined(WEBP_MAX_IMAGE_SIZE)
ok = ok && (total_size <= (uint64_t)WEBP_MAX_IMAGE_SIZE);
#endif
return ok;
} | [
0,
0
] |
Chromium | third_party/libwebp/imageio/image_dec.c |
static WEBP_INLINE uint32_t GetBE32(const uint8_t buf[]) {
return ((uint32_t)buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
} | [
1,
0
] |
Chromium | third_party/libwebp/imageio/image_dec.c | WebPInputFileFormat WebPGuessImageType(const uint8_t *const data,
size_t data_size) {
WebPInputFileFormat format = WEBP_UNSUPPORTED_FORMAT;
if (data != NULL && data_size >= 12) {
const uint32_t magic1 = GetBE32(data + 0);
const uint32_t magic2 = GetBE32(data + 8);
... | [
1,
0
] |
Chromium | third_party/libwebp/imageio/image_dec.c |
static int FailReader(const uint8_t *const data, size_t data_size,
struct WebPPicture *const pic, int keep_alpha,
struct Metadata *const metadata) {
(void)data;
(void)data_size;
(void)pic;
(void)keep_alpha;
(void)metadata;
return 0;
} | [
0,
0
] |
Chromium | third_party/libwebp/imageio/image_enc.c | static HRESULT CreateOutputStream(const char *out_file_name, int write_to_mem,
IStream **stream) {
HRESULT hr = S_OK;
if (write_to_mem) {
IFS(CreateStreamOnHGlobal(NULL, TRUE, stream));
} else {
IFS(SHCreateStreamOnFile((const LPTSTR)out_file_name,
... | [
0,
0
] |
Chromium | third_party/libwebp/imageio/image_enc.c |
int WebPWritePPM(FILE *fout, const WebPDecBuffer *const buffer) {
return WritePPMPAM(fout, buffer, 0);
} | [
0,
0
] |
Chromium | third_party/libwebp/imageio/image_enc.c | static void PutLE16(uint8_t *const dst, uint32_t value) {
dst[0] = (value >> 0) & 0xff;
dst[1] = (value >> 8) & 0xff;
} | [
1,
0
] |
Chromium | third_party/libwebp/imageio/jpegdec.c | static int ExtractMetadataFromJPEG(j_decompress_ptr dinfo,
Metadata *const metadata) {
static const struct {
int marker;
const char *signature;
size_t signature_length;
size_t storage_offset;
} kJPEGMetadataMap[] = {
{JPEG_APP1, "Exif\0", 6, METADATA_OFFSET(... | [
0,
1
] |
Chromium | third_party/libwebp/imageio/jpegdec.c |
static void ContextInit(j_decompress_ptr cinfo) {
JPEGReadContext *const ctx = (JPEGReadContext *)cinfo->src;
ctx->pub.next_input_byte = ctx->data;
ctx->pub.bytes_in_buffer = ctx->data_size;
} | [
0,
0
] |
Chromium | third_party/libwebp/imageio/jpegdec.c | static boolean ContextFill(j_decompress_ptr cinfo) {
ERREXIT(cinfo, JERR_FILE_READ);
return FALSE;
} | [
0,
0
] |
Chromium | third_party/libwebp/imageio/jpegdec.c | static void ContextSkip(j_decompress_ptr cinfo, long jump_size) {
JPEGReadContext *const ctx = (JPEGReadContext *)cinfo->src;
size_t jump = (size_t)jump_size;
if (jump > ctx->pub.bytes_in_buffer) {
jump = ctx->pub.bytes_in_buffer;
}
ctx->pub.bytes_in_buffer -= jump;
ctx->pub.next_input_byte += jump;
} | [
0,
0
] |
Chromium | third_party/libwebp/imageio/metadata.c |
void MetadataPayloadDelete(MetadataPayload *const payload) {
if (payload == NULL)
return;
free(payload->bytes);
payload->bytes = NULL;
payload->size = 0;
} | [
1,
0
] |
Chromium | third_party/libwebp/imageio/pngdec.c |
static png_voidp MallocFunc(png_structp png_ptr, LocalPngAllocSize size) {
(void)png_ptr;
if (size != (size_t)size)
return NULL;
if (!ImgIoUtilCheckSizeArgumentsOverflow(size, 1))
return NULL;
return (png_voidp)malloc((size_t)size);
} | [
0,
0
] |
Chromium | third_party/libwebp/imageio/pngdec.c |
static void ReadFunc(png_structp png_ptr, png_bytep data, png_size_t length) {
PNGReadContext *const ctx = (PNGReadContext *)png_get_io_ptr(png_ptr);
if (ctx->data_size - ctx->offset < length) {
png_error(png_ptr, "ReadFunc: invalid read length (overflow)!");
}
memcpy(data, ctx->data + ctx->offset, length)... | [
1,
0
] |
Chromium | third_party/libwebp/imageio/pnmdec.c | static size_t ReadLine(const uint8_t *const data, size_t off, size_t data_size,
char out[MAX_LINE_SIZE + 1], size_t *const out_size) {
size_t i = 0;
*out_size = 0;
redo:
for (i = 0; i < MAX_LINE_SIZE && off < data_size; ++i) {
out[i] = data[off++];
if (out[i] == '\n')
break;
... | [
1,
0
] |
Chromium | third_party/libwebp/imageio/pnmdec.c | static size_t ReadHeader(PNMInfo *const info) {
size_t off = 0;
char out[MAX_LINE_SIZE + 1];
size_t out_size;
if (info == NULL)
return 0;
if (info->data == NULL || info->data_size < kMinPNMHeaderSize)
return 0;
info->width = info->height = 0;
info->type = -1;
info->seen_flags = 0;
info->bytes... | [
1,
0
] |
Chromium | third_party/libwebp/imageio/tiffdec.c | static int ExtractMetadataFromTIFF(TIFF *const tif, Metadata *const metadata) {
int i;
toff_t exif_ifd_offset;
for (i = 0; kTIFFMetadataMap[i].tag != 0; ++i) {
MetadataPayload *const payload =
(MetadataPayload *)((uint8_t *)metadata +
kTIFFMetadataMap[i].storage_offset);
... | [
0,
1
] |
Chromium | third_party/libwebp/imageio/tiffdec.c |
static WEBP_INLINE uint32_t GetScale(uint32_t a) { return (255u << MFIX) / a; }
#undef MFIX
#undef HALF | [
0,
0
] |
Chromium | third_party/libwebp/imageio/webpdec.c |
void PrintWebPError(const char *const in_file, int status) {
WFPRINTF(stderr, "Decoding of %s failed.\n", (const W_CHAR *)in_file);
fprintf(stderr, "Status: %d", status);
if (status >= VP8_STATUS_OK && status <= VP8_STATUS_NOT_ENOUGH_DATA) {
fprintf(stderr, "(%s)", kStatusMessages[status]);
}
fprintf(std... | [
1,
0
] |
Chromium | third_party/libwebp/imageio/wicdec.c |
static HRESULT OpenInputStream(const char *filename, IStream **stream) {
HRESULT hr = S_OK;
if (!WSTRCMP(filename, "-")) {
const uint8_t *data = NULL;
size_t data_size = 0;
const int ok = ImgIoUtilReadFile(filename, &data, &data_size);
if (ok) {
HGLOBAL image = GlobalAlloc(GMEM_MOVEABLE, data... | [
1,
0
] |
Chromium | third_party/libwebp/imageio/wicdec.c | static int HasPalette(GUID pixel_format) {
return (IsEqualGUID(MAKE_REFGUID(pixel_format),
MAKE_REFGUID(GUID_WICPixelFormat1bppIndexed)) ||
IsEqualGUID(MAKE_REFGUID(pixel_format),
MAKE_REFGUID(GUID_WICPixelFormat2bppIndexed)) ||
IsEqualGUID(MAKE_REFGUID(... | [
0,
0
] |
Chromium | third_party/libwebp/src/dec/buffer_dec.c |
VP8StatusCode WebPFlipBuffer(WebPDecBuffer *const buffer) {
if (buffer == NULL) {
return VP8_STATUS_INVALID_PARAM;
}
if (WebPIsRGBMode(buffer->colorspace)) {
WebPRGBABuffer *const buf = &buffer->u.RGBA;
buf->rgba += (buffer->height - 1) * buf->stride;
buf->stride = -buf->stride;
} else {
We... | [
0,
0
] |
Chromium | third_party/libwebp/src/dec/buffer_dec.c | void WebPGrabDecBuffer(WebPDecBuffer *const src, WebPDecBuffer *const dst) {
if (src != NULL && dst != NULL) {
*dst = *src;
if (src->private_memory != NULL) {
src->is_external_memory = 1;
src->private_memory = NULL;
}
}
} | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/buffer_dec.c |
int WebPAvoidSlowMemory(const WebPDecBuffer *const output,
const WebPBitstreamFeatures *const features) {
assert(output != NULL);
return (output->is_external_memory >= 2) &&
WebPIsPremultipliedMode(output->colorspace) &&
(features != NULL && features->has_alpha);
} | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/frame_dec.c | static void DitherRow(VP8Decoder *const dec) {
int mb_x;
assert(dec->dither_);
for (mb_x = dec->tl_mb_x_; mb_x < dec->br_mb_x_; ++mb_x) {
const VP8ThreadContext *const ctx = &dec->thread_ctx_;
const VP8MBData *const data = ctx->mb_data_ + mb_x;
const int cache_id = ctx->id_;
const int uv_bps = dec... | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/frame_dec.c | int VP8ProcessRow(VP8Decoder *const dec, VP8Io *const io) {
int ok = 1;
VP8ThreadContext *const ctx = &dec->thread_ctx_;
const int filter_row = (dec->filter_type_ > 0) &&
(dec->mb_y_ >= dec->tl_mb_y_) &&
(dec->mb_y_ <= dec->br_mb_y_);
if (dec->mt_method_ == 0) {... | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/frame_dec.c | int VP8InitFrame(VP8Decoder *const dec, VP8Io *const io) {
if (!InitThreadContext(dec))
return 0;
if (!AllocateMemory(dec))
return 0;
InitIo(dec, io);
VP8DspInit(); // Init critical function pointers and look-up tables.
return 1;
} | [
0,
0
] |
Chromium | third_party/libwebp/src/dec/idec_dec.c | static void SaveContext(const VP8Decoder *dec, const VP8BitReader *token_br,
MBContext *const context) {
context->left_ = dec->mb_info_[-1];
context->info_ = dec->mb_info_[dec->mb_x_];
context->token_br_ = *token_br;
} | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/idec_dec.c |
static void ChangeState(WebPIDecoder *const idec, DecState new_state,
size_t consumed_bytes) {
MemBuffer *const mem = &idec->mem_;
idec->state_ = new_state;
mem->start_ += consumed_bytes;
assert(mem->start_ <= mem->end_);
idec->io_.data = mem->buf_ + mem->start_;
idec->io_.data_size... | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/idec_dec.c | static VP8StatusCode DecodeVP8LHeader(WebPIDecoder *const idec) {
VP8Io *const io = &idec->io_;
VP8LDecoder *const dec = (VP8LDecoder *)idec->dec_;
const WebPDecParams *const params = &idec->params_;
WebPDecBuffer *const output = params->output;
size_t curr_size = MemDataSize(&idec->mem_);
assert(idec->is_l... | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/idec_dec.c | static VP8StatusCode IDecode(WebPIDecoder *idec) {
VP8StatusCode status = VP8_STATUS_SUSPENDED;
if (idec->state_ == STATE_WEBP_HEADER) {
status = DecodeWebPHeaders(idec);
} else {
if (idec->dec_ == NULL) {
return VP8_STATUS_SUSPENDED;
}
}
if (idec->state_ == STATE_VP8_HEADER) {
status =... | [
0,
0
] |
Chromium | third_party/libwebp/src/dec/idec_dec.c | WebPIDecoder *WebPINewDecoder(WebPDecBuffer *output_buffer) {
return NewDecoder(output_buffer, NULL);
} | [
0,
0
] |
Chromium | third_party/libwebp/src/dec/idec_dec.c | WebPIDecoder *WebPIDecode(const uint8_t *data, size_t data_size,
WebPDecoderConfig *config) {
WebPIDecoder *idec;
WebPBitstreamFeatures tmp_features;
WebPBitstreamFeatures *const features =
(config == NULL) ? &tmp_features : &config->input;
memset(&tmp_features, 0, sizeof(tmp_fea... | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/idec_dec.c | VP8StatusCode WebPIAppend(WebPIDecoder *idec, const uint8_t *data,
size_t data_size) {
VP8StatusCode status;
if (idec == NULL || data == NULL) {
return VP8_STATUS_INVALID_PARAM;
}
status = IDecCheckStatus(idec);
if (status != VP8_STATUS_SUSPENDED) {
return status;
}
if (... | [
0,
0
] |
Chromium | third_party/libwebp/src/dec/idec_dec.c |
int WebPISetIOHooks(WebPIDecoder *const idec, VP8IoPutHook put,
VP8IoSetupHook setup, VP8IoTeardownHook teardown,
void *user_data) {
if (idec == NULL || idec->state_ > STATE_WEBP_HEADER) {
return 0;
}
idec->io_.put = put;
idec->io_.setup = setup;
idec->io_.teardow... | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/io_dec.c | static int EmitAlphaRGBA4444(const VP8Io *const io, WebPDecParams *const p,
int expected_num_lines_out) {
const uint8_t *alpha = io->a;
if (alpha != NULL) {
const int mb_w = io->mb_w;
const WEBP_CSP_MODE colorspace = p->output->colorspace;
const WebPRGBABuffer *const buf = &... | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/io_dec.c | static int Rescale(const uint8_t *src, int src_stride, int new_lines,
WebPRescaler *const wrk) {
int num_lines_out = 0;
while (new_lines > 0) {
const int lines_in = WebPRescalerImport(wrk, new_lines, src, src_stride);
src += lines_in * src_stride;
new_lines -= lines_in;
num_lines_... | [
0,
0
] |
Chromium | third_party/libwebp/src/dec/io_dec.c | static int EmitRescaledRGB(const VP8Io *const io, WebPDecParams *const p) {
const int mb_h = io->mb_h;
const int uv_mb_h = (mb_h + 1) >> 1;
int j = 0, uv_j = 0;
int num_lines_out = 0;
while (j < mb_h) {
const int y_lines_in = WebPRescalerImport(
p->scaler_y, mb_h - j, io->y + (size_t)j * io->y_str... | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/io_dec.c |
static int ExportAlpha(WebPDecParams *const p, int y_pos, int max_lines_out) {
const WebPRGBABuffer *const buf = &p->output->u.RGBA;
uint8_t *const base_rgba = buf->rgba + (size_t)y_pos * buf->stride;
const WEBP_CSP_MODE colorspace = p->output->colorspace;
const int alpha_first = (colorspace == MODE_ARGB || co... | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/io_dec.c | static int ExportAlphaRGBA4444(WebPDecParams *const p, int y_pos,
int max_lines_out) {
const WebPRGBABuffer *const buf = &p->output->u.RGBA;
uint8_t *const base_rgba = buf->rgba + (size_t)y_pos * buf->stride;
#if (WEBP_SWAP_16BIT_CSP == 1)
uint8_t *alpha_dst = base_rgba;
#else
uin... | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/io_dec.c | void WebPInitCustomIo(WebPDecParams *const params, VP8Io *const io) {
io->put = CustomPut;
io->setup = CustomSetup;
io->teardown = CustomTeardown;
io->opaque = params;
} | [
0,
0
] |
Chromium | third_party/libwebp/src/dec/tree_dec.c |
void VP8ParseProba(VP8BitReader *const br, VP8Decoder *const dec) {
VP8Proba *const proba = &dec->proba_;
int t, b, c, p;
for (t = 0; t < NUM_TYPES; ++t) {
for (b = 0; b < NUM_BANDS; ++b) {
for (c = 0; c < NUM_CTX; ++c) {
for (p = 0; p < NUM_PROBAS; ++p) {
const int v =
... | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/vp8l_dec.c |
static int ReadImageInfo(VP8LBitReader *const br, int *const width,
int *const height, int *const has_alpha) {
if (VP8LReadBits(br, 8) != VP8L_MAGIC_BYTE)
return 0;
*width = VP8LReadBits(br, VP8L_IMAGE_SIZE_BITS) + 1;
*height = VP8LReadBits(br, VP8L_IMAGE_SIZE_BITS) + 1;
*has_alpha... | [
0,
0
] |
Chromium | third_party/libwebp/src/dec/vp8l_dec.c | static WEBP_INLINE int GetCopyDistance(int distance_symbol,
VP8LBitReader *const br) {
int extra_bits, offset;
if (distance_symbol < 4) {
return distance_symbol + 1;
}
extra_bits = (distance_symbol - 2) >> 1;
offset = (2 + (distance_symbol & 1)) << extra_bits;
retu... | [
0,
0
] |
Chromium | third_party/libwebp/src/dec/vp8l_dec.c |
static int AccumulateHCode(HuffmanCode hcode, int shift,
HuffmanCode32 *const huff) {
huff->bits += hcode.bits;
huff->value |= (uint32_t)hcode.value << shift;
assert(huff->bits <= HUFFMAN_TABLE_BITS);
return hcode.bits;
} | [
0,
0
] |
Chromium | third_party/libwebp/src/dec/vp8l_dec.c |
static void BuildPackedTable(HTreeGroup *const htree_group) {
uint32_t code;
for (code = 0; code < HUFFMAN_PACKED_TABLE_SIZE; ++code) {
uint32_t bits = code;
HuffmanCode32 *const huff = &htree_group->packed_table[bits];
HuffmanCode hcode = htree_group->htrees[GREEN][bits];
if (hcode.value >= NUM_LI... | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/vp8l_dec.c | static int Export(WebPRescaler *const rescaler, WEBP_CSP_MODE colorspace,
int rgba_stride, uint8_t *const rgba) {
uint32_t *const src = (uint32_t *)rescaler->dst;
const int dst_width = rescaler->dst_width;
int num_lines_out = 0;
while (WebPRescalerHasPendingOutput(rescaler)) {
uint8_t *con... | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/vp8l_dec.c | static void ConvertToYUVA(const uint32_t *const src, int width, int y_pos,
const WebPDecBuffer *const output) {
const WebPYUVABuffer *const buf = &output->u.YUVA;
WebPConvertARGBToY(src, buf->y + y_pos * buf->y_stride, width);
// then U/V planes
{
uint8_t *const u = buf->u + (y_p... | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/vp8l_dec.c |
static int ExportYUVA(const VP8LDecoder *const dec, int y_pos) {
WebPRescaler *const rescaler = dec->rescaler;
uint32_t *const src = (uint32_t *)rescaler->dst;
const int dst_width = rescaler->dst_width;
int num_lines_out = 0;
while (WebPRescalerHasPendingOutput(rescaler)) {
WebPRescalerExportRow(rescaler... | [
0,
0
] |
Chromium | third_party/libwebp/src/dec/vp8l_dec.c |
static int EmitRescaledRowsYUVA(const VP8LDecoder *const dec, uint8_t *in,
int in_stride, int mb_h) {
int num_lines_in = 0;
int y_pos = dec->last_out_row_;
while (num_lines_in < mb_h) {
const int lines_left = mb_h - num_lines_in;
const int needed_lines = WebPRescaleNeededL... | [
0,
0
] |
Chromium | third_party/libwebp/src/dec/vp8l_dec.c | static void ApplyInverseTransforms(VP8LDecoder *const dec, int start_row,
int num_rows, const uint32_t *const rows) {
int n = dec->next_transform_;
const int cache_pixs = dec->width_ * num_rows;
const int end_row = start_row + num_rows;
const uint32_t *rows_in = rows;
uint32... | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/vp8l_dec.c | static WEBP_INLINE uint32_t Rotate8b(uint32_t V) {
#if defined(WORDS_BIGENDIAN)
return ((V & 0xff000000u) >> 24) | (V << 8);
#else
return ((V & 0xffu) << 24) | (V >> 8);
#endif
} | [
0,
0
] |
Chromium | third_party/libwebp/src/dec/vp8l_dec.c | static WEBP_INLINE void CopyBlock8b(uint8_t *const dst, int dist, int length) {
const uint8_t *src = dst - dist;
if (length >= 8) {
uint32_t pattern = 0;
switch (dist) {
case 1:
pattern = src[0];
#if defined(__arm__) || defined(_M_ARM)
pattern |= pattern << 8;
pattern |= pattern << 16;... | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/vp8l_dec.c | static WEBP_INLINE void CopySmallPattern32b(const uint32_t *src, uint32_t *dst,
int length, uint64_t pattern) {
int i;
if ((uintptr_t)dst & 4) {
*dst++ = *src++;
pattern = (pattern >> 32) | (pattern << 32);
--length;
}
assert(0 == ((uintptr_t)dst & 7));
... | [
0,
0
] |
Chromium | third_party/libwebp/src/dec/vp8l_dec.c | static void ClearTransform(VP8LTransform *const transform) {
WebPSafeFree(transform->data_);
transform->data_ = NULL;
} | [
0,
0
] |
Chromium | third_party/libwebp/src/dec/vp8l_dec.c | static int ReadTransform(int *const xsize, int const *ysize,
VP8LDecoder *const dec) {
int ok = 1;
VP8LBitReader *const br = &dec->br_;
VP8LTransform *transform = &dec->transforms_[dec->next_transform_];
const VP8LImageTransformType type =
(VP8LImageTransformType)VP8LReadBits(br, ... | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/vp8l_dec.c |
static void UpdateDecoder(VP8LDecoder *const dec, int width, int height) {
VP8LMetadata *const hdr = &dec->hdr_;
const int num_bits = hdr->huffman_subsample_bits_;
dec->width_ = width;
dec->height_ = height;
hdr->huffman_xsize_ = VP8LSubSampleSize(width, num_bits);
hdr->huffman_mask_ = (num_bits == 0) ? ~... | [
0,
0
] |
Chromium | third_party/libwebp/src/dec/vp8_dec.c | int WebPGetDecoderVersion(void) {
return (DEC_MAJ_VERSION << 16) | (DEC_MIN_VERSION << 8) | DEC_REV_VERSION;
} | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/vp8_dec.c | int VP8InitIoInternal(VP8Io *const io, int version) {
if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_DECODER_ABI_VERSION)) {
return 0;
}
if (io != NULL) {
memset(io, 0, sizeof(*io));
}
return 1;
} | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/vp8_dec.c | int VP8SetError(VP8Decoder *const dec, VP8StatusCode error,
const char *const msg) {
if (dec->status_ == VP8_STATUS_OK) {
dec->status_ = error;
dec->error_msg_ = msg;
dec->ready_ = 0;
}
return 0;
} | [
0,
0
] |
Chromium | third_party/libwebp/src/dec/vp8_dec.c | int VP8GetInfo(const uint8_t *data, size_t data_size, size_t chunk_size,
int *const width, int *const height) {
if (data == NULL || data_size < VP8_FRAME_HEADER_SIZE) {
return 0;
}
// check signature
if (!VP8CheckSignature(data + 3, data_size - 3)) {
return 0; // Wrong signature.
} else... | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/vp8_dec.c |
void VP8InitScanline(VP8Decoder *const dec) {
VP8MB *const left = dec->mb_info_ - 1;
left->nz_ = 0;
left->nz_dc_ = 0;
memset(dec->intra_l_, B_DC_PRED, sizeof(dec->intra_l_));
dec->mb_x_ = 0;
} | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/vp8_dec.c |
void VP8Clear(VP8Decoder *const dec) {
if (dec == NULL) {
return;
}
WebPGetWorkerInterface()->End(&dec->worker_);
WebPDeallocateAlphaMemory(dec);
WebPSafeFree(dec->mem_);
dec->mem_ = NULL;
dec->mem_size_ = 0;
memset(&dec->br_, 0, sizeof(dec->br_));
dec->ready_ = 0;
} | [
1,
0
] |
Chromium | third_party/libwebp/src/dec/webp_dec.c | VP8StatusCode WebPParseHeaders(WebPHeaderStructure *const headers) {
volatile VP8StatusCode status;
int has_animation = 0;
assert(headers != NULL);
// fill out headers, ignore width/height/has_alpha.
status = ParseHeadersInternal(headers->data, headers->data_size, NULL, NULL,
... | [
0,
0
] |
Chromium | third_party/libwebp/src/dec/webp_dec.c | void WebPResetDecParams(WebPDecParams *const params) {
if (params != NULL) {
memset(params, 0, sizeof(*params));
}
} | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.