Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
FFmpeg
libavformat/riffdec.c
static void parse_waveformatex(AVIOContext *pb, AVCodecParameters *par) { ff_asf_guid subformat; par->bits_per_coded_sample = avio_rl16(pb); par->channel_layout = avio_rl32(pb); /* dwChannelMask */ ff_get_guid(pb, &subformat); if (!memcmp(subformat + 4, (const uint8_t[]){FF_MEDIASUBTYPE_B...
[ 1, 0 ]
FFmpeg
libavcodec/jpeg2000dsp.c
static void ict_int(void *_src0, void *_src1, void *_src2, int csize) { int32_t *src0 = _src0, *src1 = _src1, *src2 = _src2; int32_t i0, i1, i2; int i; for (i = 0; i < csize; i++) { i0 = *src0 + (((i_ict_params[0] * *src2) + (1 << 15)) >> 16); i1 = *src0 - (((i_ict_params[1] * *src1) + (1 << 15))...
[ 1, 0 ]
qemu
hw/nvram/spapr_nvram.c
static void spapr_nvram_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); VIOsPAPRDeviceClass *k = VIO_SPAPR_DEVICE_CLASS(klass); k->realize = spapr_nvram_realize; k->devnode = spapr_nvram_devnode; k->dt_name = "nvram"; k->dt_type = "nvram"; k->dt_compatible = "qe...
[ 1, 0 ]
qemu
include/sysemu/seccomp.h
static int parse_sandbox(void *opaque, QemuOpts *opts, Error **errp) { if (qemu_opt_get_bool(opts, "enable", false)) { #ifdef CONFIG_SECCOMP uint32_t seccomp_opts = QEMU_SECCOMP_SET_DEFAULT | QEMU_SECCOMP_SET_OBSOLETE; const char *value = NULL; value = qemu_opt_get(opts, "obsolete"); if (g_str...
[ 1, 0 ]
FFmpeg
libavcodec/j2kdec.c
static void j2k_flush(J2kDecoderContext *s) { if (*s->buf == 0xff) s->buf++; s->bit_index = 8; s->buf++; }
[ 1, 0 ]
qemu
iothread.c
static void iothread_instance_finalize(Object *obj) { IOThread *iothread = IOTHREAD(obj); iothread_stop(obj, NULL); qemu_cond_destroy(&iothread->init_done_cond); qemu_mutex_destroy(&iothread->init_done_lock); aio_context_unref(iothread->ctx);
[ 1, 0 ]
FFmpeg
libavcodec/ac3enc.c
av_cold int ff_ac3_encode_close(AVCodecContext *avctx) { int blk, ch; AC3EncodeContext *s = avctx->priv_data; av_freep(&s->windowed_samples); for (ch = 0; ch < s->channels; ch++) av_freep(&s->planar_samples[ch]); av_freep(&s->planar_samples); av_freep(&s->bap_buffer); av_freep(&s->bap1_buffer...
[ 1, 0 ]
qemu
hw/file-op-9p.h
static int local_open2(FsContext *fs_ctx, const char *path, int flags, FsCred *credp) { int fd = -1; int err = -1; int serrno = 0; /* Determine the security model */ if (fs_ctx->fs_sm == SM_MAPPED) { fd = open(rpath(fs_ctx, path), flags, SM_LOCAL_MODE_BITS); if (fd == -...
[ 1, 0 ]
FFmpeg
libswscale/swscale-example.c
static inline void yuv2packedXinC(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize, int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, uint8_t *dest, int ...
[ 1, 0 ]
qemu
Makefile.objs
bool qemu_file_mode_is_not_valid(const char *mode) { if (mode == NULL || (mode[0] != 'r' && mode[0] != 'w') || mode[1] != 'b' || mode[2] != 0) { fprintf(stderr, "qemu_fopen: Argument validity check failed\n"); return true; } return false; }
[ 1, 0 ]
FFmpeg
libavcodec/pthread.c
void ff_thread_flush(AVCodecContext *avctx) { FrameThreadContext *fctx = avctx->thread_opaque; if (!avctx->thread_opaque) return; park_frame_worker_threads(fctx, avctx->thread_count); if (fctx->prev_thread) update_context_from_thread(fctx->threads->avctx, fctx->prev_thread->avctx, ...
[ 1, 0 ]
FFmpeg
libavcodec/j2k.c
void ff_j2k_cleanup(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty) { int reslevelno, bandno, precno; for (reslevelno = 0; reslevelno < codsty->nreslevels; reslevelno++) { Jpeg2000ResLevel *reslevel = comp->reslevel + reslevelno; for (bandno = 0; bandno < reslevel->nbands; bandno++) { Jpeg...
[ 1, 0 ]
qemu
hw/ppc/ppc405_boards.c
static uint32_t taihu_cpld_readb(void *opaque, hwaddr addr) { taihu_cpld_t *cpld; uint32_t ret; cpld = opaque; switch (addr) { case 0x0: ret = cpld->reg0; break; case 0x1: ret = cpld->reg1; break; default: ret = 0; break; } return ret; }
[ 0, 0 ]
qemu
block/qapi.c
static void test_visitor_in_struct_nested(TestInputVisitorData *data, const void *unused) { UserDefTwo *udp = NULL; Visitor *v; v = visitor_input_test_init(data, "{ 'string0': 'string0', " "'dict1': { 'stri...
[ 1, 0 ]
qemu
fsdev/virtfs-proxy-helper.c
static void prstatfs_to_statfs(struct statfs *stfs, ProxyStatFS *prstfs) { memset(stfs, 0, sizeof(*stfs)); stfs->f_type = prstfs->f_type; stfs->f_bsize = prstfs->f_bsize; stfs->f_blocks = prstfs->f_blocks; stfs->f_bfree = prstfs->f_bfree; stfs->f_bavail = prstfs->f_bavail; stfs->f_files = prstfs->...
[ 1, 0 ]
qemu
audio/audio.c
static SCSIRequest *scsi_new_request(SCSIDevice *d, uint32_t tag, uint32_t lun, uint8_t *buf, void *hba_private) { SCSIRequest *req; req = scsi_req_alloc(&scsi_generic_req_ops, d, tag, lun, hba_private); return req; }
[ 0, 0 ]
qemu
blockjob.c
void block_job_sleep_ns(BlockJob *job, QEMUClockType type, int64_t ns) { assert(job->busy); /* Check cancellation *before* setting busy = false, too! */ if (block_job_is_cancelled(job)) { return; } job->busy = false; if (block_job_is_paused(job)) { qemu_coroutine_yield(); } else { c...
[ 0, 0 ]
qemu
audio/alsaaudio.c
void mixeng_clear(st_sample_t *buf, int len) { memset(buf, 0, len * sizeof(st_sample_t)); }
[ 1, 0 ]
qemu
hw/slavio_intctl.c
static void slavio_set_timer_irq_cpu(void *opaque, int cpu, int level) { SLAVIO_INTCTLState *s = opaque; DPRINTF("Set cpu %d local level %d\n", cpu, level); if (!s->cpu_envs[cpu]) return; if (level) { s->intreg_pending[cpu] |= s->cputimer_bit; } else { s->intreg_pending[cpu] &= ~s->cputim...
[ 0, 0 ]
qemu
hw/ppc/ppce500_spin.c
static void spin_reset(void *opaque) { SpinState *s = opaque; int i; for (i = 0; i < MAX_CPUS; i++) { SpinInfo *info = &s->spin[i]; info->pir = i; info->r3 = i; info->addr = 1; } }
[ 0, 0 ]
qemu
block.c
static QDict *parse_json_filename(const char *filename, Error **errp) { QObject *options_obj; QDict *options; int ret; ret = strstart(filename, "json:", &filename); assert(ret); options_obj = qobject_from_json(filename); if (!options_obj) { error_setg(errp, "Could not parse the JSON options")...
[ 0, 0 ]
qemu
bootdevice.c
static void do_boot_set(Monitor *mon, const QDict *qdict) { int res; const char *bootdevice = qdict_get_str(qdict, "bootdevice"); res = qemu_boot_set(bootdevice); if (res == 0) { monitor_printf(mon, "boot device list now set to %s\n", bootdevice); } else if (res > 0) { monitor_printf(mon, "set...
[ 0, 0 ]
qemu
hw/i386/pc.c
static void pc_fw_cfg_guest_info(PcGuestInfo *guest_info) { PcRomPciInfo *info; if (!guest_info->has_pci_info) { return; } info = g_malloc(sizeof *info); info->w32_min = cpu_to_le64(guest_info->pci_info.w32.begin); info->w32_max = cpu_to_le64(guest_info->pci_info.w32.end); info->w64_min = cpu_...
[ 1, 0 ]
qemu
block/nbd.c
void qio_channel_socket_connect_async(QIOChannelSocket *ioc, SocketAddress *addr, QIOTaskFunc callback, gpointer opaque, GDestroyNotify destroy) { QIOTask *task...
[ 0, 0 ]
qemu
fpu/softfloat-native.c
static inline uint32_t efsctuiz(uint32_t val) { CPU_FloatU u; u.l = val; /* NaN are not treated the same way IEEE 754 does */ if (unlikely(float32_is_nan(u.f))) return 0; return float32_to_uint32_round_to_zero(u.f, &env->vec_status); }
[ 0, 0 ]
qemu
acl.c
static void xen_config_cleanup_dir(char *dir) { struct xs_dirs *d; d = qemu_malloc(sizeof(*d)); d->xs_dir = dir; TAILQ_INSERT_TAIL(&xs_cleanup, d, list); }
[ 0, 0 ]
qemu
tcg/s390/tcg-target.h
static void tgen_ext16u(TCGContext *s, TCGType type, TCGReg dest, TCGReg src) { if (facilities & FACILITY_EXT_IMM) { tcg_out_insn(s, RRE, LLGHR, dest, src); return; } if (dest == src) { tcg_out_movi(s, type, TCG_TMP0, 0xffff); src = TCG_TMP0; } else { tcg_out_movi(s, type, dest, 0xf...
[ 0, 0 ]
qemu
linux-user/elfload.c
static int fill_psinfo(struct target_elf_prpsinfo *psinfo, const TaskState *ts) { char *filename, *base_filename; unsigned int i, len; (void)memset(psinfo, 0, sizeof(*psinfo)); len = ts->info->arg_end - ts->info->arg_start; if (len >= ELF_PRARGSZ) len = ELF_PRARGSZ - 1; if (copy_from_user(&psinf...
[ 1, 0 ]
FFmpeg
avconv.c
static void do_exit(void) { if (cur_stream) { stream_close(cur_stream); cur_stream = NULL; } uninit_opts(); #if CONFIG_AVFILTER avfilter_uninit(); #endif avformat_network_deinit(); if (show_status) printf("\n"); SDL_Quit(); av_log(NULL, AV_LOG_QUIET, ""); exit(0); }
[ 0, 0 ]
FFmpeg
libavcodec/utils.c
int attribute_align_arg avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVFrame *pict) { AVPacket pkt; int ret, got_packet = 0; if (buf_size < FF_MIN_BUFFER_SIZE) { av_log(avctx, AV_LO...
[ 1, 0 ]
qemu
hw/grlib_apbuart.c
grlib_apbuart_writel(void *opaque, target_phys_addr_t addr, uint32_t value) { UART *uart = opaque; unsigned char c = 0; addr &= 0xff; /* Unit registers */ switch (addr) { case DATA_OFFSET: c = value & 0xFF; qemu_chr_write(uart->chr, &c, 1); return; case STATUS_OFFSET: /* Read O...
[ 1, 0 ]
FFmpeg
libavcodec/a64multienc.c
static av_cold int xvid_encode_close(AVCodecContext *avctx) { struct xvid_context *x = avctx->priv_data; if (x->encoder_handle) { xvid_encore(x->encoder_handle, XVID_ENC_DESTROY, NULL, NULL); x->encoder_handle = NULL; } av_frame_free(&avctx->coded_frame); av_freep(&avctx->extradata); if (x->...
[ 0, 0 ]
qemu
tests/check-qjson.c
static void single_quote_string(void) { int i; struct { const char *encoded; const char *decoded; } test_cases[] = { {"'hello world'", "hello world"}, {"'the quick brown fox \\' jumped over the fence'", "the quick brown fox ' jumped over the fence"}, {} }; for (i =...
[ 1, 0 ]
FFmpeg
ffplay.c
static double get_video_clock(VideoState *is) { double delta; if (is->paused) { // FIXME timing gets messed after pause delta = 0; } else { delta = (av_gettime() - is->video_current_pts_time) / 1000000.0; } return is->video_current_pts + delta; }
[ 0, 1 ]
FFmpeg
libavformat/omadec.c
static int oma_read_seek(struct AVFormatContext *s, int stream_index, int64_t timestamp, int flags) { OMAContext *oc = s->priv_data; int err = ff_pcm_read_seek(s, stream_index, timestamp, flags); if (!oc->encrypted) return err; /* readjust IV for CBC */ if (err || avio_tel...
[ 1, 0 ]
qemu
hw/ide/piix.c
int pci_piix3_xen_ide_unplug(DeviceState *dev) { PCIIDEState *pci_ide; DriveInfo *di; int i = 0; pci_ide = PCI_IDE(dev); for (; i < 3; i++) { di = drive_get_by_index(IF_IDE, i); if (di != NULL && !di->media_cd) { BlockBackend *blk = blk_by_legacy_dinfo(di); DeviceState *ds = blk_...
[ 1, 0 ]
FFmpeg
libavcodec/h264pred.c
static void pred8x8_dc_rv40_c(uint8_t *src, int stride) { int i; int dc0 = 0; for (i = 0; i < 4; i++) { dc0 += src[-1 + i * stride] + src[i - stride]; dc0 += src[4 + i - stride]; dc0 += src[-1 + (i + 4) * stride]; } dc0 = 0x01010101 * ((dc0 + 8) >> 4); for (i = 0; i < 4; i++) { ((ui...
[ 1, 0 ]
qemu
include/qemu/range.h
static void string_output_append_range(StringOutputVisitor *sov, int64_t s, int64_t e) { Range *r = g_malloc0(sizeof(*r)); r->begin = s; r->end = e + 1; sov->ranges = g_list_insert_sorted_merged(sov->ranges, r, range_compare); }
[ 1, 0 ]
qemu
target-s390x/mem_helper.c
void HELPER(mvc)(CPUS390XState *env, uint32_t l, uint64_t dest, uint64_t src) { int i = 0; int x = 0; uint32_t l_64 = (l + 1) / 8; HELPER_LOG("%s l %d dest %" PRIx64 " src %" PRIx64 "\n", __func__, l, dest, src); #ifndef CONFIG_USER_ONLY if ((l > 32) && (src & TARGET_PAGE_MASK) == ...
[ 1, 0 ]
FFmpeg
libavcodec/ffv1.c
static void common_end(FFV1Context *s) { int i; for (i = 0; i < s->plane_count; i++) { PlaneContext *p = &s->plane[i]; av_freep(&p->state); } }
[ 1, 0 ]
qemu
hw/char/xen_console.c
static int con_initialise(struct XenDevice *xendev) { struct XenConsole *con = container_of(xendev, struct XenConsole, xendev); int limit; if (xenstore_read_int(con->console, "ring-ref", &con->ring_ref) == -1) return -1; if (xenstore_read_int(con->console, "port", &con->xendev.remote_port) == -1) ...
[ 1, 0 ]
qemu
block-migration.c
static void set_dirty_tracking(void) { BlkMigDevState *bmds; QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) { bmds->dirty_bitmap = bdrv_create_dirty_bitmap(bmds->bs, BLOCK_SIZE); } }
[ 1, 0 ]
qemu
arch_init.c
static int img_create(int argc, char **argv) { int c, ret = 0; uint64_t img_size = -1; const char *fmt = "raw"; const char *base_fmt = NULL; const char *filename; const char *base_filename = NULL; char *options = NULL; for (;;) { c = getopt(argc, argv, "F:b:f:he6o:"); if (c == -1) { ...
[ 1, 0 ]
qemu
hw/intc/xics.c
int spapr_rtas_register(const char *name, spapr_rtas_fn fn) { int i; for (i = 0; i < (rtas_next - rtas_table); i++) { if (strcmp(name, rtas_table[i].name) == 0) { fprintf(stderr, "RTAS call \"%s\" registered twice\n", name); exit(1); } } assert(rtas_next < (rtas_table + TOKEN_MAX)); ...
[ 1, 0 ]
qemu
block.c
static void qemu_gluster_complete_aio(void *opaque) { GlusterAIOCB *acb = (GlusterAIOCB *)opaque; qemu_bh_delete(acb->bh); acb->bh = NULL; qemu_coroutine_enter(acb->coroutine, NULL); }
[ 1, 0 ]
qemu
hw/virtio-pci.c
static void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev, uint16_t vendor, uint16_t device, uint16_t class_code, uint8_t pif) { uint8_t *config; uint32_t size; proxy->vdev = vdev; config = proxy->pci_dev.config; pci_config_set_vendor...
[ 1, 0 ]
qemu
savevm.c
static int get_unused_buffer(QEMUFile *f, void *pv, size_t size) { qemu_fseek(f, size, SEEK_CUR); return 0; }
[ 1, 0 ]
FFmpeg
libavformat/ac3dec.c
static int ac3_eac3_probe(AVProbeData *p, enum CodecID expected_codec_id) { int max_frames, first_frames = 0, frames; uint8_t *buf, *buf2, *end; AC3HeaderInfo hdr; GetBitContext gbc; enum CodecID codec_id = CODEC_ID_AC3; max_frames = 0; buf = p->buf; end = buf + p->buf_size; for (; buf < end...
[ 1, 0 ]
FFmpeg
libavformat/4xm.c
static int h263_probe(AVProbeData *p) { int code; const uint8_t *d; if (p->buf_size < 6) return 0; d = p->buf; code = (d[0] << 14) | (d[1] << 6) | (d[2] >> 2); if (code == 0x20) { return 50; } return 0; }
[ 1, 0 ]
FFmpeg
libavcodec/ac3dec.c
static void ac3_downmix(AC3DecodeContext *s) { int i, j; float v0, v1; for (i = 0; i < 256; i++) { v0 = v1 = 0.0f; for (j = 0; j < s->fbw_channels; j++) { v0 += s->output[j][i] * s->downmix_coeffs[j][0]; v1 += s->output[j][i] * s->downmix_coeffs[j][1]; } v0 /= s->downmix_coeff...
[ 0, 0 ]
qemu
hw/block/virtio-blk.c
static void virtio_net_set_features(VirtIODevice *vdev, uint64_t features) { VirtIONet *n = VIRTIO_NET(vdev); int i; virtio_net_set_multiqueue(n, __virtio_has_feature(features, VIRTIO_NET_F_MQ)); virtio_net_set_mrg_rx_bufs(n, __virtio_has_feature(f...
[ 1, 0 ]
qemu
hw/vfio/common.c
static void vhost_iommu_region_add(MemoryListener *listener, MemoryRegionSection *section) { struct vhost_dev *dev = container_of(listener, struct vhost_dev, iommu_listener); struct vhost_iommu *iommu; if (!memory_region_is_iommu(sect...
[ 1, 1 ]
qemu
block/qed-cluster.c
static void qed_plug_allocating_write_reqs(BDRVQEDState *s) { assert(!s->allocating_write_reqs_plugged); s->allocating_write_reqs_plugged = true; }
[ 0, 0 ]
qemu
hw/i386/pc.c
static X86CPU *pc_new_cpu(const char *cpu_model, int64_t apic_id, Error **errp) { X86CPU *cpu = NULL; Error *local_err = NULL; cpu = cpu_x86_create(cpu_model, &local_err); if (local_err != NULL) { goto out; } object_property_set_int(OBJECT(cpu), apic_id, "apic-id", &loc...
[ 0, 0 ]
qemu
HACKING
static uint32_t slow_bar_readw(void *opaque, target_phys_addr_t addr) { AssignedDevRegion *d = opaque; uint16_t *in = (uint16_t *)(d->u.r_virtbase + addr); uint32_t r; r = *in; DEBUG("slow_bar_readl addr=0x" TARGET_FMT_plx " val=0x%08x\n", addr, r); return r; }
[ 0, 0 ]
FFmpeg
libavcodec/nvdec.c
static int nvdec_hevc_decode_init(AVCodecContext *avctx) { const HEVCContext *s = avctx->priv_data; const HEVCSPS *sps = s->ps.sps; return ff_nvdec_decode_init( avctx, sps->temporal_layer[sps->max_sub_layers - 1].max_dec_pic_buffering + 1); }
[ 1, 0 ]
qemu
qemu-char.c
static gboolean pty_chr_timer(gpointer opaque) { struct CharDriverState *chr = opaque; PtyCharDriver *s = chr->opaque; if (s->connected) { goto out; } /* Next poll ... */ pty_chr_update_read_handler(chr); out: s->timer_tag = 0; return FALSE; }
[ 1, 0 ]
qemu
block/vvfat.c
static int enable_write_target(BDRVVVFATState *s, Error **errp) { BlockDriver *bdrv_qcow; QEMUOptionParameter *options; int ret; int size = sector2cluster(s, s->sector_count); s->used_clusters = calloc(size, 1); array_init(&(s->commits), sizeof(commit_t)); s->qcow_filename = g_malloc(1024); ret...
[ 1, 0 ]
FFmpeg
libavformat/rtpdec_h264.c
static int parse_h264_sdp_line(AVFormatContext *s, int st_index, PayloadContext *h264_data, const char *line) { AVStream *stream; AVCodecContext *codec; const char *p = line; if (st_index < 0) return 0; stream = s->streams[st_index]; codec = stream->codec; asse...
[ 1, 0 ]
qemu
hw/virtio/virtio.c
static unsigned virtqueue_read_next_desc(VirtIODevice *vdev, VRingDesc *desc, hwaddr desc_pa, unsigned int max) { unsigned int next; /* If this descriptor says it doesn't chain, we're done. */ if (!(desc->flags & VRING_DESC_F_NEXT)) { return max; } /* Check ...
[ 0, 0 ]
qemu
acl.c
static int blk_free(struct XenDevice *xendev) { struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev); struct ioreq *ioreq; while (!LIST_EMPTY(&blkdev->freelist)) { ioreq = LIST_FIRST(&blkdev->freelist); LIST_REMOVE(ioreq, list); qemu_iovec_destroy(&ioreq->v); qemu_free...
[ 0, 0 ]
qemu
block.c
void qmp_block_dirty_bitmap_add(const char *node, const char *name, bool has_granularity, uint32_t granularity, Error **errp) { AioContext *aio_context; BlockDriverState *bs; if (!name || name[0] == '\0') { error_setg(errp, "Bitmap name ca...
[ 1, 0 ]
qemu
block/stream.c
static void stream_set_speed(BlockJob *job, int64_t speed, Error **errp) { StreamBlockJob *s = container_of(job, StreamBlockJob, common); if (speed < 0) { error_set(errp, QERR_INVALID_PARAMETER, "speed"); return; } ratelimit_set_speed(&s->limit, speed / BDRV_SECTOR_SIZE); }
[ 0, 0 ]
qemu
linux-user/syscall.c
static abi_long lock_iovec(int type, struct iovec *vec, abi_ulong target_addr, int count, int copy) { struct target_iovec *target_vec; abi_ulong base; int i; target_vec = lock_user(VERIFY_READ, target_addr, count * sizeof(struct target_iovec), 1); if ...
[ 1, 1 ]
qemu
HACKING
static void fw_cfg_ctl_mem_write(void *opaque, target_phys_addr_t addr, uint64_t value, unsigned size) { fw_cfg_select(opaque, (uint16_t)value); }
[ 0, 0 ]
qemu
block.c
static void tracked_request_begin(BdrvTrackedRequest *req, BlockDriverState *bs, int64_t sector_num, int nb_sectors, bool is_write) *req = (BdrvTrackedRequest){ .bs = bs, .sector_num = sector_num, .nb_sectors = nb_sectors, .is_write = is_write,...
[ 1, 0 ]
qemu
bsd-user/main.c
static void puv3_init(MachineState *machine) { ram_addr_t ram_size = machine->ram_size; const char *cpu_model = machine->cpu_model; const char *kernel_filename = machine->kernel_filename; const char *initrd_filename = machine->initrd_filename; CPUUniCore32State *env; UniCore32CPU *cpu; if (initrd_...
[ 1, 0 ]
qemu
qemu-io.c
static int open_f(BlockDriverState *bs, int argc, char **argv) { int flags = 0; int readonly = 0; int growable = 0; int c; QemuOpts *qopts; QDict *opts; while ((c = getopt(argc, argv, "snrgo:")) != EOF) { switch (c) { case 's': flags |= BDRV_O_SNAPSHOT; break; case 'n'...
[ 1, 0 ]
FFmpeg
libavcodec/pthread_slice.c
int ff_slice_thread_init(AVCodecContext *avctx) { int i; ThreadContext *c; int thread_count = avctx->thread_count; #if HAVE_W32THREADS w32thread_init(); #endif if (!thread_count) { int nb_cpus = av_cpu_count(); av_log(avctx, AV_LOG_DEBUG, "detected %d logical cores\n", nb_cpus); // use ...
[ 0, 0 ]
FFmpeg
libavcodec/j2kenc.c
void ff_jpeg2000_cleanup(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty) { int reslevelno, bandno, precno; for (reslevelno = 0; comp->reslevel && reslevelno < codsty->nreslevels; reslevelno++) { Jpeg2000ResLevel *reslevel; if (!comp->reslevel) continue; reslevel = comp...
[ 1, 0 ]
qemu
hw/scsi/scsi-bus.c
SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk, int unit, bool removable, int bootindex, const char *serial, Error **errp) { const char *driver; char *name; DeviceState *dev; Error *err = NULL; driver = ...
[ 1, 0 ]
FFmpeg
libavcodec/h263.c
static void ff_mpeg4_init_direct_mv(MpegEncContext *s) { // FIXME table is stored in MpegEncContext for thread-safety, // but a static array would be faster static const int tab_size = sizeof(s->direct_scale_mv[0]) / sizeof(int16_t); static const int tab_bias = (tab_size / 2); int i; for (i = 0; i < t...
[ 1, 1 ]
FFmpeg
ffplay.c
static void video_image_display(VideoState *is) { Frame *vp; Frame *sp; AVPicture pict; SDL_Rect rect; int i; vp = frame_queue_peek(&is->pictq); if (vp->bmp) { if (is->subtitle_st) { if (frame_queue_nb_remaining(&is->subpq) > 0) { sp = frame_queue_peek(&is->subpq); if...
[ 1, 0 ]
FFmpeg
libavutil/imgutils.c
int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); int max_step[4]; /* max pixel step for each plane */ int max_step_comp[4]; /* the component for each plane which has the max pixel step */ ...
[ 1, 0 ]
qemu
hw/ipmi/ipmi_bmc_sim.c
static void get_sensor_reading(IPMIBmcSim *ibs, uint8_t *cmd, unsigned int cmd_len, uint8_t *rsp, unsigned int *rsp_len, unsigned int max_rsp_len) { IPMISensor *sens; IPMI_CHECK_CMD_LEN(3); if ((cmd[2] > MAX_SENSOR...
[ 1, 0 ]
qemu
linux-user/syscall.c
static inline int target_to_host_errno(int err) { if (target_to_host_errno_table[err]) return target_to_host_errno_table[err]; return err; }
[ 1, 0 ]
FFmpeg
libavcodec/mpeg12.c
static int find_start_code(const uint8_t **pbuf_ptr, const uint8_t *buf_end) { const uint8_t *buf_ptr = *pbuf_ptr; buf_ptr++; // gurantees that -1 is within the array buf_end -= 2; // gurantees that +2 is within the array while (buf_ptr < buf_end) { if (*buf_ptr == 0) { while (buf_ptr < buf_end...
[ 1, 1 ]
FFmpeg
libavcodec/a64multienc.c
av_cold int ff_nvenc_encode_init(AVCodecContext *avctx) { int ret; if ((ret = nvenc_load_libraries(avctx)) < 0) return ret; if ((ret = nvenc_setup_device(avctx)) < 0) return ret; if ((ret = nvenc_setup_encoder(avctx)) < 0) return ret; if ((ret = nvenc_setup_surfaces(avctx)) < 0) retu...
[ 0, 0 ]
qemu
Makefile.objs
static int qemu_rdma_exchange_get_response(RDMAContext *rdma, RDMAControlHeader *head, int expecting, int idx) { uint32_t byte_len; int ret = qemu_rdma_block_for_wrid(rdma, RDMA_WRID_RECV_CONTROL + idx, ...
[ 1, 0 ]
qemu
MAINTAINERS
static inline void kqemu_load_seg(struct kqemu_segment_cache *ksc, const SegmentCache *sc) { ksc->selector = sc->selector; ksc->flags = sc->flags; ksc->limit = sc->limit; ksc->base = sc->base; }
[ 0, 0 ]
FFmpeg
libavcodec/utils.c
int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, uint8_t *buf, int buf_size) { int ret; // FIXME remove the check below _after_ ensuring that all audio check that the // available space is enough if (*frame_size_ptr...
[ 1, 1 ]
qemu
target/arm/translate.c
static inline void gen_lookup_tb(DisasContext *s) { tcg_gen_movi_i32(cpu_R[15], s->pc & ~1); s->is_jmp = DISAS_JUMP; }
[ 0, 0 ]
qemu
hw/pci.c
static int pci_bridge_initfn(PCIDevice *dev) { PCIBridge *s = DO_UPCAST(PCIBridge, dev, dev); pci_config_set_vendor_id(s->dev.config, s->vid); pci_config_set_device_id(s->dev.config, s->did); s->dev.config[0x04] = 0x06; // command = bus master, pci mem s->dev.config[0x05] = 0x00; s->dev.config[0x06] ...
[ 1, 0 ]
qemu
hw/audio/gus.c
static void isabus_fdc_realize(DeviceState *dev, Error **errp) { ISADevice *isadev = ISA_DEVICE(dev); FDCtrlISABus *isa = ISA_FDC(dev); FDCtrl *fdctrl = &isa->state; Error *err = NULL; isa_register_portio_list(isadev, isa->iobase, fdc_portio_list, fdctrl, "fdc"); isa_init_...
[ 1, 0 ]
FFmpeg
libavformat/ogg2.c
ogg_get_length(AVFormatContext *s) { ogg_t *ogg = s->priv_data; int idx = -1, i; offset_t size, end; if (s->pb.is_streamed) return 0; // already set if (s->duration != AV_NOPTS_VALUE) return 0; size = url_fsize(&s->pb); if (size < 0) return 0; end = size > MAX_PAGE_SIZE ? size...
[ 1, 0 ]
FFmpeg
libavformat/rmenc.c
static int rm_write_header(AVFormatContext *s) { RMMuxContext *rm = s->priv_data; StreamInfo *stream; int n; AVCodecContext *codec; for (n = 0; n < s->nb_streams; n++) { s->streams[n]->id = n; codec = s->streams[n]->codec; stream = &rm->streams[n]; memset(stream, 0, sizeof(StreamInfo)); st...
[ 1, 1 ]
FFmpeg
libavcodec/ac3dec.c
static inline void mix_stereo_to_mono(AC3DecodeContext *ctx) { int i; float (*output)[256] = ctx->audio_block.block_output; for (i = 0; i < 256; i++) output[1][i] += output[2][i]; memset(output[2], 0, sizeof(output[2])); }
[ 1, 0 ]
FFmpeg
libavformat/mxfdec.c
static int mxf_read_content_storage(void *arg, AVIOContext *pb, int tag, int size, UID uid) { MXFContext *mxf = arg; switch (tag) { case 0x1901: mxf->packages_count = avio_rb32(pb); if (mxf->packages_count >= UINT_MAX / sizeof(UID)) return -1; mxf->pac...
[ 1, 0 ]
qemu
target/ppc/cpu.c
static void gen_write_xer(TCGv src) { tcg_gen_andi_tl(cpu_xer, src, ~((1u << XER_SO) | (1u << XER_OV) | (1u << XER_CA))); tcg_gen_extract_tl(cpu_so, src, XER_SO, 1); tcg_gen_extract_tl(cpu_ov, src, XER_OV, 1); tcg_gen_extract_tl(cpu_ca, src, XER_CA, 1); }
[ 1, 0 ]
qemu
hw/nvram/fw_cfg.c
static void fw_cfg_initfn(Object *obj) { SysBusDevice *sbd = SYS_BUS_DEVICE(obj); FWCfgState *s = FW_CFG(obj); memory_region_init_io(&s->ctl_iomem, OBJECT(s), &fw_cfg_ctl_mem_ops, s, "fwcfg.ctl", FW_CFG_SIZE); sysbus_init_mmio(sbd, &s->ctl_iomem); memory_region_init_io(&s->data_...
[ 1, 0 ]
FFmpeg
libavutil/cpu.c
int av_get_cpu_flags(void) { int flags = cpu_flags; if (flags == -1) { flags = get_cpu_flags(); cpu_flags = flags; } return flags; }
[ 1, 0 ]
qemu
target/hppa/translate.c
static ExitStatus trans_fop_weww_0c(DisasContext *ctx, uint32_t insn, const DisasInsn *di) { unsigned rt = extract32(insn, 0, 5); unsigned rb = extract32(insn, 16, 5); unsigned ra = extract32(insn, 21, 5); return do_fop_weww(ctx, rt, ra, rb, di->f_weww); }
[ 1, 0 ]
FFmpeg
doc/examples/vaapi_encode.c
static int set_hwframe_ctx(AVCodecContext *ctx, AVBufferRef *hw_device_ctx) { AVBufferRef *hw_frames_ref; AVHWFramesContext *frames_ctx = NULL; int err = 0; if (!(hw_frames_ref = av_hwframe_ctx_alloc(hw_device_ctx))) { fprintf(stderr, "Failed to create VAAPI frame context.\n"); return -1; } ...
[ 1, 0 ]
FFmpeg
libavcodec/bfi.c
static av_cold int bfi_decode_init(AVCodecContext *avctx) { BFIContext *bfi = avctx->priv_data; avctx->pix_fmt = AV_PIX_FMT_PAL8; bfi->dst = av_mallocz(avctx->width * avctx->height); return 0; }
[ 1, 0 ]
qemu
block/rbd.c
static int qemu_rbd_send_pipe(BDRVRBDState *s, RADOSCB *rcb) { int ret = 0; while (1) { fd_set wfd; int fd = s->fds[RBD_FD_WRITE]; /* send the op pointer to the qemu thread that is responsible for the aio/op completion. Must do it in a qemu thread context */ ret = write(fd, (void *)&r...
[ 1, 0 ]
qemu
hw/apb_pci.c
static void tcx_init(target_phys_addr_t addr, int vram_size, int width, int height, int depth) { DeviceState *dev; SysBusDevice *s; dev = qdev_create(NULL, "SUNW,tcx"); qdev_prop_set_taddr(dev, "addr", addr); qdev_prop_set_uint32(dev, "vram_size", vram_size); qdev_prop_set_uint1...
[ 1, 0 ]
FFmpeg
libswscale/cs_test.c
void palette8tobgr32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette) { long i; for (i = 0; i < num_pixels; i++) { #ifdef WORDS_BIGENDIAN dst[3] = palette[src[i] * 4 + 0]; dst[2] = palette[src[i] * 4 + 1]; dst[1] = palette[src[i] * 4 + 2]; #else ...
[ 1, 1 ]
qemu
block.c
static int do_req(int sockfd, AioContext *aio_context, SheepdogReq *hdr, void *data, unsigned int *wlen, unsigned int *rlen) { Coroutine *co; SheepdogReqCo srco = { .sockfd = sockfd, .aio_context = aio_context, .hdr = hdr, .data = data, .wlen = wlen, ....
[ 1, 0 ]
qemu
hw/s390x/s390-pci-bus.c
void s390_pci_iommu_enable(S390PCIBusDevice *pbdev) { uint64_t size = pbdev->pal - pbdev->pba + 1; memory_region_init_iommu(&pbdev->iommu_mr, OBJECT(&pbdev->mr), &s390_iommu_ops, "iommu-s390", size); memory_region_add_subregion(&pbdev->mr, pbdev->pba, &pbdev->iommu_mr); pbdev->i...
[ 1, 0 ]
qemu
slirp/misc.c
strdup(str) const char *str; { char *bptr; bptr = (char *)malloc(strlen(str) + 1); strcpy(bptr, str); return bptr; }
[ 1, 0 ]