project
stringclasses
2 values
commit_id
stringlengths
40
40
target
int64
0
1
func
stringlengths
26
142k
idx
int64
0
27.3k
FFmpeg
b88be742fac7a77a8095e8155ba8790db4b77568
1
static void encode_quant_matrix(VC2EncContext *s) { int level, custom_quant_matrix = 0; if (s->wavelet_depth > 4 || s->quant_matrix != VC2_QM_DEF) custom_quant_matrix = 1; put_bits(&s->pb, 1, custom_quant_matrix); if (custom_quant_matrix) { init_custom_qm(s); put_vc2_ue_u...
3,424
FFmpeg
f42b3195d3f2692a4dfc0a8668bb4ac35301f2ed
1
static void fix_bitshift(ShortenContext *s, int32_t *buffer) { int i; if (s->bitshift != 0) for (i = 0; i < s->blocksize; i++) buffer[s->nwrap + i] <<= s->bitshift; }
3,425
qemu
7bdfd907e7072e380f325e735d99677df53f00ec
1
static void wav_capture_destroy (void *opaque) { WAVState *wav = opaque; AUD_del_capture (wav->cap, wav); }
3,426
qemu
a32354e206895400d17c3de9a8df1de96d3df289
1
static uint32_t m5206_mbar_readw(void *opaque, target_phys_addr_t offset) { m5206_mbar_state *s = (m5206_mbar_state *)opaque; int width; offset &= 0x3ff; if (offset > 0x200) { hw_error("Bad MBAR read offset 0x%x", (int)offset); } width = m5206_mbar_width[offset >> 2]; if (wi...
3,427
qemu
42e4126b793d15ec40f3a84017e1d8afecda1b6d
1
uint32_t pci_data_read(PCIBus *s, uint32_t addr, int len) { PCIDevice *pci_dev = pci_dev_find_by_addr(s, addr); uint32_t config_addr = addr & (PCI_CONFIG_SPACE_SIZE - 1); uint32_t val; assert(len == 1 || len == 2 || len == 4); if (!pci_dev) { return ~0x0; } val = pci_dev...
3,428
FFmpeg
0424e052f83adc422d8a746e3cdc5ab6bc28679e
1
static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){ MpegEncContext * const s = &h->s; AVCodecContext * const avctx= s->avctx; int buf_index=0; H264Context *hx; ///< thread context int context_count = 0; int next_avc= h->is_avc ? 0 : buf_size; h->max_contex...
3,429
FFmpeg
4c7b023d56e09a78a587d036db1b64bf7c493b3d
0
static int nvdec_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { NVDECContext *ctx = avctx->internal->hwaccel_priv_data; void *tmp; tmp = av_fast_realloc(ctx->slice_offsets, &ctx->slice_offsets_allocated, (ctx->nb_slices + 1) * sizeof(*ctx->sl...
3,430
qemu
0919ac787641db11024912651f3bc5764d4f1286
0
static void omap2_inth_write(void *opaque, target_phys_addr_t addr, uint64_t value, unsigned size) { struct omap_intr_handler_s *s = (struct omap_intr_handler_s *) opaque; int offset = addr; int bank_no, line_no; struct omap_intr_handler_bank_s *bank = NULL; if ...
3,431
qemu
aea390e4be652d5b5457771d25eded0dba14fe37
0
static bool pte32_match(target_ulong pte0, target_ulong pte1, bool secondary, target_ulong ptem) { return (pte0 & HPTE32_V_VALID) && (secondary == !!(pte0 & HPTE32_V_SECONDARY)) && HPTE32_V_COMPARE(pte0, ptem); }
3,432
qemu
ee951a37d8873bff7aa58e23222dfd984111b6cb
0
static int hpet_init(SysBusDevice *dev) { HPETState *s = FROM_SYSBUS(HPETState, dev); int i, iomemtype; HPETTimer *timer; if (hpet_cfg.count == UINT8_MAX) { /* first instance */ hpet_cfg.count = 0; } if (hpet_cfg.count == 8) { fprintf(stderr, "Only 8 instanc...
3,433
qemu
3941bf6fb1c98a39bf8a0cfb4feacaef2a23d0db
0
static int send_png_rect(VncState *vs, int x, int y, int w, int h, QDict *palette) { png_byte color_type; png_structp png_ptr; png_infop info_ptr; png_colorp png_palette = NULL; size_t offset; int level = tight_conf[vs->tight_compression].raw_zlib_level; uin...
3,434
qemu
ac531cb6e542b1e61d668604adf9dc5306a948c0
0
START_TEST(qdict_put_exists_test) { int value; const char *key = "exists"; qdict_put(tests_dict, key, qint_from_int(1)); qdict_put(tests_dict, key, qint_from_int(2)); value = qdict_get_int(tests_dict, key); fail_unless(value == 2); fail_unless(qdict_size(tests_dict) == 1); }
3,435
qemu
a8170e5e97ad17ca169c64ba87ae2f53850dab4c
0
static void gt64120_writel (void *opaque, target_phys_addr_t addr, uint64_t val, unsigned size) { GT64120State *s = opaque; PCIHostState *phb = PCI_HOST_BRIDGE(s); uint32_t saddr; if (!(s->regs[GT_CPU] & 0x00001000)) val = bswap32(val); saddr = (addr &...
3,438
qemu
36e60ef6ac5d8a262d0fbeedfdb2b588514cb1ea
0
static void tcg_constant_folding(TCGContext *s) { int oi, oi_next, nb_temps, nb_globals; /* Array VALS has an element for each temp. If this temp holds a constant then its value is kept in VALS' element. If this temp is a copy of other ones then the other copies are available throug...
3,439
FFmpeg
0242351390643d176b10600c2eb854414f9559e6
0
static inline void qpel_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int field_based, int bottom_field, int field_select, uint...
3,441
qemu
ac2567b59d9e4afbcc31c71840d7fe8ef4eee857
0
void do_m68k_simcall(CPUM68KState *env, int nr) { uint32_t *args; args = (uint32_t *)(env->aregs[7] + 4); switch (nr) { case SYS_EXIT: exit(ARG(0)); case SYS_READ: check_err(env, read(ARG(0), (void *)ARG(1), ARG(2))); break; case SYS_WRITE: check_err(...
3,442
qemu
2569da0cb64506ea05323544c26f3aaffbf3f9fe
0
static void do_change(const char *device, const char *target, const char *fmt) { if (strcmp(device, "vnc") == 0) { do_change_vnc(target); } else { do_change_block(device, target, fmt); } }
3,443
qemu
c2b38b277a7882a592f4f2ec955084b2b756daaa
0
aio_ctx_dispatch(GSource *source, GSourceFunc callback, gpointer user_data) { AioContext *ctx = (AioContext *) source; assert(callback == NULL); aio_dispatch(ctx, true); return true; }
3,444
qemu
e70377dfa4bbc2e101066ca35675bed4129c5a8c
0
S390PCIBusDevice *s390_pci_find_dev_by_fid(uint32_t fid) { S390PCIBusDevice *pbdev; int i; S390pciState *s = s390_get_phb(); for (i = 0; i < PCI_SLOT_MAX; i++) { pbdev = s->pbdev[i]; if (pbdev && pbdev->fid == fid) { return pbdev; } } return NUL...
3,445
qemu
59b060be184aff59cfa101c937c8139e66f452f2
0
int qcrypto_pbkdf2_count_iters(QCryptoHashAlgorithm hash, const uint8_t *key, size_t nkey, const uint8_t *salt, size_t nsalt, Error **errp) { uint8_t out[32]; long long int iterations = (1 << 15); unsigned lo...
3,446
qemu
7a0e58fa648736a75f2a6943afd2ab08ea15b8e0
0
bool write_cpustate_to_list(ARMCPU *cpu) { /* Write the coprocessor state from cpu->env to the (index,value) list. */ int i; bool ok = true; for (i = 0; i < cpu->cpreg_array_len; i++) { uint32_t regidx = kvm_to_cpreg_id(cpu->cpreg_indexes[i]); const ARMCPRegInfo *ri; ...
3,447
qemu
17e2377abf16c3951d7d34521ceade4d7dc31d01
0
void *qemu_malloc(size_t size) { return malloc(size); }
3,448
FFmpeg
d6737539e77e78fca9a04914d51996cfd1ccc55c
0
static void intra_predict_plane_16x16_msa(uint8_t *src, int32_t stride) { uint8_t lpcnt; int32_t res0, res1, res2, res3; uint64_t load0, load1; v16i8 shf_mask = { 7, 8, 6, 9, 5, 10, 4, 11, 3, 12, 2, 13, 1, 14, 0, 15 }; v8i16 short_multiplier = { 1, 2, 3, 4, 5, 6, 7, 8 }; v4i32 int_multipl...
3,450
FFmpeg
2a351f6c5521c199b4285e4e42f2321e312170bd
0
static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame) { int (*filter_frame)(AVFilterLink *, AVFrame *); AVFilterContext *dstctx = link->dst; AVFilterPad *dst = link->dstpad; AVFrame *out = NULL; int ret; AVFilterCommand *cmd= link->dst->command_queue; int64_t pts; ...
3,451
FFmpeg
155ec6edf82692bcf3a5f87d2bc697404f4e5aaf
0
static void predict_plane(SnowContext *s, DWTELEM *buf, int plane_index, int add){ Plane *p= &s->plane[plane_index]; const int mb_w= s->mb_band.width; const int mb_h= s->mb_band.height; const int mb_stride= s->mb_band.stride; int x, y, mb_x, mb_y; int scale = plane_index ? s->mv_scal...
3,453
qemu
107e4b352cc309f9bd7588ef1a44549200620078
1
static void rocker_test_dma_ctrl(Rocker *r, uint32_t val) { PCIDevice *dev = PCI_DEVICE(r); char *buf; int i; buf = g_malloc(r->test_dma_size); if (!buf) { DPRINTF("test dma buffer alloc failed"); return; } switch (val) { case ROCKER_TEST_DMA_CTRL_CLEAR: ...
3,454
qemu
2d896b454a0e19ec4c1ddbb0e0b65b7e54fcedf3
1
xilinx_pcie_init(MemoryRegion *sys_mem, uint32_t bus_nr, hwaddr cfg_base, uint64_t cfg_size, hwaddr mmio_base, uint64_t mmio_size, qemu_irq irq, bool link_up) { DeviceState *dev; MemoryRegion *cfg, *mmio; dev = qdev_create(NULL, TYPE_XILINX_PCIE_HO...
3,455
qemu
f5f601afcec6c1081128fe5a0f831788ca9f56ed
1
long do_sigreturn(CPUMIPSState *regs) { struct sigframe *frame; abi_ulong frame_addr; sigset_t blocked; target_sigset_t target_set; int i; #if defined(DEBUG_SIGNAL) fprintf(stderr, "do_sigreturn\n"); #endif frame_addr = regs->active_tc.gpr[29]; if (!lock_user_struct(VERIFY_R...
3,457
qemu
ac58fe7b2c67a9be142beacd4c6ee51f3264d90f
1
static void pmac_dma_read(BlockBackend *blk, int64_t offset, unsigned int bytes, void (*cb)(void *opaque, int ret), void *opaque) { DBDMA_io *io = opaque; MACIOIDEState *m = io->opaque; IDEState *s = idebus_active_if(&m->bus); dma_addr_t dma_add...
3,458
FFmpeg
fdc94db37e89165964fdf34f1cd7632e44108bd0
1
static void sbr_qmf_analysis(AVFixedDSPContext *dsp, FFTContext *mdct, #else static void sbr_qmf_analysis(AVFloatDSPContext *dsp, FFTContext *mdct, #endif /* USE_FIXED */ SBRDSPContext *sbrdsp, const INTFLOAT *in, INTFLOAT *x, INTFLOAT z[320], INTFLOAT W[2]...
3,459
qemu
aa48dd9319dcee78ec17f4d516fb7bfc62b1a4d2
1
static CPUArchState *find_cpu(uint32_t thread_id) { CPUState *cpu; cpu = qemu_get_cpu(thread_id); if (cpu == NULL) { return NULL; } return cpu->env_ptr; }
3,462
FFmpeg
7cbb32e461cdbe8b745d560c1700c711ba5933cc
1
static void find_block_motion(DeshakeContext *deshake, uint8_t *src1, uint8_t *src2, int cx, int cy, int stride, MotionVector *mv) { int x, y; int diff; int smallest = INT_MAX; int tmp, tmp2; #define CMP(i, j) deshake->c.sad[0](de...
3,463
qemu
50ab0e0908d592b8bda56c2d7495e1190d734b0b
1
static void replication_close(BlockDriverState *bs) { BDRVReplicationState *s = bs->opaque; if (s->replication_state == BLOCK_REPLICATION_RUNNING) { replication_stop(s->rs, false, NULL); if (s->mode == REPLICATION_MODE_SECONDARY) { g_free(s->top_id); replication_remove(...
3,465
qemu
36ad0e948e15d8d86c8dec1c17a8588d87b0107d
1
static int kvm_irqchip_create(KVMState *s) { QemuOptsList *list = qemu_find_opts("machine"); int ret; if (QTAILQ_EMPTY(&list->head) || !qemu_opt_get_bool(QTAILQ_FIRST(&list->head), "kernel_irqchip", true) || !kvm_check_extension(s, KVM_CAP_IRQCHIP)) { ...
3,466
qemu
b4ba67d9a702507793c2724e56f98e9b0f7be02b
1
uint32_t qpci_io_readl(QPCIDevice *dev, void *data) { uintptr_t addr = (uintptr_t)data; if (addr < QPCI_PIO_LIMIT) { return dev->bus->pio_readl(dev->bus, addr); } else { uint32_t val; dev->bus->memread(dev->bus, addr, &val, sizeof(val)); return le32_to_cpu(val); ...
3,467
qemu
2222e0a633070f7f3eafcc9d0e95e7f1a4e6fe36
1
static void hid_keyboard_process_keycode(HIDState *hs) { uint8_t hid_code, index, key; int i, keycode, slot; if (hs->n == 0) { return; slot = hs->head & QUEUE_MASK; QUEUE_INCR(hs->head); hs->n--; keycode = hs->kbd.keycodes[slot]; key = keycode & 0x7f; index = key | ((hs->kbd.modifier...
3,468
FFmpeg
4c7b023d56e09a78a587d036db1b64bf7c493b3d
0
static int nvdec_vc1_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { VC1Context *v = avctx->priv_data; MpegEncContext *s = &v->s; NVDECContext *ctx = avctx->internal->hwaccel_priv_data; CUVIDPICPARAMS *pp = &ctx->pic_params; FrameDecodeData *fdd; NVDE...
3,469
FFmpeg
b12d21733975f9001eecb480fc28e5e4473b1327
0
static int frame_thread_init(AVCodecContext *avctx) { int thread_count = avctx->thread_count; AVCodec *codec = avctx->codec; AVCodecContext *src = avctx; FrameThreadContext *fctx; int i, err = 0; if (!thread_count) { int nb_cpus = get_logical_cpus(avctx); // use number...
3,470
qemu
c5a49c63fa26e8825ad101dfe86339ae4c216539
1
static inline void gen_ins(DisasContext *s, TCGMemOp ot) { if (s->base.tb->cflags & CF_USE_ICOUNT) { gen_io_start(); } gen_string_movl_A0_EDI(s); /* Note: we must do this dummy write first to be restartable in case of page fault. */ tcg_gen_movi_tl(cpu_T0, 0); gen_op_st_v...
3,473
qemu
a890643958f03aaa344290700093b280cb606c28
1
static void qht_bucket_reset__locked(struct qht_bucket *head) { struct qht_bucket *b = head; int i; seqlock_write_begin(&head->sequence); do { for (i = 0; i < QHT_BUCKET_ENTRIES; i++) { if (b->pointers[i] == NULL) { goto done; } b->...
3,474
FFmpeg
7bcd81299a83b28ee8266079646470dd3e02f2ef
1
static int read_seek(AVFormatContext *s, int stream_index, int64_t ts, int flags) { WtvContext *wtv = s->priv_data; AVIOContext *pb = wtv->pb; AVStream *st = s->streams[0]; int64_t ts_relative; int i; if ((flags & AVSEEK_FLAG_FRAME) || (flags & AVSEEK_FLAG_BYTE)) ...
3,475
FFmpeg
b58cfa616c169c90166938608e7135cdab5820e0
0
static void mov_parse_stsd_audio(MOVContext *c, AVIOContext *pb, AVStream *st, MOVStreamContext *sc) { int bits_per_sample, flags; uint16_t version = avio_rb16(pb); AVDictionaryEntry *compatible_brands = av_dict_get(c->fc->metadata, "compatible_brands", NULL, AV_DICT_MA...
3,478
qemu
b20909195745c34a819aed14ae996b60ab0f591f
1
iscsi_aio_ioctl_cb(struct iscsi_context *iscsi, int status, void *command_data, void *opaque) { IscsiAIOCB *acb = opaque; if (acb->canceled) { qemu_aio_release(acb); return; } acb->status = 0; if (status < 0) { error_report("Failed to ioctl(...
3,479
FFmpeg
973c3dba27d0b1a88c70f6661b6a90d2f2e50665
1
static int mpeg_decode_slice(MpegEncContext *s, int mb_y, const uint8_t **buf, int buf_size) { AVCodecContext *avctx = s->avctx; const int lowres = s->avctx->lowres; const int field_pic = s->picture_structure != PICT_FRAME; int ret; s->resync_mb_x = ...
3,480
FFmpeg
8364cb97193829dc3e14484c0aaadf59c0cafc8c
1
static int poll_filters(void) { AVFilterBufferRef *picref; AVFrame *filtered_frame = NULL; int i, ret, ret_all; unsigned nb_success, nb_eof; int64_t frame_pts; while (1) { /* Reap all buffers present in the buffer sinks */ for (i = 0; i < nb_output_streams; i++) { ...
3,481
qemu
449041d4db1f82f281fe097e832f07cd9ee1e864
1
static int parse_hex32(DeviceState *dev, Property *prop, const char *str) { uint32_t *ptr = qdev_get_prop_ptr(dev, prop); if (sscanf(str, "%" PRIx32, ptr) != 1) return -EINVAL; return 0; }
3,482
qemu
5ee5993001cf32addb86a92e2ae8cb090fbc1462
1
void helper_retry(CPUSPARCState *env) { trap_state *tsptr = cpu_tsptr(env); env->pc = tsptr->tpc; env->npc = tsptr->tnpc; cpu_put_ccr(env, tsptr->tstate >> 32); env->asi = (tsptr->tstate >> 24) & 0xff; cpu_change_pstate(env, (tsptr->tstate >> 8) & 0xf3f); cpu_put_cwp64(env, tsptr->...
3,483
FFmpeg
6086731299e4d249ddc459e406b2ebb0cb71f6f4
1
static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) { int superblock_starts[3] = { 0, s->u_superblock_start, s->v_superblock_start }; int bit = 0; int current_superblock = 0; int current_run = 0; int num_partial_superblocks = 0; int i, j; int current_fragment; ...
3,485
FFmpeg
f95c81ce104554b6860d94724a681a1bac0c4fbd
1
static av_cold int mov_text_encode_init(AVCodecContext *avctx) { /* * For now, we'll use a fixed default style. When we add styling * support, this will be generated from the ASS style. */ static const uint8_t text_sample_entry[] = { 0x00, 0x00, 0x00, 0x00, // uint32_t displayFlags...
3,486
qemu
a0d1cbdacff5df4ded16b753b38fdd9da6092968
1
static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size) { struct xlx_ethlite *s = qemu_get_nic_opaque(nc); unsigned int rxbase = s->rxbuf * (0x800 / 4); /* DA filter. */ if (!(buf[0] & 0x80) && memcmp(&s->conf.macaddr.a[0], buf, 6)) return size; if (s->regs[rxb...
3,487
qemu
faadf50e2962dd54175647a80bd6fc4319c91973
1
static void init_proc_970MP (CPUPPCState *env) { gen_spr_ne_601(env); gen_spr_7xx(env); /* Time base */ gen_tbl(env); /* Hardware implementation registers */ /* XXX : not implemented */ spr_register(env, SPR_HID0, "HID0", SPR_NOACCESS, SPR_NOACCESS, ...
3,488
FFmpeg
77a644e6fa4aaeb2c26cfaa0e8ec3b19829b8d88
1
void ff_h264_direct_ref_list_init(const H264Context *const h, H264SliceContext *sl) { H264Ref *const ref1 = &sl->ref_list[1][0]; H264Picture *const cur = h->cur_pic_ptr; int list, j, field; int sidx = (h->picture_structure & 1) ^ 1; int ref1sidx = (ref1->reference & 1) ^ 1; for...
3,489
qemu
ebb718a5c7240f6ffb308e0d0b67a92c3b63b91c
1
static coroutine_fn int qcow2_co_write_zeroes(BlockDriverState *bs, int64_t sector_num, int nb_sectors, BdrvRequestFlags flags) { int ret; BDRVQcow2State *s = bs->opaque; int head = sector_num % s->cluster_sectors; int tail = (sector_num + nb_sectors) % s->cluster_sectors; trace_qcow2...
3,490
FFmpeg
5e3572893d7f17679c5e051c511bf42f3da77b00
1
static int read_packet(AVFormatContext *s1, AVPacket *pkt) { VideoDemuxData *s = s1->priv_data; char filename[1024]; int i; int size[3]={0}, ret[3]={0}; AVIOContext *f[3]; AVCodecContext *codec= s1->streams[0]->codec; if (!s->is_pipe) { /* loop over input */ if (s...
3,491
FFmpeg
e53c9065ca08a9153ecc73a6a8940bcc6d667e58
0
static void fill_float_array(AVLFG *lfg, float *a, int len) { int i; double bmg[2], stddev = 10.0, mean = 0.0; for (i = 0; i < len; i += 2) { av_bmg_get(lfg, bmg); a[i] = bmg[0] * stddev + mean; a[i + 1] = bmg[1] * stddev + mean; } }
3,492
FFmpeg
1d16a1cf99488f16492b1bb48e023f4da8377e07
0
static void ff_h264_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride) { int i; DECLARE_ALIGNED(8, int16_t, b2)[64]; block[0] += 32; for(i=0; i<2; i++){ DECLARE_ALIGNED(8, uint64_t, tmp); h264_idct8_1d(block+4*i); __asm__ volatile( "movq %%mm7,...
3,493
qemu
297a3646c2947ee64a6d42ca264039732c6218e0
1
void visit_type_uint32(Visitor *v, uint32_t *obj, const char *name, Error **errp) { int64_t value; if (!error_is_set(errp)) { if (v->type_uint32) { v->type_uint32(v, obj, name, errp); } else { value = *obj; v->type_int(v, &value, name, errp); ...
3,495
FFmpeg
d7e9533aa06f4073a27812349b35ba5fede11ca1
1
static int RENAME(dct_quantize)(MpegEncContext *s, DCTELEM *block, int n, int qscale) { int i, level, last_non_zero_p1, q; const UINT16 *qmat; static __align8 INT16 temp_block[64]; int minLevel, maxLevel; if(s->avctx!=NULL && s->a...
3,496
FFmpeg
b51e7554e74cbf007a1cab83c7bed3ad9fa2793a
1
static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt) { MXFContext *mxf = s->priv_data; AVIOContext *pb = s->pb; AVStream *st = s->streams[pkt->stream_index]; MXFStreamContext *sc = st->priv_data; MXFIndexEntry ie = {0}; int err; if (!mxf->edit_unit_byte_count && !(mxf->ed...
3,497
qemu
868d585aced5457218b3443398d08594d9c3ba6d
1
static void set_up_watchdog (m48t59_t *NVRAM, uint8_t value) { uint64_t interval; /* in 1/16 seconds */ if (NVRAM->wd_timer != NULL) { qemu_del_timer(NVRAM->wd_timer); NVRAM->wd_timer = NULL; } NVRAM->buffer[0x1FF0] &= ~0x80; if (value != 0) { interval = (1 << (2 * (value & 0x03...
3,498
FFmpeg
01ecb7172b684f1c4b3e748f95c5a9a494ca36ec
1
static float get_band_cost_SQUAD_mips(struct AACEncContext *s, PutBitContext *pb, const float *in, const float *scaled, int size, int scale_idx, int cb, const float lambda, const float uplim, ...
3,500
qemu
ad0ebb91cd8b5fdc4a583b03645677771f420a46
1
static target_ulong h_register_logical_lan(CPUPPCState *env, sPAPREnvironment *spapr, target_ulong opcode, target_ulong *args) { target_ulong reg = args[0]; target_ulong buf_lis...
3,501
FFmpeg
771c86c13d7133035e53f7aeb14407ae5dca6453
1
av_cold void ff_psy_preprocess_end(struct FFPsyPreprocessContext *ctx) { int i; ff_iir_filter_free_coeffs(ctx->fcoeffs); if (ctx->fstate) for (i = 0; i < ctx->avctx->channels; i++) ff_iir_filter_free_state(ctx->fstate[i]); av_freep(&ctx->fstate); }
3,503
qemu
15c7733bb231090e5ebd6d10060dccdb98bb4941
1
static int bdrv_open_common(BlockDriverState *bs, const char *filename, int flags, BlockDriver *drv) { int ret, open_flags; assert(drv != NULL); bs->file = NULL; bs->total_sectors = 0; bs->is_temporary = 0; bs->encrypted = 0; bs->valid_key = 0; bs->open_flags = flags; ...
3,504
FFmpeg
28f9ab7029bd1a02f659995919f899f84ee7361b
0
void ff_vp3_idct_put_altivec(uint8_t *dst, int stride, DCTELEM block[64]) { vec_u8 t; IDCT_START // pixels are signed; so add 128*16 in addition to the normal 8 vec_s16 v2048 = vec_sl(vec_splat_s16(1), vec_splat_u16(11)); eight = vec_add(eight, v2048); IDCT_1D(NOP, NOP) TRANSPOSE...
3,505
FFmpeg
db592f3b03a21d5bd5237021c00af3ce0431fc60
0
static void lowpass16(WaveformContext *s, AVFrame *in, AVFrame *out, int component, int intensity, int offset, int column) { const int plane = s->desc->comp[component].plane; const int mirror = s->mirror; const int is_chroma = (component == 1 || component == 2); const int shi...
3,506
qemu
3b6eda2f57a5b7ed047077b6272c2b5a9e3531ca
0
static int qemu_dup_flags(int fd, int flags) { int ret; int serrno; int dup_flags; int setfl_flags; #ifdef F_DUPFD_CLOEXEC ret = fcntl(fd, F_DUPFD_CLOEXEC, 0); #else ret = dup(fd); if (ret != -1) { qemu_set_cloexec(ret); } #endif if (ret == -1) { goto...
3,507
qemu
9a29e18f7dfd5a0e80d1c60fc856ebba18ddb738
0
void bdrv_query_image_info(BlockDriverState *bs, ImageInfo **p_info, Error **errp) { int64_t size; const char *backing_filename; BlockDriverInfo bdi; int ret; Error *err = NULL; ImageInfo *info; size = bdrv_getlength(bs); ...
3,508
qemu
5fb6c7a8b26eab1a22207d24b4784bd2b39ab54b
0
static int vnc_set_x509_credential(VncDisplay *vs, const char *certdir, const char *filename, char **cred, int ignoreMissing) { struct stat sb; if (*cred) { qemu_free(*cred); *cred = NULL; } *cred = qemu_malloc(strlen(certdir) + strlen(filename) + 2); ...
3,509
qemu
a8170e5e97ad17ca169c64ba87ae2f53850dab4c
0
void stw_le_phys(target_phys_addr_t addr, uint32_t val) { stw_phys_internal(addr, val, DEVICE_LITTLE_ENDIAN); }
3,510
qemu
6acbe4c6f18e7de00481ff30574262b58526de45
0
const char *qdev_fw_name(DeviceState *dev) { DeviceClass *dc = DEVICE_GET_CLASS(dev); if (dc->fw_name) { return dc->fw_name; } else if (dc->alias) { return dc->alias; } return object_get_typename(OBJECT(dev)); }
3,511
qemu
de9e9d9f17a36ff76c1a02a5348835e5e0a081b0
0
static inline void gen_op_eval_fblg(TCGv dst, TCGv src, unsigned int fcc_offset) { gen_mov_reg_FCC0(dst, src, fcc_offset); gen_mov_reg_FCC1(cpu_tmp0, src, fcc_offset); tcg_gen_xor_tl(dst, dst, cpu_tmp0); }
3,512
qemu
b854bc196f5c4b4e3299c0b0ee63cf828ece9e77
0
uint32_t omap_badwidth_read32(void *opaque, target_phys_addr_t addr) { OMAP_32B_REG(addr); return 0; }
3,514
qemu
bd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884
0
SocketAddressLegacy *socket_parse(const char *str, Error **errp) { SocketAddressLegacy *addr; addr = g_new0(SocketAddressLegacy, 1); if (strstart(str, "unix:", NULL)) { if (str[5] == '\0') { error_setg(errp, "invalid Unix socket address"); goto fail; } else ...
3,515
qemu
ba14414174b72fa231997243a9650feaa520d054
0
static void do_info_cpus(Monitor *mon, QObject **ret_data) { CPUState *env; QList *cpu_list; cpu_list = qlist_new(); /* just to set the default cpu if not already done */ mon_get_cpu(); for(env = first_cpu; env != NULL; env = env->next_cpu) { QDict *cpu; QObject *o...
3,516
qemu
ad196a9d0c14f681f010bb4b979030ec125ba976
0
void slirp_init(int restricted, const char *special_ip) { // debug_init("/tmp/slirp.log", DEBUG_DEFAULT); #ifdef _WIN32 { WSADATA Data; WSAStartup(MAKEWORD(2,0), &Data); atexit(slirp_cleanup); } #endif link_up = 1; slirp_restrict = restricted; if_init(); ...
3,518
qemu
bd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884
0
static void test_io_channel(bool async, SocketAddressLegacy *listen_addr, SocketAddressLegacy *connect_addr, bool passFD) { QIOChannel *src, *dst; QIOChannelTest *test; if (async) { test_io_channel_setup_asyn...
3,519
qemu
364031f17932814484657e5551ba12957d993d7e
0
static int v9fs_synth_name_to_path(FsContext *ctx, V9fsPath *dir_path, const char *name, V9fsPath *target) { V9fsSynthNode *node; V9fsSynthNode *dir_node; /* "." and ".." are not allowed */ if (!strcmp(name, ".") || !strcmp(name, "..")) { errno = EINVA...
3,520
qemu
621ff94d5074d88253a5818c6b9c4db718fbfc65
0
static void virtio_ccw_9p_realize(VirtioCcwDevice *ccw_dev, Error **errp) { V9fsCCWState *dev = VIRTIO_9P_CCW(ccw_dev); DeviceState *vdev = DEVICE(&dev->vdev); Error *err = NULL; qdev_set_parent_bus(vdev, BUS(&ccw_dev->bus)); object_property_set_bool(OBJECT(vdev), true, "realized", &err); ...
3,522
qemu
758e8e38eb582e3dc87fd55a1d234c25108a7b7f
0
static V9fsFidState *lookup_fid(V9fsState *s, int32_t fid) { V9fsFidState *f; for (f = s->fid_list; f; f = f->next) { if (f->fid == fid) { v9fs_do_setuid(s, f->uid); return f; } } return NULL; }
3,523
qemu
a89f364ae8740dfc31b321eed9ee454e996dc3c1
0
static int hda_audio_post_load(void *opaque, int version) { HDAAudioState *a = opaque; HDAAudioStream *st; int i; dprint(a, 1, "%s\n", __FUNCTION__); if (version == 1) { /* assume running_compat[] is for output streams */ for (i = 0; i < ARRAY_SIZE(a->running_compat); i++) ...
3,524
FFmpeg
6fcd4f3c7255014eeb883385d32abc7442426314
0
static av_cold int dfa_decode_init(AVCodecContext *avctx) { DfaContext *s = avctx->priv_data; int ret; avctx->pix_fmt = PIX_FMT_PAL8; if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0) return ret; s->frame_buf = av_mallocz(avctx->width * avctx->height + ...
3,525
FFmpeg
9e494ab77cdf519eb5de8056c00469c78bf8a7e8
0
static int mpeg_field_start(MpegEncContext *s){ AVCodecContext *avctx= s->avctx; Mpeg1Context *s1 = (Mpeg1Context*)s; /* start frame decoding */ if(s->first_field || s->picture_structure==PICT_FRAME){ if(MPV_frame_start(s, avctx) < 0) return -1; ff_er_frame_start(s...
3,527
qemu
a8f2e5c8fffbaf7fbd4f0efc8efbeebade78008f
1
static void virtio_scsi_handle_cmd(VirtIODevice *vdev, VirtQueue *vq) { /* use non-QOM casts in the data path */ VirtIOSCSI *s = (VirtIOSCSI *)vdev; VirtIOSCSIReq *req, *next; QTAILQ_HEAD(, VirtIOSCSIReq) reqs = QTAILQ_HEAD_INITIALIZER(reqs); if (s->ctx && !s->dataplane_started) { v...
3,528
FFmpeg
c3ab0004ae4dffc32494ae84dd15cfaa909a7884
1
static inline void RENAME(bgr24ToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused) { #if COMPILE_TEMPLATE_MMX RENAME(bgr24ToUV_mmx)(dstU, dstV, src1, width, PIX_FMT_BGR24); #else int i; for (i=0; i<width; i++) { int b= src1[3*i + 0]; ...
3,529
qemu
4ae3c0e27fff7e41fd75fc63a35703bc64785863
1
static QEMUFile *open_test_file(bool write) { int fd = dup(temp_fd); QIOChannel *ioc; lseek(fd, 0, SEEK_SET); if (write) { g_assert_cmpint(ftruncate(fd, 0), ==, 0); } ioc = QIO_CHANNEL(qio_channel_file_new_fd(fd)); if (write) { return qemu_fopen_channel_output(ioc);...
3,531
FFmpeg
f44d50a94c120135faeba6b4a1e5551b4397810f
1
static void hScale16_c(SwsContext *c, int16_t *_dst, int dstW, const uint8_t *_src, const int16_t *filter, const int16_t *filterPos, int filterSize) { int i; int32_t *dst = (int32_t *) _dst; const uint16_t *src = (const uint16_t *) _src; int bits = av...
3,532
qemu
cc64b1a1940dc2e041c5b06b003d9acf64c22372
1
static uint64_t kvmppc_read_int_cpu_dt(const char *propname) { char buf[PATH_MAX]; union { uint32_t v32; uint64_t v64; } u; FILE *f; int len; if (kvmppc_find_cpu_dt(buf, sizeof(buf))) { return -1; } strncat(buf, "/", sizeof(buf) - strlen(buf)); ...
3,533
qemu
187337f8b0ec0813dd3876d1efe37d415fb81c2e
1
void icp_pit_init(uint32_t base, qemu_irq *pic, int irq) { int iomemtype; icp_pit_state *s; s = (icp_pit_state *)qemu_mallocz(sizeof(icp_pit_state)); s->base = base; /* Timer 0 runs at the system clock speed (40MHz). */ s->timer[0] = arm_timer_init(40000000, pic[irq]); /* The othe...
3,534
FFmpeg
dd44d9e316c17f473eff9f4a5a94ad0d7adb157e
1
static int adts_write_header(AVFormatContext *s) { ADTSContext *adts = s->priv_data; AVCodecContext *avc = s->streams[0]->codec; if(avc->extradata_size > 0) decode_extradata(adts, avc->extradata, avc->extradata_size); return 0; }
3,535
qemu
dd793a74882477ca38d49e191110c17dfee51dcc
1
start_xmit(E1000State *s) { PCIDevice *d = PCI_DEVICE(s); dma_addr_t base; struct e1000_tx_desc desc; uint32_t tdh_start = s->mac_reg[TDH], cause = E1000_ICS_TXQE; if (!(s->mac_reg[TCTL] & E1000_TCTL_EN)) { DBGOUT(TX, "tx disabled\n"); return; } while (s->mac_re...
3,536
FFmpeg
f8323744a0783d5937232a95cd1cc98f6b70a810
1
static void vector_fmul_window_mips(float *dst, const float *src0, const float *src1, const float *win, int len) { float * dst_j, *win_j, *src0_i, *src1_j, *dst_i, *win_i; float temp, temp1, temp2, temp3; float s0, s01, s1, s11; float wi, wi1, wi2, wi3; flo...
3,537
qemu
c92458538f501eda585b4b774c50644aed391a8a
1
PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus, qemu_irq *p_rtc_irq, AlphaCPU *cpus[4], pci_map_irq_fn sys_map_irq) { const uint64_t MB = 1024 * 1024; const uint64_t GB = 1024 * MB; MemoryRegion *addr_space = get_system_memory(); MemoryRegion ...
3,538
FFmpeg
7e2eb4bacd70541702bd086ab2a39cb7653d314e
1
static int decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src){ H264Context *h= dst->priv_data, *h1= src->priv_data; MpegEncContext * const s = &h->s, * const s1 = &h1->s; int inited = s->context_initialized, err; int i; if(dst == src || !s1->context_initialized) retu...
3,539
FFmpeg
fd58678b86023ea98665f06756bf03f91e56be54
1
static int device_open(AVFormatContext *ctx) { struct v4l2_capability cap; int fd; #if CONFIG_LIBV4L2 int fd_libv4l; #endif int res, err; int flags = O_RDWR; if (ctx->flags & AVFMT_FLAG_NONBLOCK) { flags |= O_NONBLOCK; } fd = v4l2_open(ctx->filename, flags, 0); ...
3,541
qemu
6b4495401bdf442457b713b7e3994b465c55af35
1
int pcie_cap_init(PCIDevice *dev, uint8_t offset, uint8_t type, uint8_t port) { /* PCIe cap v2 init */ int pos; uint8_t *exp_cap; assert(pci_is_express(dev)); pos = pci_add_capability(dev, PCI_CAP_ID_EXP, offset, PCI_EXP_VER2_SIZEOF); if (pos < 0) { return pos; } de...
3,542
FFmpeg
436f866f92a9483717e376866783346bf8a00e58
1
void ff_svq3_add_idct_c(uint8_t *dst, DCTELEM *block, int stride, int qp, int dc) { const int qmul = svq3_dequant_coeff[qp]; int i; uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; if (dc) { dc = 13*13*((dc == 1) ? 1538*block[0] : ((qmul*(block[0] >> 3)) / 2)); ...
3,543
qemu
8e84865e54cb66fd7b57bb18c312ad3d56b6e276
1
void process_incoming_migration(QEMUFile *f) { if (qemu_loadvm_state(f) < 0) { fprintf(stderr, "load of migration failed\n"); exit(0); } qemu_announce_self(); DPRINTF("successfully loaded vm state\n"); if (autostart) vm_start(); }
3,544
FFmpeg
0ecca7a49f8e254c12a3a1de048d738bfbb614c6
1
void *av_realloc(void *ptr, unsigned int size) { #ifdef MEMALIGN_HACK //FIXME this isnt aligned correctly though it probably isnt needed int diff; if(!ptr) return av_malloc(size); diff= ((char*)ptr)[-1]; return realloc(ptr - diff, size + diff) + diff; #else return realloc(ptr, size); #endif }
3,545
qemu
faadf50e2962dd54175647a80bd6fc4319c91973
1
static void init_excp_620 (CPUPPCState *env) { #if !defined(CONFIG_USER_ONLY) env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100; env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200; env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300; env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400; ...
3,547