label int64 0 1 | func1 stringlengths 23 97k | id int64 0 27.3k |
|---|---|---|
1 | static void test_validate_fail_struct(TestInputVisitorData *data, const void *unused) { TestStruct *p = NULL; Error *err = NULL; Visitor *v; v = validate_test_init(data, "{ 'integer': -42, 'boolean': true, 'string': 'foo', 'extra': 42 }"); visit_type_TestStruct(v, &p, NULL, &err); g_assert(err); error_free(err); if (p)... | 17,333 |
1 | static int dv_read_header(AVFormatContext *s, AVFormatParameters *ap) { unsigned state; RawDVContext *c = s->priv_data; c->dv_demux = dv_init_demux(s); if (!c->dv_demux) return -1; state = get_be32(s->pb); while ((state & 0xffffff7f) != 0x1f07003f) { if (url_feof(s->pb)) { av_log(s, AV_LOG_ERROR, "Cannot find DV header... | 17,334 |
1 | int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MJpegDecodeContext *s = avctx->priv_data; const uint8_t *buf_end, *buf_ptr; int start_code; AVFrame *picture = data; s->got_picture = 0; // picture from previous ... | 17,335 |
1 | static int raw_write(BlockDriverState *bs, int64_t sector_num, const uint8_t *buf, int nb_sectors) { if (check_write_unsafe(bs, sector_num, buf, nb_sectors)) { int ret; ret = raw_write_scrubbed_bootsect(bs, buf); if (ret < 0) { return ret; } ret = bdrv_write(bs->file, 1, buf + 512, nb_sectors - 1); if (ret < 0) { retur... | 17,339 |
1 | void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4], const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component) { AVComponentDescriptor comp= desc->comp[c]; int plane= comp.plane; int depth= comp.depth_minus1+1; int mask = (1<<depth)-1; int shift= comp.shift; in... | 17,340 |
1 | void set_system_io_map(MemoryRegion *mr) { memory_region_transaction_begin(); address_space_io.root = mr; memory_region_transaction_commit(); } | 17,342 |
0 | int attribute_align_arg av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFrame *frame, int flags) { BufferSinkContext *buf = ctx->priv; AVFilterLink *inlink = ctx->inputs[0]; int ret; AVFrame *cur_frame; /* no picref available, fetch it from the filterchain */ if (!av_fifo_size(buf->fifo)) { if (inlink->closed) re... | 17,343 |
1 | static float wv_get_value_float(WavpackFrameContext *s, uint32_t *crc, int S) { union { float f; uint32_t u; } value; int sign; int exp = s->float_max_exp; if (s->got_extra_bits) { const int max_bits = 1 + 23 + 8 + 1; const int left_bits = get_bits_left(&s->gb_extra_bits); if (left_bits + 8 * FF_INPUT_BUFFER_PADDING_SI... | 17,344 |
1 | static gboolean ga_channel_open(GAChannel *c, const gchar *path, GAChannelMethod method) { int ret; c->method = method; switch (c->method) { case GA_CHANNEL_VIRTIO_SERIAL: { int fd = qemu_open(path, O_RDWR | O_NONBLOCK #ifndef CONFIG_SOLARIS | O_ASYNC #endif ); if (fd == -1) { g_critical("error opening channel: %s", st... | 17,345 |
1 | static void init_qxl_rom(PCIQXLDevice *d) { QXLRom *rom = memory_region_get_ram_ptr(&d->rom_bar); QXLModes *modes = (QXLModes *)(rom + 1); uint32_t ram_header_size; uint32_t surface0_area_size; uint32_t num_pages; uint32_t fb, maxfb = 0; int i; memset(rom, 0, d->rom_size); rom->magic = cpu_to_le32(QXL_ROM_MAGIC); rom->... | 17,346 |
1 | roundAndPackFloat128( flag zSign, int32 zExp, uint64_t zSig0, uint64_t zSig1, uint64_t zSig2 STATUS_PARAM) { int8 roundingMode; flag roundNearestEven, increment, isTiny; roundingMode = STATUS(float_rounding_mode); roundNearestEven = ( roundingMode == float_round_nearest_even ); increment = ( (int64_t) zSig2 < 0 ); if (... | 17,347 |
1 | static inline void RENAME(yvu9toyv12)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, unsigned int width, unsigned int height, int lumStride, int chromStride) { /* Y Plane */ memcpy(ydst, ysrc, width*height); /* XXX: implement upscaling for U,V */ } | 17,348 |
1 | int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block, int n, int coded, const uint8_t *scan_table) { int level, i, last, run, run_diff; int dc_pred_dir; RLTable *rl; RL_VLC_ELEM *rl_vlc; int qmul, qadd; if (s->mb_intra) { qmul=1; qadd=0; /* DC coef */ level = msmpeg4_decode_dc(s, n, &dc_pred_dir); if (level ... | 17,349 |
1 | static void sub2video_copy_rect(uint8_t *dst, int dst_linesize, int w, int h, AVSubtitleRect *r) { uint32_t *pal, *dst2; uint8_t *src, *src2; int x, y; if (r->type != SUBTITLE_BITMAP) { av_log(NULL, AV_LOG_WARNING, "sub2video: non-bitmap subtitle\n"); return; } if (r->x < 0 || r->x + r->w > w || r->y < 0 || r->y + r->h... | 17,351 |
1 | SchroVideoFormatEnum ff_get_schro_video_format_preset(AVCodecContext *avctx) { unsigned int num_formats = sizeof(ff_schro_video_formats) / sizeof(ff_schro_video_formats[0]); unsigned int idx = get_video_format_idx(avctx); return (idx < num_formats) ? ff_schro_video_formats[idx] : SCHRO_VIDEO_FORMAT_CUSTOM; } | 17,352 |
1 | void qemu_console_copy(QemuConsole *con, int src_x, int src_y, int dst_x, int dst_y, int w, int h) { assert(con->console_type == GRAPHIC_CONSOLE); dpy_gfx_copy(con, src_x, src_y, dst_x, dst_y, w, h); } | 17,354 |
0 | static int aac_adtstoasc_init(AVBSFContext *ctx) { av_freep(&ctx->par_out->extradata); ctx->par_out->extradata_size = 0; return 0; } | 17,356 |
1 | static int dmg_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { BDRVDMGState *s = bs->opaque; uint64_t info_begin, info_end, last_in_offset, last_out_offset; uint32_t count, tmp; uint32_t max_compressed_size = 1, max_sectors_per_chunk = 1, i; int64_t offset; int ret; bs->read_only = 1; s->n_chunks ... | 17,359 |
1 | static int ea_read_header(AVFormatContext *s) { EaDemuxContext *ea = s->priv_data; AVStream *st; if (process_ea_header(s)<=0) return AVERROR(EIO); if (init_video_stream(s, &ea->video) || init_video_stream(s, &ea->alpha)) return AVERROR(ENOMEM); if (ea->audio_codec) { if (ea->num_channels <= 0 || ea->num_channels > 2) {... | 17,360 |
1 | static void armv7m_bitband_init(void) { DeviceState *dev; dev = qdev_create(NULL, "ARM,bitband-memory"); qdev_prop_set_uint32(dev, "base", 0x20000000); qdev_init(dev); sysbus_mmio_map(sysbus_from_qdev(dev), 0, 0x22000000); dev = qdev_create(NULL, "ARM,bitband-memory"); qdev_prop_set_uint32(dev, "base", 0x40000000); qde... | 17,361 |
1 | static void mpegts_write_section(MpegTSSection *s, uint8_t *buf, int len) { unsigned int crc; unsigned char packet[TS_PACKET_SIZE]; const unsigned char *buf_ptr; unsigned char *q; int first, b, len1, left; crc = av_bswap32(av_crc(av_crc_get_table(AV_CRC_32_IEEE), -1, buf, len - 4)); buf[len - 4] = (crc >> 24) & 0xff; b... | 17,363 |
1 | void address_space_init(AddressSpace *as, MemoryRegion *root, const char *name) { memory_region_transaction_begin(); as->root = root; as->current_map = g_new(FlatView, 1); flatview_init(as->current_map); as->ioeventfd_nb = 0; as->ioeventfds = NULL; QTAILQ_INSERT_TAIL(&address_spaces, as, address_spaces_link); as->name ... | 17,364 |
1 | static gboolean fd_trampoline(GIOChannel *chan, GIOCondition cond, gpointer opaque) { IOTrampoline *tramp = opaque; if (tramp->opaque == NULL) { return FALSE; } if ((cond & G_IO_IN) && tramp->fd_read) { tramp->fd_read(tramp->opaque); } if ((cond & G_IO_OUT) && tramp->fd_write) { tramp->fd_write(tramp->opaque); } return... | 17,365 |
1 | static void test_flush_event_notifier(void) { EventNotifierTestData data = { .n = 0, .active = 10, .auto_set = true }; event_notifier_init(&data.e, false); aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb); g_assert(aio_poll(ctx, false)); g_assert_cmpint(data.n, ==, 0); g_assert_cmpint(data.active, ... | 17,366 |
1 | static int protocol_client_auth_sasl_mechname(VncState *vs, uint8_t *data, size_t len) { char *mechname = malloc(len + 1); if (!mechname) { VNC_DEBUG("Out of memory reading mechname\n"); vnc_client_error(vs); } strncpy(mechname, (char*)data, len); mechname[len] = '\0'; VNC_DEBUG("Got client mechname '%s' check against ... | 17,368 |
1 | static void qxl_send_events(PCIQXLDevice *d, uint32_t events) { uint32_t old_pending; uint32_t le_events = cpu_to_le32(events); trace_qxl_send_events(d->id, events); assert(qemu_spice_display_is_running(&d->ssd)); old_pending = __sync_fetch_and_or(&d->ram->int_pending, le_events); if ((old_pending & le_events) == le_ev... | 17,369 |
1 | static void decode_blocks(SnowContext *s){ int x, y; int w= s->b_width; int h= s->b_height; for(y=0; y<h; y++){ for(x=0; x<w; x++){ decode_q_branch(s, 0, x, y); } } } | 17,371 |
1 | static int img_read_header(AVFormatContext *s1, AVFormatParameters *ap) { VideoData *s = s1->priv_data; int ret, first_index, last_index; char buf[1024]; ByteIOContext pb1, *f = &pb1; AVStream *st; st = av_new_stream(s1, 0); if (!st) { av_free(s); return -ENOMEM; } if (ap->image_format) s->img_fmt = ap->image_format; p... | 17,372 |
1 | static void mpeg4_encode_gop_header(MpegEncContext *s) { int hours, minutes, seconds; int64_t time; put_bits(&s->pb, 16, 0); put_bits(&s->pb, 16, GOP_STARTCODE); time = s->current_picture_ptr->f.pts; if (s->reordered_input_picture[1]) time = FFMIN(time, s->reordered_input_picture[1]->f.pts); time = time * s->avctx->tim... | 17,373 |
0 | static int av_encode(AVFormatContext **output_files, int nb_output_files, AVFormatContext **input_files, int nb_input_files, AVStreamMap *stream_maps, int nb_stream_maps) { int ret, i, j, k, n, nb_istreams = 0, nb_ostreams = 0; AVFormatContext *is, *os; AVCodecContext *codec, *icodec; AVOutputStream *ost, **ost_table =... | 17,374 |
1 | static void vm_change_state_handler(void *opaque, int running, RunState state) { GICv3ITSState *s = (GICv3ITSState *)opaque; Error *err = NULL; int ret; if (running) { return; } ret = kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CTRL, KVM_DEV_ARM_ITS_SAVE_TABLES, NULL, true, &err); if (err) { error_report_err(err)... | 17,377 |
1 | static uint8_t usb_linux_get_alt_setting(USBHostDevice *s, uint8_t configuration, uint8_t interface) { char device_name[64], line[1024]; int alt_setting; sprintf(device_name, "%d-%s:%d.%d", s->bus_num, s->port, (int)configuration, (int)interface); if (!usb_host_read_file(line, sizeof(line), "bAlternateSetting", device_... | 17,379 |
1 | static int append_extradata(APNGDemuxContext *ctx, AVIOContext *pb, int len) { int previous_size = ctx->extra_data_size; int new_size, ret; uint8_t *new_extradata; if (previous_size > INT_MAX - len) return AVERROR_INVALIDDATA; new_size = previous_size + len; new_extradata = av_realloc(ctx->extra_data, new_size + AV_INP... | 17,380 |
1 | void dnxhd_get_blocks(DNXHDEncContext *ctx, int mb_x, int mb_y) { const int bs = ctx->block_width_l2; const int bw = 1 << bs; int dct_y_offset = ctx->dct_y_offset; int dct_uv_offset = ctx->dct_uv_offset; int linesize = ctx->m.linesize; int uvlinesize = ctx->m.uvlinesize; const uint8_t *ptr_y = ctx->thread[0]->src[0] + ... | 17,382 |
1 | bool virtio_scsi_handle_event_vq(VirtIOSCSI *s, VirtQueue *vq) { virtio_scsi_acquire(s); if (s->events_dropped) { virtio_scsi_push_event(s, NULL, VIRTIO_SCSI_T_NO_EVENT, 0); virtio_scsi_release(s); return true; } virtio_scsi_release(s); return false; } | 17,383 |
1 | static attribute_align_arg void *frame_worker_thread(void *arg) { PerThreadContext *p = arg; FrameThreadContext *fctx = p->parent; AVCodecContext *avctx = p->avctx; AVCodec *codec = avctx->codec; while (1) { int i; if (p->state == STATE_INPUT_READY && !fctx->die) { pthread_mutex_lock(&p->mutex); while (p->state == STAT... | 17,384 |
1 | static void gen_spr_970_pmu_sup(CPUPPCState *env) { spr_register(env, SPR_970_PMC7, "PMC7", SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, &spr_write_generic, 0x00000000); spr_register(env, SPR_970_PMC8, "PMC8", SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, &spr_write_generic, 0x00000000); } | 17,385 |
1 | static av_cold int hevc_sdp_parse_fmtp_config(AVFormatContext *s, AVStream *stream, PayloadContext *hevc_data, char *attr, char *value) { /* profile-space: 0-3 */ /* profile-id: 0-31 */ if (!strcmp(attr, "profile-id")) { hevc_data->profile_id = atoi(value); av_dlog(s, "SDP: found profile-id: %d\n", hevc_data->profile_i... | 17,387 |
1 | static int svq3_decode_frame (AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size) { MpegEncContext *const s = avctx->priv_data; H264Context *const h = avctx->priv_data; int m, mb_type; unsigned char *extradata; unsigned int size; s->flags = avctx->flags; s->flags2 = avctx->flags2; s->unrestri... | 17,389 |
1 | static int qemu_rdma_reg_whole_ram_blocks(RDMAContext *rdma) { int i; RDMALocalBlocks *local = &rdma->local_ram_blocks; for (i = 0; i < local->nb_blocks; i++) { local->block[i].mr = ibv_reg_mr(rdma->pd, local->block[i].local_host_addr, local->block[i].length, IBV_ACCESS_LOCAL_WRITE | IBV_ACCESS_REMOTE_WRITE ); if (!loc... | 17,390 |
1 | static int encode_plane(AVCodecContext *avctx, uint8_t *src, uint8_t *dst, int step, int stride, int width, int height, PutByteContext *pb) { UtvideoContext *c = avctx->priv_data; uint8_t lengths[256]; uint32_t counts[256] = { 0 }; HuffEntry he[256]; uint32_t offset = 0, slice_len = 0; int i, sstart, send = 0; int symb... | 17,391 |
1 | static void init_excp_4xx_real (CPUPPCState *env) { #if !defined(CONFIG_USER_ONLY) env->excp_vectors[POWERPC_EXCP_CRITICAL] = 0x00000100; env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200; env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500; env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600; env->excp_vectors[POWE... | 17,392 |
1 | static void libschroedinger_decode_buffer_free(SchroBuffer *schro_buf, void *priv) { av_freep(&priv); } | 17,393 |
1 | void aio_set_dispatching(AioContext *ctx, bool dispatching) { ctx->dispatching = dispatching; if (!dispatching) { /* Write ctx->dispatching before reading e.g. bh->scheduled. * Optimization: this is only needed when we're entering the "unsafe" * phase where other threads must call event_notifier_set. */ smp_mb(); } } | 17,394 |
1 | static int adx_encode_header(AVCodecContext *avctx,unsigned char *buf,size_t bufsize) { #if 0 struct { uint32_t offset; /* 0x80000000 + sample start - 4 */ unsigned char unknown1[3]; /* 03 12 04 */ unsigned char channel; /* 1 or 2 */ uint32_t freq; uint32_t size; uint32_t unknown2; /* 01 f4 03 00 */ uint32_t unknown3; ... | 17,395 |
1 | static vscsi_req *vscsi_find_req(VSCSIState *s, uint32_t tag) { if (tag >= VSCSI_REQ_LIMIT || !s->reqs[tag].active) { return NULL; } return &s->reqs[tag]; } | 17,396 |
1 | static inline void RENAME(rgb24tobgr15)(const uint8_t *src, uint8_t *dst, unsigned src_size) { const uint8_t *s = src; const uint8_t *end; #ifdef HAVE_MMX const uint8_t *mm_end; #endif uint16_t *d = (uint16_t *)dst; end = s + src_size; #ifdef HAVE_MMX __asm __volatile(PREFETCH" %0"::"m"(*src):"memory"); __asm __volatil... | 17,397 |
1 | static void read_tree(GetBitContext *gb, Tree *tree) { uint8_t tmp1[16], tmp2[16], *in = tmp1, *out = tmp2; int i, t, len; tree->vlc_num = get_bits(gb, 4); if (!tree->vlc_num) { for (i = 0; i < 16; i++) tree->syms[i] = i; return; } if (get_bits1(gb)) { len = get_bits(gb, 3); memset(tmp1, 0, sizeof(tmp1)); for (i = 0; i... | 17,399 |
1 | uint32_t ide_data_readl(void *opaque, uint32_t addr) { IDEBus *bus = opaque; IDEState *s = idebus_active_if(bus); uint8_t *p; int ret; /* PIO data access allowed only when DRQ bit is set. The result of a read * during PIO in is indeterminate, return 0 and don't move forward. */ if (!(s->status & DRQ_STAT) || !ide_is_pi... | 17,400 |
1 | void do_commit(Monitor *mon, const QDict *qdict) { const char *device = qdict_get_str(qdict, "device"); BlockDriverState *bs; if (!strcmp(device, "all")) { bdrv_commit_all(); } else { int ret; bs = bdrv_find(device); if (!bs) { qerror_report(QERR_DEVICE_NOT_FOUND, device); return; } ret = bdrv_commit(bs); if (ret == -E... | 17,401 |
1 | void avfilter_start_frame(AVFilterLink *link, AVFilterPicRef *picref) { void (*start_frame)(AVFilterLink *, AVFilterPicRef *); AVFilterPad *dst = &link_dpad(link); if(!(start_frame = dst->start_frame)) start_frame = avfilter_default_start_frame; /* prepare to copy the picture if it has insufficient permissions */ if((d... | 17,403 |
1 | static void ffserver_apply_stream_config(AVCodecContext *enc, const AVDictionary *conf, AVDictionary **opts) { AVDictionaryEntry *e; /* Return values from ffserver_set_*_param are ignored. Values are initially parsed and checked before inserting to AVDictionary. */ //video params if ((e = av_dict_get(conf, "VideoBitRat... | 17,404 |
1 | static uint32_t grlib_gptimer_readl(void *opaque, target_phys_addr_t addr) { GPTimerUnit *unit = opaque; target_phys_addr_t timer_addr; int id; uint32_t value = 0; addr &= 0xff; /* Unit registers */ switch (addr) { case SCALER_OFFSET: trace_grlib_gptimer_readl(-1, "scaler:", unit->scaler); return unit->scaler; case SCA... | 17,405 |
1 | static void new_subtitle_stream(AVFormatContext *oc, int file_idx) { AVStream *st; AVOutputStream *ost; AVCodec *codec=NULL; AVCodecContext *subtitle_enc; enum CodecID codec_id; st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0); if (!st) { fprintf(stderr, "Could not alloc strea... | 17,406 |
1 | static inline void RENAME(bgr24ToUV_mmx)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, int width, enum PixelFormat srcFormat) { __asm__ volatile( "movq 24+%4, %%mm6 \n\t" "mov %3, %%"REG_a" \n\t" "pxor %%mm7, %%mm7 \n\t" "1: \n\t" PREFETCH" 64(%0) \n\t" "movd (%0), %%mm0 \n\t" "movd 2(%0), %%mm1 \n\t" "punpcklbw %%... | 17,408 |
1 | static ram_addr_t find_ram_offset(ram_addr_t size) { RAMBlock *block, *next_block; ram_addr_t offset, mingap = ULONG_MAX; if (QLIST_EMPTY(&ram_list.blocks)) return 0; QLIST_FOREACH(block, &ram_list.blocks, next) { ram_addr_t end, next = ULONG_MAX; end = block->offset + block->length; QLIST_FOREACH(next_block, &ram_list... | 17,409 |
1 | static void guess_dc(MpegEncContext *s, int16_t *dc, int w, int h, int stride, int is_luma) { int b_x, b_y; int16_t (*col )[4] = av_malloc(stride*h*sizeof( int16_t)*4); uint32_t (*dist)[4] = av_malloc(stride*h*sizeof(uint32_t)*4); for(b_y=0; b_y<h; b_y++){ int color= 1024; int distance= -1; for(b_x=0; b_x<w; b_x++){ in... | 17,410 |
1 | Coroutine *qemu_coroutine_create(CoroutineEntry *entry) { Coroutine *co = NULL; if (CONFIG_COROUTINE_POOL) { co = QSLIST_FIRST(&alloc_pool); if (!co) { if (release_pool_size > POOL_BATCH_SIZE) { /* Slow path; a good place to register the destructor, too. */ if (!coroutine_pool_cleanup_notifier.notify) { coroutine_pool_... | 17,414 |
1 | static void pxa2xx_gpio_write(void *opaque, target_phys_addr_t offset, uint32_t value) { struct pxa2xx_gpio_info_s *s = (struct pxa2xx_gpio_info_s *) opaque; int bank; offset -= s->base; if (offset >= 0x200) return; bank = pxa2xx_gpio_regs[offset].bank; switch (pxa2xx_gpio_regs[offset].reg) { case GPDR: /* GPIO Pin-Dir... | 17,415 |
1 | static int decode_syncpoint(NUTContext *nut, int64_t *ts, int64_t *back_ptr) { AVFormatContext *s = nut->avf; AVIOContext *bc = s->pb; int64_t end; uint64_t tmp; nut->last_syncpoint_pos = avio_tell(bc) - 8; end = get_packetheader(nut, bc, 1, SYNCPOINT_STARTCODE); end += avio_tell(bc); tmp = ffio_read_varlen(bc); *back_... | 17,416 |
1 | static void coroutine_fn v9fs_flush(void *opaque) { ssize_t err; int16_t tag; size_t offset = 7; V9fsPDU *cancel_pdu; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; err = pdu_unmarshal(pdu, offset, "w", &tag); if (err < 0) { pdu_complete(pdu, err); return; } trace_v9fs_flush(pdu->tag, pdu->id, tag); QLIST_FOREACH(cancel... | 17,417 |
1 | static inline void expand_category(COOKContext *q, int *category, int *category_index) { int i; for (i = 0; i < q->num_vectors; i++) ++category[category_index[i]]; } | 17,418 |
0 | static int gif_encode_close(AVCodecContext *avctx) { GIFContext *s = avctx->priv_data; av_frame_free(&avctx->coded_frame); av_freep(&s->lzw); av_freep(&s->buf); return 0; } | 17,419 |
0 | static av_cold int vqa_decode_end(AVCodecContext *avctx) { VqaContext *s = avctx->priv_data; av_free(s->codebook); av_free(s->next_codebook_buffer); av_free(s->decode_buffer); if (s->frame.data[0]) avctx->release_buffer(avctx, &s->frame); return 0; } | 17,420 |
0 | static av_cold int pam_encode_init(AVCodecContext *avctx) { avctx->coded_frame = av_frame_alloc(); if (!avctx->coded_frame) return AVERROR(ENOMEM); avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I; avctx->coded_frame->key_frame = 1; return 0; } | 17,421 |
1 | static int write_l2_entries(BlockDriverState *bs, uint64_t *l2_table, uint64_t l2_offset, int l2_index, int num) { int l2_start_index = l2_index & ~(L1_ENTRIES_PER_SECTOR - 1); int start_offset = (8 * l2_index) & ~511; int end_offset = (8 * (l2_index + num) + 511) & ~511; size_t len = end_offset - start_offset; int ret... | 17,422 |
1 | static void FUNC(put_hevc_qpel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, int denom, int wx0, int wx1, int ox0, int ox1, intptr_t mx, intptr_t my, int width) { int x, y; pixel *src = (pixel*)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *... | 17,423 |
1 | void virtqueue_flush(VirtQueue *vq, unsigned int count) { uint16_t old, new; /* Make sure buffer is written before we update index. */ smp_wmb(); trace_virtqueue_flush(vq, count); old = vq->used_idx; new = old + count; vring_used_idx_set(vq, new); if (unlikely((int16_t)(new - vq->signalled_used) < (uint16_t)(new - old)... | 17,424 |
1 | static void xbr4x(AVFrame *input, AVFrame *output, const uint32_t *r2y) { const int nl = output->linesize[0]>>2; const int nl1 = nl + nl; const int nl2 = nl1 + nl; uint32_t pprev; uint32_t pprev2; int x, y; for (y = 0; y < input->height; y++) { uint32_t * E = (uint32_t *)(output->data[0] + y * output->linesize[0] * 4);... | 17,425 |
1 | const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src, int *dst_length, int *consumed, int length){ int i, si, di; uint8_t *dst; int bufidx; // src[0]&0x80; //forbidden bit h->nal_ref_idc= src[0]>>5; h->nal_unit_type= src[0]&0x1F; src++; length--; #if HAVE_FAST_UNALIGNED # if HAVE_FAST_64BIT # define RS ... | 17,426 |
1 | static void dct_unquantize_mpeg2_mmx(MpegEncContext *s, DCTELEM *block, int n, int qscale) { int nCoeffs; const UINT16 *quant_matrix; if(s->alternate_scan) nCoeffs= 64; else nCoeffs= nCoeffs= zigzag_end[ s->block_last_index[n] ]; if (s->mb_intra) { int block0; if (n < 4) block0 = block[0] * s->y_dc_scale; else block0 =... | 17,427 |
1 | static int mov_write_avid_tag(AVIOContext *pb, MOVTrack *track) { int i; avio_wb32(pb, 24); /* size */ ffio_wfourcc(pb, "ACLR"); ffio_wfourcc(pb, "ACLR"); ffio_wfourcc(pb, "0001"); if (track->enc->color_range == AVCOL_RANGE_MPEG || /* Legal range (16-235) */ track->enc->color_range == AVCOL_RANGE_UNSPECIFIED) { avio_wb... | 17,429 |
1 | static qemu_irq *icp_pic_init(uint32_t base, qemu_irq parent_irq, qemu_irq parent_fiq) { icp_pic_state *s; int iomemtype; qemu_irq *qi; s = (icp_pic_state *)qemu_mallocz(sizeof(icp_pic_state)); if (!s) return NULL; qi = qemu_allocate_irqs(icp_pic_set_irq, s, 32); s->base = base; s->parent_irq = parent_irq; s->parent_fi... | 17,430 |
0 | static int handle_p_frame_apng(AVCodecContext *avctx, PNGDecContext *s, AVFrame *p) { int i, j; uint8_t *pd = p->data[0]; uint8_t *pd_last = s->last_picture.f->data[0]; uint8_t *pd_last_region = s->dispose_op == APNG_DISPOSE_OP_PREVIOUS ? s->previous_picture.f->data[0] : s->last_picture.f->data[0]; int ls = FFMIN(av_im... | 17,431 |
0 | static int nprobe(AVFormatContext *s, uint8_t *enc_header, int size, const uint8_t *n_val) { OMAContext *oc = s->priv_data; uint32_t pos, taglen, datalen; struct AVDES av_des; if (!enc_header || !n_val) return -1; pos = OMA_ENC_HEADER_SIZE + oc->k_size; if (!memcmp(&enc_header[pos], "EKB ", 4)) pos += 32; if (AV_RB32(&... | 17,432 |
0 | REORDER_OUT_50(int8, int8_t) REORDER_OUT_51(int8, int8_t) REORDER_OUT_71(int8, int8_t) REORDER_OUT_50(int16, int16_t) REORDER_OUT_51(int16, int16_t) REORDER_OUT_71(int16, int16_t) REORDER_OUT_50(int32, int32_t) REORDER_OUT_51(int32, int32_t) REORDER_OUT_71(int32, int32_t) REORDER_OUT_50(f32, float) REORDER_OUT_51(f32, ... | 17,433 |
1 | static inline void RENAME(rgb24ToY)(uint8_t *dst, uint8_t *src, int width) { int i; for(i=0; i<width; i++) { int r= src[i*3+0]; int g= src[i*3+1]; int b= src[i*3+2]; dst[i]= ((RY*r + GY*g + BY*b + (33<<(RGB2YUV_SHIFT-1)) )>>RGB2YUV_SHIFT); } } | 17,434 |
1 | static void dcr_write_pob (void *opaque, int dcrn, uint32_t val) { ppc4xx_pob_t *pob; pob = opaque; switch (dcrn) { case POB0_BEAR: /* Read only */ break; case POB0_BESR0: case POB0_BESR1: /* Write-clear */ pob->besr[dcrn - POB0_BESR0] &= ~val; break; } } | 17,435 |
1 | static inline void yuv2yuvXinC(int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize, int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, uint8_t *dest, uint8_t *uDest, uint8_t *vDest, int dstW, int chrDstW) { //FIXME Optimize (just quickly writen not opti..) int i; for(i=0; i<dstW; i++) { int val=1<<18; int j; ... | 17,436 |
0 | static int mjpeg_decode_com(MJpegDecodeContext *s) { int i; UINT8 *cbuf; /* XXX: verify len field validity */ unsigned int len = get_bits(&s->gb, 16)-2; cbuf = av_malloc(len+1); for (i = 0; i < len; i++) cbuf[i] = get_bits(&s->gb, 8); if (cbuf[i-1] == '\n') cbuf[i-1] = 0; else cbuf[i] = 0; printf("mjpeg comment: '%s'\n... | 17,437 |
0 | static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, int srcFormat, int dstFormat, int srcW, int srcH, int dstW, int dstH, int flags){ uint8_t *src[4] = {0}; uint8_t *dst[4] = {0}; uint8_t *out[4] = {0}; int srcStride[4], dstStride[4]; int i; uint64_t ssdY, ssdU, ssdV, ssdA=0; struct SwsContext *srcContex... | 17,438 |
1 | static ram_addr_t get_start_block(DumpState *s) { RAMBlock *block; if (!s->has_filter) { s->block = QTAILQ_FIRST(&ram_list.blocks); return 0; } QTAILQ_FOREACH(block, &ram_list.blocks, next) { if (block->offset >= s->begin + s->length || block->offset + block->length <= s->begin) { /* This block is out of the range */ c... | 17,440 |
1 | static int get_cluster_table(BlockDriverState *bs, uint64_t offset, uint64_t **new_l2_table, int *new_l2_index) { BDRVQcowState *s = bs->opaque; unsigned int l1_index, l2_index; uint64_t l2_offset; uint64_t *l2_table = NULL; int ret; /* seek the the l2 offset in the l1 table */ l1_index = offset >> (s->l2_bits + s->clu... | 17,441 |
1 | static void gem_write(void *opaque, hwaddr offset, uint64_t val, unsigned size) { CadenceGEMState *s = (CadenceGEMState *)opaque; uint32_t readonly; int i; DB_PRINT("offset: 0x%04x write: 0x%08x ", (unsigned)offset, (unsigned)val); offset >>= 2; /* Squash bits which are read only in write value */ val &= ~(s->regs_ro[o... | 17,442 |
1 | static int16_t g726_decode(G726Context* c, int I) { int dq, re_signal, pk0, fa1, i, tr, ylint, ylfrac, thr2, al, dq0; Float11 f; int I_sig= I >> (c->code_size - 1); dq = inverse_quant(c, I); /* Transition detect */ ylint = (c->yl >> 15); ylfrac = (c->yl >> 10) & 0x1f; thr2 = (ylint > 9) ? 0x1f << 10 : (0x20 + ylfrac) <... | 17,443 |
1 | void pl050_init(uint32_t base, qemu_irq irq, int is_mouse) { int iomemtype; pl050_state *s; s = (pl050_state *)qemu_mallocz(sizeof(pl050_state)); iomemtype = cpu_register_io_memory(0, pl050_readfn, pl050_writefn, s); cpu_register_physical_memory(base, 0x00000fff, iomemtype); s->base = base; s->irq = irq; s->is_mouse = ... | 17,444 |
1 | static int matroska_parse_cluster(MatroskaDemuxContext *matroska) { MatroskaCluster cluster = { 0 }; EbmlList *blocks_list; MatroskaBlock *blocks; int i, res; int64_t pos = url_ftell(matroska->ctx->pb); matroska->prev_pkt = NULL; if (matroska->has_cluster_id){ /* For the first cluster we parse, its ID was already read ... | 17,445 |
1 | static av_cold void init_mdct_win(TwinContext *tctx) { int i,j; const ModeTab *mtab = tctx->mtab; int size_s = mtab->size / mtab->fmode[FT_SHORT].sub; int size_m = mtab->size / mtab->fmode[FT_MEDIUM].sub; int channels = tctx->avctx->channels; float norm = channels == 1 ? 2. : 1.; for (i = 0; i < 3; i++) { int bsize = t... | 17,446 |
1 | static MemTxResult memory_region_oldmmio_write_accessor(MemoryRegion *mr, hwaddr addr, uint64_t *value, unsigned size, unsigned shift, uint64_t mask, MemTxAttrs attrs) { uint64_t tmp; tmp = (*value >> shift) & mask; if (mr->subpage) { trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, size); } else if (T... | 17,450 |
0 | static av_cold int aacPlus_encode_init(AVCodecContext *avctx) { aacPlusAudioContext *s = avctx->priv_data; aacplusEncConfiguration *aacplus_cfg; /* number of channels */ if (avctx->channels < 1 || avctx->channels > 2) { av_log(avctx, AV_LOG_ERROR, "encoding %d channel(s) is not allowed\n", avctx->channels); return -1; ... | 17,451 |
0 | static uint64_t get_v(ByteIOContext *bc) { uint64_t val = 0; for(; bytes_left(bc) > 0; ) { int tmp = get_byte(bc); if (tmp&0x80) val= (val<<7) + tmp - 0x80; else return (val<<7) + tmp; } return -1; } | 17,453 |
1 | static av_cold int libgsm_close(AVCodecContext *avctx) { gsm_destroy(avctx->priv_data); avctx->priv_data = NULL; return 0; } | 17,455 |
1 | static int mov_open_dref(ByteIOContext **pb, char *src, MOVDref *ref) { /* try absolute path */ if (!url_fopen(pb, ref->path, URL_RDONLY)) return 0; /* try relative path */ if (ref->nlvl_to > 0 && ref->nlvl_from > 0) { char filename[1024]; char *src_path; int i, l; /* find a source dir */ src_path = strrchr(src, '/'); ... | 17,456 |
1 | FWCfgState *fw_cfg_init(uint32_t ctl_port, uint32_t data_port, hwaddr ctl_addr, hwaddr data_addr) { DeviceState *dev; SysBusDevice *d; FWCfgState *s; dev = qdev_create(NULL, TYPE_FW_CFG); qdev_prop_set_uint32(dev, "ctl_iobase", ctl_port); qdev_prop_set_uint32(dev, "data_iobase", data_port); d = SYS_BUS_DEVICE(dev); s =... | 17,459 |
1 | void qmp_block_passwd(bool has_device, const char *device, bool has_node_name, const char *node_name, const char *password, Error **errp) { Error *local_err = NULL; BlockDriverState *bs; int err; bs = bdrv_lookup_bs(has_device ? device : NULL, has_node_name ? node_name : NULL, &local_err); if (local_err) { error_propag... | 17,460 |
1 | int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags) { int ret; switch (avctx->codec_type) { case AVMEDIA_TYPE_VIDEO: if (!frame->width) frame->width = avctx->width; if (!frame->height) frame->height = avctx->height; if (frame->format < 0) frame->format = avctx->pix_fmt; if (!frame->sample_aspect_ratio.n... | 17,461 |
1 | m_get(Slirp *slirp) { register struct mbuf *m; int flags = 0; DEBUG_CALL("m_get"); if (slirp->m_freelist.m_next == &slirp->m_freelist) { m = (struct mbuf *)malloc(SLIRP_MSIZE); if (m == NULL) goto end_error; slirp->mbuf_alloced++; if (slirp->mbuf_alloced > MBUF_THRESH) flags = M_DOFREE; m->slirp = slirp; } else { m = s... | 17,462 |
1 | uint_fast16_t float64_to_uint16_round_to_zero(float64 a STATUS_PARAM) { int64_t v; uint_fast16_t res; v = float64_to_int64_round_to_zero(a STATUS_VAR); if (v < 0) { res = 0; float_raise( float_flag_invalid STATUS_VAR); } else if (v > 0xffff) { res = 0xffff; float_raise( float_flag_invalid STATUS_VAR); } else { res = v;... | 17,464 |
1 | static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) { uint_fast16_t cb; uint8_t *tmp_vlc_bits; uint32_t *tmp_vlc_codes; GetBitContext *gb=&vc->gb; vc->codebook_count=get_bits(gb,8)+1; AV_DEBUG(" Codebooks: %d \n", vc->codebook_count); vc->codebooks=(vorbis_codebook *)av_mallocz(vc->codebook_count * sizeof(v... | 17,465 |
1 | static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg) { Picture *pic = NULL; int64_t pts; int i, display_picture_number = 0, ret; int encoding_delay = s->max_b_frames ? s->max_b_frames : (s->low_delay ? 0 : 1); int flush_offset = 1; int direct = 1; if (pic_arg) { pts = pic_arg->pts; display_picture_n... | 17,466 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.