project
stringclasses
2 values
commit_id
stringlengths
40
40
target
int64
0
1
func
stringlengths
26
142k
idx
int64
0
27.3k
qemu
721671ade77f4046b45893fbb7864ca84b9504cd
0
bool aio_dispatch(AioContext *ctx) { bool progress; progress = aio_bh_poll(ctx); progress |= aio_dispatch_handlers(ctx, INVALID_HANDLE_VALUE); progress |= timerlistgroup_run_timers(&ctx->tlg); return progress; }
19,374
qemu
01d2d584c9e1d051892de115ab20787da62baf6a
0
static void sm501_draw_crt(SM501State *s) { DisplaySurface *surface = qemu_console_surface(s->con); int y, c_x = 0, c_y = 0; uint8_t *hwc_src = NULL, *src = s->local_mem; int width = get_width(s, 1); int height = get_height(s, 1); int src_bpp = get_bpp(s, 1); int dst_bpp = surface_by...
19,375
qemu
e3ff9f0e57472e6411dc446b41789cbd9e2cf887
0
static void test_io(void) { #ifndef _WIN32 /* socketpair(PF_UNIX) which does not exist on windows */ int sv[2]; int r; unsigned i, j, k, s, t; fd_set fds; unsigned niov; struct iovec *iov, *siov; unsigned char *buf; size_t sz; iov_random(&iov, &niov); sz = iov_si...
19,376
qemu
5104a1f65088285ddf870aa641b9061064e8757d
0
static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion, void *opaque) { GtkDisplayState *s = opaque; int dx, dy; int x, y; x = motion->x / s->scale_x; y = motion->y / s->scale_y; if (kbd_mouse_is_absolute()) { dx = x * 0x7FF...
19,377
qemu
e75ccf2c033fb0503d6cb7ddd0fd1dfa0aa4fc16
0
static int virtio_9p_init_pci(PCIDevice *pci_dev) { VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev); VirtIODevice *vdev; vdev = virtio_9p_init(&pci_dev->qdev, &proxy->fsconf); vdev->nvectors = proxy->nvectors; virtio_init_pci(proxy, vdev, PCI_VENDOR_I...
19,378
qemu
1f3aba377d2a531453f018c70de2580a142c74c9
0
void pc_guest_info_init(PCMachineState *pcms) { int i, j; pcms->apic_xrupt_override = kvm_allows_irq0_override(); pcms->numa_nodes = nb_numa_nodes; pcms->node_mem = g_malloc0(pcms->numa_nodes * sizeof *pcms->node_mem); for (i = 0; i < nb_numa_nodes; i++) ...
19,379
qemu
19d2b5e6ff7202c2bf45c547efa85ae6c2d76bbd
0
void DMA_schedule(int nchan) {}
19,381
FFmpeg
c34df422628e6b7b657faee241fe7bb2629e0f57
0
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet) { SgiContext *s = avctx->priv_data; const AVFrame * const p = frame; PutByteContext pbc; uint8_t *in_buf, *encode_buf; int x, y, z, length, tablesize, ret; unsigne...
19,382
qemu
a8170e5e97ad17ca169c64ba87ae2f53850dab4c
0
static uint64_t sysbus_esp_mem_read(void *opaque, target_phys_addr_t addr, unsigned int size) { SysBusESPState *sysbus = opaque; uint32_t saddr; saddr = addr >> sysbus->it_shift; return esp_reg_read(&sysbus->esp, saddr); }
19,383
qemu
079d0b7f1eedcc634c371fe05b617fdc55c8b762
0
static int usb_bt_handle_data(USBDevice *dev, USBPacket *p) { struct USBBtState *s = (struct USBBtState *) dev->opaque; int ret = 0; if (!s->config) goto fail; switch (p->pid) { case USB_TOKEN_IN: switch (p->devep & 0xf) { case USB_EVT_EP: ret = usb_...
19,384
qemu
8f90b5e91df59fde0dfecc6738ff39f3edf14be5
0
void bdrv_io_unplugged_begin(BlockDriverState *bs) { BdrvChild *child; if (bs->io_plug_disabled++ == 0 && bs->io_plugged > 0) { BlockDriver *drv = bs->drv; if (drv && drv->bdrv_io_unplug) { drv->bdrv_io_unplug(bs); } } QLIST_FOREACH(child, &bs->children, ...
19,385
qemu
ebd8ea82441020f2781928b17f37ed9a0d2e4250
0
static void acpi_get_pm_info(AcpiPmInfo *pm) { Object *piix = piix4_pm_find(); Object *lpc = ich9_lpc_find(); Object *obj = NULL; QObject *o; pm->cpu_hp_io_base = 0; pm->pcihp_io_base = 0; pm->pcihp_io_len = 0; if (piix) { obj = piix; pm->cpu_hp_io_base = PII...
19,386
qemu
a8170e5e97ad17ca169c64ba87ae2f53850dab4c
0
static void icp_pit_write(void *opaque, target_phys_addr_t offset, uint64_t value, unsigned size) { icp_pit_state *s = (icp_pit_state *)opaque; int n; n = offset >> 8; if (n > 2) { hw_error("%s: Bad timer %d\n", __func__, n); } arm_timer_write(s->ti...
19,387
qemu
2b75f848238651ef1bb407f66fa38d68775782bf
0
static ram_addr_t get_current_ram_size(void) { GSList *list = NULL, *item; ram_addr_t size = ram_size; pc_dimm_build_list(qdev_get_machine(), &list); for (item = list; item; item = g_slist_next(item)) { Object *obj = OBJECT(item->data); size += object_property_get_int(obj, PC_DI...
19,388
qemu
9dbbc748d671c70599101836cd1c2719d92f3017
0
void gen_intermediate_code_internal_a64(ARMCPU *cpu, TranslationBlock *tb, bool search_pc) { CPUState *cs = CPU(cpu); CPUARMState *env = &cpu->env; DisasContext dc1, *dc = &dc1; CPUBreakpoint *bp; int j, lj; ...
19,390
qemu
5e755519ac9d867f7da13f58a9d0c262db82e14c
0
static void gen_farith (DisasContext *ctx, uint32_t op1, int ft, int fs, int fd, int cc) { const char *opn = "farith"; const char *condnames[] = { "c.f", "c.un", "c.eq", "c.ueq", "c.olt", "c.ult", ...
19,391
qemu
fdfab37dfeffefbd4533b4158055c9b82d7c3e69
0
static int count_contiguous_clusters_unallocated(int nb_clusters, uint64_t *l2_table, QCow2ClusterType wanted_type) { int i; assert(wanted_type == QCOW2_CLUSTER_ZERO || wanted_type == QCOW2_CLUST...
19,392
FFmpeg
c23acbaed40101c677dfcfbbfe0d2c230a8e8f44
1
static void rv34_idct_dc_add_c(uint8_t *dst, ptrdiff_t stride, int dc) { const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; int i, j; cm += (13*13*dc + 0x200) >> 10; for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) dst[j] = cm[ dst[j] ]; dst += stride; } ...
19,393
qemu
f8ed85ac992c48814d916d5df4d44f9a971c5de4
1
qemu_irq *armv7m_init(MemoryRegion *system_memory, int mem_size, int num_irq, const char *kernel_filename, const char *cpu_model) { ARMCPU *cpu; CPUARMState *env; DeviceState *nvic; qemu_irq *pic = g_new(qemu_irq, num_irq); int image_size; uint64_t entry; uint6...
19,394
qemu
c8057f951d64de93bfd01569c0a725baa9f94372
1
int qemu_show_nic_models(const char *arg, const char *const *models) { int i; if (!arg || strcmp(arg, "?")) return 0; fprintf(stderr, "qemu: Supported NIC models: "); for (i = 0 ; models[i]; i++) fprintf(stderr, "%s%c", models[i], models[i+1] ? ',' : '\n'); return 1; }
19,395
FFmpeg
28bf81c90d36a55cf76e2be913c5215ebebf61f2
1
void SwScale_Init(){ // generating tables: int i; for(i=0; i<768; i++){ int c= MIN(MAX(i-256, 0), 255); clip_table[i]=c; yuvtab_2568[c]= clip_yuvtab_2568[i]=(0x2568*(c-16))+(256<<13); yuvtab_3343[c]= clip_yuvtab_3343[i]=0x3343*(c-128); yuvtab_0c92[c]= clip_yuvtab_0c92[i]=-0x0c92*(c-128); yuvt...
19,396
qemu
c56e3b86701501364a4756201b6a9db9454463ab
1
void openrisc_cpu_do_interrupt(CPUState *cs) { #ifndef CONFIG_USER_ONLY OpenRISCCPU *cpu = OPENRISC_CPU(cs); CPUOpenRISCState *env = &cpu->env; env->epcr = env->pc; if (env->flags & D_FLAG) { env->flags &= ~D_FLAG; env->sr |= SR_DSX; env->epcr -= 4; if (cs->exc...
19,397
qemu
2836284db603775af557e969d5a800efb0190324
1
static char *qemu_rbd_array_opts(QDict *options, const char *prefix, int type, Error **errp) { int num_entries; QemuOpts *opts = NULL; QDict *sub_options; const char *host; const char *port; char *str; char *rados_str = NULL; Error *local_err = ...
19,398
FFmpeg
1ba08c94f5bb4d1c3c2d3651b5e01edb4ce172e2
1
static float *put_vector(vorbis_enc_codebook *book, PutBitContext *pb, float *num) { int i, entry = -1; float distance = FLT_MAX; assert(book->dimentions); for (i = 0; i < book->nentries; i++) { float * vec = book->dimentions + i * book->ndimentions, d = book->pow...
19,399
FFmpeg
28343139330f557e00293933a4697c7d0fc19c56
1
static int mov_write_single_packet(AVFormatContext *s, AVPacket *pkt) { MOVMuxContext *mov = s->priv_data; MOVTrack *trk = &mov->tracks[pkt->stream_index]; AVCodecParameters *par = trk->par; int64_t frag_duration = 0; int size = pkt->size; if (mov->flags & FF_MOV_FLAG_FRA...
19,400
qemu
bae2c270906475093e3d5f4c3103dbe67bf82009
1
int cpu_exec(CPUArchState *env) { CPUState *cpu = ENV_GET_CPU(env); #if !(defined(CONFIG_USER_ONLY) && \ (defined(TARGET_M68K) || defined(TARGET_PPC) || defined(TARGET_S390X))) CPUClass *cc = CPU_GET_CLASS(cpu); #endif #ifdef TARGET_I386 X86CPU *x86_cpu = X86_CPU(cpu); #endif int ret, in...
19,401
qemu
feeee5aca765606818e00f5a19d19f141f4ae365
1
static int bdrv_can_snapshot(BlockDriverState *bs) { return (bs && !bdrv_is_removable(bs) && !bdrv_is_read_only(bs)); }
19,402
FFmpeg
b0cd14fb1dab4b044f7fe6b53ac635409849de77
0
int hw_device_init_from_string(const char *arg, HWDevice **dev_out) { // "type=name:device,key=value,key2=value2" // "type:device,key=value,key2=value2" // -> av_hwdevice_ctx_create() // "type=name@name" // "type@name" // -> av_hwdevice_ctx_create_derived() AVDictionary *options = ...
19,404
FFmpeg
5c2fb561d94fc51d76ab21d6f7cc5b6cc3aa599c
0
static void vaapi_encode_h264_write_pps(PutBitContext *pbc, VAAPIEncodeContext *ctx) { VAEncPictureParameterBufferH264 *vpic = ctx->codec_picture_params; VAAPIEncodeH264Context *priv = ctx->priv_data; VAAPIEncodeH264MiscSequenceParams *mseq = &priv->...
19,405
FFmpeg
94d4237a7a294ce80e1e577b38e9c93e8882aff9
0
static av_always_inline int coeff_abs_level_remaining_decode(HEVCContext *s, int rc_rice_param) { int prefix = 0; int suffix = 0; int last_coeff_abs_level_remaining; int i; while (prefix < CABAC_MAX_BIN && get_cabac_bypass(&s->HEVClc->cc)) prefix++; if (prefix == CABAC_MAX_BIN)...
19,407
qemu
aec4b054ea36c53c8b887da99f20010133b84378
1
static void float_number(void) { int i; struct { const char *encoded; double decoded; int skip; } test_cases[] = { { "32.43", 32.43 }, { "0.222", 0.222 }, { "-32.12313", -32.12313 }, { "-32.20e-10", -32.20e-10, .skip = 1 }, { }, ...
19,409
FFmpeg
e1a43a414677258b1e01d3f9a8f40bfc74be4223
0
AVFilterContext *avfilter_graph_get_filter(AVFilterGraph *graph, char *name) { int i; if(!name) return NULL; for(i = 0; i < graph->filter_count; i ++) if(graph->filters[i]->name && !strcmp(name, graph->filters[i]->name)) return graph->filters[i]; return NULL; }...
19,410
qemu
73698c30caaf16e990b8b2e6e7bc64928947e65e
1
static int mirror_do_read(MirrorBlockJob *s, int64_t sector_num, int nb_sectors) { BlockBackend *source = s->common.blk; int sectors_per_chunk, nb_chunks; int ret = nb_sectors; MirrorOp *op; sectors_per_chunk = s->granularity >> BDRV_SECTOR_BITS; /* We can o...
19,412
FFmpeg
758ec111538ccd487686e8677aa754ee4d82beaa
1
static void pred_temp_direct_motion(H264Context * const h, int *mb_type){ MpegEncContext * const s = &h->s; int b8_stride = 2; int b4_stride = h->b_stride; int mb_xy = h->mb_xy, mb_y = s->mb_y; int mb_type_col[2]; const int16_t (*l1mv0)[2], (*l1mv1)[2]; const int8_t *l1ref0, *l1ref1; ...
19,413
qemu
21ce148c7ec71ee32834061355a5ecfd1a11f90f
1
static inline int cris_abs(int n) { int r; asm ("abs\t%1, %0\n" : "=r" (r) : "r" (n)); return r; }
19,415
qemu
3251bdcf1c67427d964517053c3d185b46e618e8
1
static int bmdma_prepare_buf(IDEDMA *dma, int is_write) { BMDMAState *bm = DO_UPCAST(BMDMAState, dma, dma); IDEState *s = bmdma_active_if(bm); PCIDevice *pci_dev = PCI_DEVICE(bm->pci_dev); struct { uint32_t addr; uint32_t size; } prd; int l, len; pci_dma_sglist_in...
19,416
FFmpeg
ee9151b616fa7fa5e9b3258ecafd00c9f784baaa
1
av_cold int ff_mss12_decode_init(MSS12Context *c, int version, SliceContext* sc1, SliceContext *sc2) { AVCodecContext *avctx = c->avctx; int i; if (avctx->extradata_size < 52 + 256 * 3) { av_log(avctx, AV_LOG_ERROR, "Insufficient extradata size %d\n", ...
19,417
FFmpeg
71fe97a60ad7dd6fe15238ca0eee1ed3121b5f80
1
static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code) { AVFormatContext *s = nut->avf; AVIOContext *bc = s->pb; int size, stream_id, discard; int64_t pts, last_IP_pts; StreamContext *stc; uint8_t header_idx; size = decode_frame_header(nut, &pts, &stream_id, &he...
19,418
FFmpeg
cbb5da57cdaf547e47253beef31ddf38d181252a
1
static int rm_assemble_video_frame(AVFormatContext *s, ByteIOContext *pb, RMDemuxContext *rm, RMStream *vst, AVPacket *pkt, int len, int *pseq) { int hdr, seq, pic_num, len2, pos; int type; hdr = get_byte(pb); len--; type = h...
19,419
FFmpeg
0a1cf6621067c4a85b519c8cad5c345c29017f89
1
static int queue_picture(VideoState *is, AVFrame *src_frame, double pts1, int64_t pos) { VideoPicture *vp; double frame_delay, pts = pts1; /* compute the exact PTS for the picture if it is omitted in the stream * pts1 is the dts of the pkt / pts of the frame */ if (pts != 0) { /* u...
19,420
qemu
665f119fbad97c05c2603673ac6b2dcbf0d0e9e1
1
static int assigned_device_pci_cap_init(PCIDevice *pci_dev) { AssignedDevice *dev = DO_UPCAST(AssignedDevice, dev, pci_dev); PCIRegion *pci_region = dev->real_device.regions; int ret, pos; /* Clear initial capabilities pointer and status copied from hw */ pci_set_byte(pci_dev->config + PCI_C...
19,421
qemu
c0f4af171999eda4e49de5169906ce98246457f0
1
static void xscale_cpar_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { value &= 0x3fff; if (env->cp15.c15_cpar != value) { /* Changes cp0 to cp13 behavior, so needs a TB flush. */ tb_flush(env); env->cp15.c15_cpar = value; } ...
19,422
FFmpeg
79a54f30c8ba02cbf2b02c650120246b260977ec
1
static int compensate_volume(AVFilterContext *ctx) { struct SOFAlizerContext *s = ctx->priv; float compensate; float energy = 0; float *ir; int m; if (s->sofa.ncid) { /* find IR at front center position in the SOFA file (IR closest to 0°,0°,1m) */ struct NCSofa *sofa =...
19,424
qemu
07e95cd529af345fdeea230913f68eff5b925bb6
1
static char *qio_channel_websock_handshake_entry(const char *handshake, size_t handshake_len, const char *name) { char *begin, *end, *ret = NULL; char *line = g_strdup_printf("%s%s: ", ...
19,425
qemu
dbb74759fae6f521709e16e19cbb7d6fb2307700
1
static void machvirt_init(MachineState *machine) { VirtMachineState *vms = VIRT_MACHINE(machine); VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(machine); qemu_irq pic[NUM_IRQS]; MemoryRegion *sysmem = get_system_memory(); MemoryRegion *secure_sysmem = NULL; int n, virt_max_cpus; Mem...
19,426
qemu
ad27390c85c50df402c7ec0d3864fc43e6559fb3
1
static int check_refcounts_l2(BlockDriverState *bs, BdrvCheckResult *res, uint16_t *refcount_table, int64_t refcount_table_size, int64_t l2_offset, int flags) { BDRVQcowState *s = bs->opaque; uint64_t *l2_table, l2_entry; uint64_t next_contiguous_offset = 0; int i, l2_size, nb_csectors; ...
19,427
FFmpeg
6899e6e56065d9365963e02690dc9e2ce7866050
1
static int get_delayed_pic(DiracContext *s, AVFrame *picture, int *got_frame) { DiracFrame *out = s->delay_frames[0]; int i, out_idx = 0; int ret; /* find frame with lowest picture number */ for (i = 1; s->delay_frames[i]; i++) if (s->delay_frames[i]->avframe->display_picture_numbe...
19,428
FFmpeg
5ef19590802f000299e418143fc2301e3f43affe
1
static void do_subtitle_out(AVFormatContext *s, OutputStream *ost, InputStream *ist, AVSubtitle *sub) { int subtitle_out_max_size = 1024 * 1024; int subtitle_out_size, nb, i; AVCodecContext *enc; AVPacket pkt; ...
19,429
qemu
feeee5aca765606818e00f5a19d19f141f4ae365
1
static int bdrv_has_snapshot(BlockDriverState *bs) { return (bs && !bdrv_is_removable(bs) && !bdrv_is_read_only(bs)); }
19,430
qemu
3604a76fea6ff37738d4a8f596be38407be74a83
1
static void dec_ill(DisasContext *dc) { cpu_abort(dc->env, "unknown opcode 0x%02x\n", dc->opcode); }
19,432
qemu
5839e53bbc0fec56021d758aab7610df421ed8c8
1
static int vhdx_create_new_headers(BlockDriverState *bs, uint64_t image_size, uint32_t log_size) { int ret = 0; VHDXHeader *hdr = NULL; hdr = g_malloc0(sizeof(VHDXHeader)); hdr->signature = VHDX_HEADER_SIGNATURE; hdr->sequence_number = g_random_int...
19,433
FFmpeg
515b69f8f8e9a24cfaee95d8c1f63f265d8582fe
0
void checkasm_check_h264qpel(void) { LOCAL_ALIGNED_16(uint8_t, buf0, [BUF_SIZE]); LOCAL_ALIGNED_16(uint8_t, buf1, [BUF_SIZE]); LOCAL_ALIGNED_16(uint8_t, dst0, [BUF_SIZE]); LOCAL_ALIGNED_16(uint8_t, dst1, [BUF_SIZE]); H264QpelContext h; int op, bit_depth, i, j; for (op = 0; op < 2; ...
19,436
FFmpeg
4707cb07e1ceb0d1a518eda08fbf0d4035ea7745
0
static int wma_decode_init(AVCodecContext * avctx) { WMADecodeContext *s = avctx->priv_data; int i, flags1, flags2; float *window; uint8_t *extradata; float bps1, high_freq, bps; int sample_rate1; int coef_vlc_table; s->sample_rate = avctx->sample_rate; s->nb_channels...
19,437
FFmpeg
4dbcdfa86d1405f7e5c0ec14a4be7d2fb5903d7b
0
const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len) { const AVOption *o = av_opt_find(obj, name, NULL, 0, 0); void *dst; uint8_t *bin; int len, i; if (!o || o->offset<=0) return NULL; if (o->type != FF_OPT_TYPE_STRING && (!buf ||...
19,438
FFmpeg
7f2fe444a39bca733d390b6608801c5f002bfd31
0
static void copy_context_before_encode(MpegEncContext *d, MpegEncContext *s, int type){ int i; memcpy(d->last_mv, s->last_mv, 2*2*2*sizeof(int)); //FIXME is memcpy faster then a loop? /* mpeg1 */ d->mb_incr= s->mb_incr; for(i=0; i<3; i++) d->last_dc[i]= s->last_dc[i]; /*...
19,439
FFmpeg
0b42631641d998e509cde6fa344edc6ab5cb4ac8
0
static int get_bits(Jpeg2000DecoderContext *s, int n) { int res = 0; if (s->buf_end - s->buf < ((n - s->bit_index) >> 8)) return AVERROR(EINVAL); while (--n >= 0) { res <<= 1; if (s->bit_index == 0) { s->bit_index = 7 + (*s->buf != 0xff); s->buf++; ...
19,440
FFmpeg
e7843db3df0224cafcc1af9da103a3a7286ae2ba
1
static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]) { const enum PixelFormat srcFormat = c->srcFormat; const enum PixelFormat dstFormat = c->dstFormat; cons...
19,442
qemu
cec56a733dd2c3fa81dbedbecf03922258747f7d
1
static void gen_dmtc0(DisasContext *ctx, TCGv arg, int reg, int sel) { const char *rn = "invalid"; if (sel != 0) check_insn(ctx, ISA_MIPS64); if (ctx->tb->cflags & CF_USE_ICOUNT) { gen_io_start(); } switch (reg) { case 0: switch (sel) { case 0: ...
19,443
qemu
72902672dc2ed6281cdb205259c1d52ecf01f6b2
1
uint64_t HELPER(neon_sub_saturate_s64)(uint64_t src1, uint64_t src2) { uint64_t res; res = src1 - src2; if (((res ^ src1) & SIGNBIT64) && ((src1 ^ src2) & SIGNBIT64)) { env->QF = 1; res = ((int64_t)src1 >> 63) ^ ~SIGNBIT64; } return res; }
19,444
qemu
dba2855572c746836ad90ce9154403b5929d996b
1
static int coroutine_fn copy_sectors(BlockDriverState *bs, uint64_t start_sect, uint64_t cluster_offset, int n_start, int n_end) { BDRVQcowState *s = bs->opaque; QEMUIOVector qiov; struct iovec iov...
19,445
FFmpeg
1acd7d594c15aa491729c837ad3519d3469e620a
0
static void FUNCC(pred16x16_vertical_add)(uint8_t *pix, const int *block_offset, const int16_t *block, ptrdiff_t stride) { int i; for(i=0; i<16; i++) FUNCC(pred4x4_vertical_add)(pix + block_offset[i], block + i*16*...
19,446
FFmpeg
0058584580b87feb47898e60e4b80c7f425882ad
0
static int ac3_parse_audio_block(AC3DecodeContext * ctx, int index) { ac3_audio_block *ab = &ctx->audio_block; int nfchans = ctx->bsi.nfchans; int acmod = ctx->bsi.acmod; int i, bnd, rbnd, grp, seg; GetBitContext *gb = &ctx->gb; uint32_t *flags = &ab->flags; int bit_alloc_flags = 0; ...
19,447
FFmpeg
202a6697ba54293235ce2d7bd5724f4f461e417f
0
static void h264_free_extradata(PayloadContext *data) { #ifdef DEBUG int ii; for (ii = 0; ii < 32; ii++) { if (data->packet_types_received[ii]) av_log(NULL, AV_LOG_DEBUG, "Received %d packets of type %d\n", data->packet_types_received[ii], ii); } #endif ...
19,448
qemu
40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4
1
static int net_socket_connect_init(VLANState *vlan, const char *model, const char *name, const char *host_str) { NetSocketState *s; int fd, connected, ret, err; struct sockaddr_in saddr; if...
19,449
qemu
0fbc20740342713f282b118b4a446c4c43df3f4a
1
static int kvm_update_routing_entry(KVMState *s, struct kvm_irq_routing_entry *new_entry) { struct kvm_irq_routing_entry *entry; int n; for (n = 0; n < s->irq_routes->nr; n++) { entry = &s->irq_routes->entries[n]; if (entry->gsi != new_entry->gsi)...
19,450
qemu
b1b27b64262fdace45e5ab134c4438338076cb98
1
int nbd_client_session_co_discard(NbdClientSession *client, int64_t sector_num, int nb_sectors) { struct nbd_request request; struct nbd_reply reply; ssize_t ret; if (!(client->nbdflags & NBD_FLAG_SEND_TRIM)) { return 0; } request.type = NBD_CMD_TRIM; request.from = s...
19,451
qemu
537848ee62195fc06c328b1cd64f4218f404a7f1
1
ssize_t vnc_client_io_error(VncState *vs, ssize_t ret, Error **errp) { if (ret <= 0) { if (ret == 0) { VNC_DEBUG("Closing down client sock: EOF\n"); } else if (ret != QIO_CHANNEL_ERR_BLOCK) { VNC_DEBUG("Closing down client sock: ret %zd (%s)\n", r...
19,452
qemu
efec3dd631d94160288392721a5f9c39e50fb2bc
1
static void pl031_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); k->init = pl031_init; dc->no_user = 1; dc->vmsd = &vmstate_pl031; }
19,453
qemu
644ead5be1a851abff16886240c5c6fc1c5137c0
1
static inline void fimd_swap_data(unsigned int swap_ctl, uint64_t *data) { int i; uint64_t res; uint64_t x = *data; if (swap_ctl & FIMD_WINCON_SWAP_BITS) { res = 0; for (i = 0; i < 64; i++) { if (x & (1ULL << (64 - i))) { res |= (1ULL << i); ...
19,454
FFmpeg
7de3b1394b71118279e8f997be490633bc3f5d46
1
static int sdl_write_header(AVFormatContext *s) { SDLContext *sdl = s->priv_data; AVStream *st = s->streams[0]; AVCodecContext *encctx = st->codec; AVRational sar, dar; /* sample and display aspect ratios */ int i, ret; int flags = SDL_SWSURFACE | sdl->window_fullscreen ? SDL_FULLSCREEN :...
19,455
qemu
e0dadc1e9ef1f35208e5d2af9c7740c18a0b769f
1
static void aux_bus_class_init(ObjectClass *klass, void *data) { BusClass *k = BUS_CLASS(klass); /* AUXSlave has an MMIO so we need to change the way we print information * in monitor. */ k->print_dev = aux_slave_dev_print; }
19,456
FFmpeg
3c25209bd9ee83eeb0373dcf790eb116e986f8e1
0
static int ape_decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; APEContext *s = avctx->priv_data; int16_t *samples = data; int nblocks; ...
19,457
FFmpeg
b8b21dee0f0b4bcc1888067c497d6e838859d2cd
0
static const UID *mxf_get_mpeg2_codec_ul(AVCodecContext *avctx) { int long_gop = avctx->gop_size > 1 || avctx->has_b_frames; if (avctx->profile == 4) { // Main if (avctx->level == 8) // Main return &mxf_mpeg2_codec_uls[0+long_gop]; else if (avctx->level == 4) // High ...
19,458
FFmpeg
96dce6f7ceaa8d3c7eddd241213bec82e84e7f7a
0
static void free_packet_list(AVPacketList *pktl) { AVPacketList *cur; while (pktl) { cur = pktl; pktl = cur->next; av_free_packet(&cur->pkt); av_free(cur); } }
19,459
FFmpeg
c9dc66375b18590462f829a652d210c2e094693c
1
static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data) { const AVFrame *pic = data; int aligned_width = ((avctx->width + 47) / 48) * 48; int stride = aligned_width * 8 / 3; int h, w; const uint16_t *y = (const uint16_t*)pic->data[0...
19,460
qemu
5f8632d3c3d7bc5ef24166ba7cf90fcfb2adbf7d
1
static void pc_init_pci_no_kvmclock(MachineState *machine) { has_pci_info = false; has_acpi_build = false; smbios_defaults = false; x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI); enable_compat_apic_id_mode(); pc_init1(machine, 1, 0); }
19,461
qemu
ecca3b397d06a957b18913ff9afc63860001cfdf
1
static void ide_sector_read_cb(void *opaque, int ret) { IDEState *s = opaque; int n; s->pio_aiocb = NULL; s->status &= ~BUSY_STAT; if (ret == -ECANCELED) { return; } block_acct_done(blk_get_stats(s->blk), &s->acct); if (ret != 0) { if (ide_handle_rw_error(s...
19,463
FFmpeg
235e76aeb877bd1b23c12e74588e86752e3dfbe7
1
av_cold void INIT_FUNC(VP9DSPContext *dsp, int bitexact) { #if HAVE_YASM int cpu_flags = av_get_cpu_flags(); #define init_lpf_8_func(idx1, idx2, dir, wd, bpp, opt) \ dsp->loop_filter_8[idx1][idx2] = ff_vp9_loop_filter_##dir##_##wd##_##bpp##_##opt #define init_lpf_16_func(idx, dir, bpp, opt) \ dsp->...
19,464
FFmpeg
8acab7ae5bbcb589c556425453ac3d851d35021f
1
static void get_tag(AVFormatContext *s, AVIOContext *pb, const char *key, int type, int length) { int buf_size = FFMAX(2*length, LEN_PRETTY_GUID) + 1; char *buf = av_malloc(buf_size); if (!buf) return; if (type == 0 && length == 4) { snprintf(buf, buf_size, "%"PRIi32, avio_rl32(...
19,465
qemu
ac64c5fdf8c1e470cfca94d7ad5686770e6e470a
1
void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi, ISADevice **rtc_state, bool create_fdctrl, bool no_vmport, uint32_t hpet_irqs) { int i; DriveInfo *fd[MAX_FD]; DeviceState *hpet = NULL; ...
19,466
FFmpeg
57cd6d709565e84e84385f8f2a9641ca3fa718be
1
void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values, uint16_t *y_list, int *flag, int multiplier, float *out, int samples) { int lx, ly, i; lx = 0; ly = y_list[0] * multiplier; for (i = 1; i < values; i++) { ...
19,467
FFmpeg
aefdb735c3df9480c1ca9bcf4a3835bd66271bd1
0
static void channel_weighting(float *su1, float *su2, int *p3) { int band, nsample; /* w[x][y] y=0 is left y=1 is right */ float w[2][2]; if (p3[1] != 7 || p3[3] != 7) { get_channel_weights(p3[1], p3[0], w[0]); get_channel_weights(p3[3], p3[2], w[1]); for (band = 1; b...
19,468
qemu
cbe1beb7a1eaa34e0c24b4897395dac017e5d16f
0
bool bdrv_requests_pending(BlockDriverState *bs) { BdrvChild *child; BlockBackendPublic *blkp = bs->blk ? blk_get_public(bs->blk) : NULL; if (!QLIST_EMPTY(&bs->tracked_requests)) { return true; } if (blkp && !qemu_co_queue_empty(&blkp->throttled_reqs[0])) { return true; ...
19,470
qemu
a980f7f2c2f4d7e9a1eba4f804cd66dbd458b6d4
0
static void qvirtio_9p_pci_free(QVirtIO9P *v9p) { qvirtqueue_cleanup(v9p->dev->bus, v9p->vq, v9p->alloc); pc_alloc_uninit(v9p->alloc); qvirtio_pci_device_disable(container_of(v9p->dev, QVirtioPCIDevice, vdev)); g_free(v9p->dev); qpci_free_pc(v9p->bus); g_free(v9p); }
19,471
qemu
5def6b80e1eca696c1fc6099e7f4d36729686402
0
static int coroutine_fn bdrv_co_do_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int count, BdrvRequestFlags flags) { BlockDriver *drv = bs->drv; QEMUIOVector qiov; struct iovec iov = {0}; int ret = 0; bool need_flush = false; int head = 0; int tail = 0; int max_wri...
19,474
qemu
723ccda1a0eecece8e70dbcdd35a603f6c41a475
0
int load_vmstate(const char *name) { BlockDriverState *bs, *bs_vm_state; QEMUSnapshotInfo sn; QEMUFile *f; int ret; if (!bdrv_all_can_snapshot(&bs)) { error_report("Device '%s' is writable but does not support snapshots.", bdrv_get_device_name(bs)); re...
19,475
qemu
0e9b9edae7bebfd31fdbead4ccbbce03876a7edd
0
build_fadt(GArray *table_data, GArray *linker, AcpiPmInfo *pm, unsigned facs, unsigned dsdt, const char *oem_id, const char *oem_table_id) { AcpiFadtDescriptorRev1 *fadt = acpi_data_push(table_data, sizeof(*fadt)); fadt->firmware_ctrl = cpu_to_le32(facs); /* FACS address to be ...
19,477
qemu
b3db211f3c80bb996a704d665fe275619f728bd4
0
static void test_visitor_in_bool(TestInputVisitorData *data, const void *unused) { bool res = false; Visitor *v; v = visitor_input_test_init(data, "true"); visit_type_bool(v, NULL, &res, &error_abort); g_assert_cmpint(res, ==, true); }
19,478
qemu
3bb7e02a9725a24e5bf915b35f914f82f5b07a1f
0
static void e500plat_init(QEMUMachineInitArgs *args) { ram_addr_t ram_size = args->ram_size; const char *boot_device = args->boot_device; const char *cpu_model = args->cpu_model; const char *kernel_filename = args->kernel_filename; const char *kernel_cmdline = args->kernel_cmdline; const ...
19,481
qemu
880a7578381d1c7ed4d41c7599ae3cc06567a824
0
static void gdb_read_byte(GDBState *s, int ch) { CPUState *env = s->env; int i, csum; uint8_t reply; #ifndef CONFIG_USER_ONLY if (s->last_packet_len) { /* Waiting for a response to the last packet. If we see the start of a new command then abandon the previous response. */...
19,482
FFmpeg
9f9440bd8122cc8798139c9370db0873a24ae14b
0
int ff_hevc_decode_nal_pps(HEVCContext *s) { GetBitContext *gb = &s->HEVClc->gb; HEVCSPS *sps = NULL; int pic_area_in_ctbs; int log2_diff_ctb_min_tb_size; int i, j, x, y, ctb_addr_rs, tile_id; int ret = 0; unsigned int pps_id = 0; AVBufferRef *pps_buf; HEVCPPS *pps =...
19,483
qemu
4fc8d6711aff7a9c11e402c3d77b481609f9f486
0
static void ide_drive_pre_save(void *opaque) { IDEState *s = opaque; s->cur_io_buffer_len = 0; if (!(s->status & DRQ_STAT)) return; s->cur_io_buffer_offset = s->data_ptr - s->io_buffer; s->cur_io_buffer_len = s->data_end - s->data_ptr; s->end_transfer_fn_idx = transfer_en...
19,484
qemu
880a7578381d1c7ed4d41c7599ae3cc06567a824
0
static int gdb_breakpoint_remove(CPUState *env, target_ulong addr, target_ulong len, int type) { switch (type) { case GDB_BREAKPOINT_SW: case GDB_BREAKPOINT_HW: return cpu_breakpoint_remove(env, addr, BP_GDB); #ifndef CONFIG_USER_ONLY case GDB_WATCHPOINT_...
19,485
qemu
d7b61ecc61f84d23f98f1ee270fb48b41834ca00
0
static int unin_main_pci_host_init(PCIDevice *d) { pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_APPLE); pci_config_set_device_id(d->config, PCI_DEVICE_ID_APPLE_UNI_N_PCI); d->config[0x08] = 0x00; // revision pci_config_set_class(d->config, PCI_CLASS_BRIDGE_HOST); d->config[0x0C] = 0x08; /...
19,486
qemu
5ab4bb598d3f58542a06a6946f04b140be222892
0
VirtIODevice *virtio_serial_init(DeviceState *dev, uint32_t max_nr_ports) { VirtIOSerial *vser; VirtIODevice *vdev; uint32_t i; if (!max_nr_ports) return NULL; vdev = virtio_common_init("virtio-serial", VIRTIO_ID_CONSOLE, sizeof(struct virtio_console...
19,487
qemu
7d6e771f49c36f4388798ce25bde1dede40cda74
0
static void pci_vpb_map(SysBusDevice *dev, target_phys_addr_t base) { PCIVPBState *s = (PCIVPBState *)dev; /* Selfconfig area. */ memory_region_add_subregion(get_system_memory(), base + 0x01000000, &s->mem_config); /* Normal config area. */ memory_region_add_...
19,488
qemu
b3db211f3c80bb996a704d665fe275619f728bd4
0
static void qmp_input_start_struct(Visitor *v, const char *name, void **obj, size_t size, Error **errp) { QmpInputVisitor *qiv = to_qiv(v); QObject *qobj = qmp_input_get_object(qiv, name, true, errp); Error *err = NULL; if (obj) { *obj = NULL; } ...
19,491
FFmpeg
1303d62d8416fa315a0cc7bbbe35cfdab787ea92
0
static int read_packet(ByteIOContext *pb, uint8_t *buf, int raw_packet_size) { int skip, len; for(;;) { len = get_buffer(pb, buf, TS_PACKET_SIZE); if (len != TS_PACKET_SIZE) return AVERROR(EIO); /* check paquet sync byte */ if (buf[0] != 0x47) { ...
19,493
FFmpeg
11ab1e409ff272c8c0bce62f48a3767546547c6c
0
av_cold void ff_fft_init_arm(FFTContext *s) { if (HAVE_NEON) { s->fft_permute = ff_fft_permute_neon; s->fft_calc = ff_fft_calc_neon; s->imdct_calc = ff_imdct_calc_neon; s->imdct_half = ff_imdct_half_neon; s->mdct_calc = ff_mdct_calc_neon; s->permut...
19,495
qemu
a652d16025030013116c4d63883b9e1ec08a4359
0
static int coroutine_fn bdrv_co_io_em(BlockDriverState *bs, int64_t sector_num, int nb_sectors, QEMUIOVector *iov, bool is_write) { CoroutineIOCompletion co = { .coroutine = qemu_coroutine_self(), }; BlockDriverAIOCB ...
19,496