label int64 0 1 | func stringlengths 21 96.3k |
|---|---|
0 | static int test_vector_fmul_reverse(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp, const float *v1, const float *v2){ LOCAL_ALIGNED(32, float, cdst, [LEN]); LOCAL_ALIGNED(32, float, odst, [LEN]); int ret; cdsp->vector_fmul_reverse(cdst, v1, v2, LEN); fdsp->vector_fmul_reverse(odst, v1, v2, LEN); if (ret = compare_fl... |
0 | static int ipvideo_decode_block_opcode_0x3(IpvideoContext *s){ unsigned char B; int x, y; /* copy 8x8 block from current frame from an up/left block */ /* need 1 more byte for motion */ CHECK_STREAM_PTR(1); B = *s->stream_ptr++; if (B < 56) { x = -(8 + (B % 7)); y = -(B / 7); } else { x = -(-14 + ((B - 56) % 29)); y = ... |
0 | static int set_params(AVFilterContext *ctx, const char *params){ Frei0rContext *s = ctx->priv; int i; if (!params) return 0; for (i = 0; i < s->plugin_info.num_params; i++) { f0r_param_info_t info; char *param; int ret; s->get_param_info(&info, i); if (*params) { if (!(param = av_get_token(¶ms, "|"))) return AVERRO... |
0 | static int ipvideo_decode_block_opcode_0xE(IpvideoContext *s){ int y; unsigned char pix; /* 1-color encoding: the whole block is 1 solid color */ CHECK_STREAM_PTR(1); pix = *s->stream_ptr++; for (y = 0; y < 8; y++) { memset(s->pixel_ptr, pix, 8); s->pixel_ptr += s->stride; } /* report success */ return 0;} |
0 | static int ra144_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr){ static const uint8_t sizes[LPC_ORDER] = {64, 32, 32, 16, 16, 8, 8, 8, 8, 4}; static const uint8_t bit_sizes[LPC_ORDER] = {6, 5, 5, 4, 4, 3, 3, 3, 3, 2}; RA144Context *ractx = avctx->priv_data; PutBitContext... |
0 | static off_t read_uint32(int fd, int64_t offset){uint32_t buffer;if (pread(fd, &buffer, 4, offset) < 4)return 0;return be32_to_cpu(buffer);} |
0 | static int tosa_dac_send(I2CSlave *i2c, uint8_t data){ TosaDACState *s = TOSA_DAC(i2c); s->buf[s->len] = data; if (s->len ++ > 2) {#ifdef VERBOSE fprintf(stderr, "%s: message too long (%i bytes)\n", __FUNCTION__, s->len);#endif return 1; } if (s->len == 2) { fprintf(stderr, "dac: channel %d value 0x%02x\n", s->buf[0], ... |
0 | static void socket_start_incoming_migration(SocketAddress *saddr, Error **errp){ QIOChannelSocket *listen_ioc = qio_channel_socket_new(); qio_channel_set_name(QIO_CHANNEL(listen_ioc), "migration-socket-listener"); if (qio_channel_socket_listen_sync(listen_ioc, saddr, errp) < 0) { object_unref(OBJECT(listen_ioc)); qapi_... |
0 | static void mpc8544ds_init(ram_addr_t ram_size, const char *boot_device, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model){ PCIBus *pci_bus; CPUState *env; uint64_t elf_entry; uint64_t elf_lowaddr; target_phys_addr_t entry=0; target_phys_addr_t loadaddr=UIMAGE_... |
0 | static void test_visitor_out_native_list_bool(TestOutputVisitorData *data, const void *unused){ test_native_list(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_BOOLEAN);} |
0 | static int virtio_blk_load_device(VirtIODevice *vdev, QEMUFile *f, int version_id){ VirtIOBlock *s = VIRTIO_BLK(vdev); while (qemu_get_sbyte(f)) { unsigned nvqs = s->conf.num_queues; unsigned vq_idx = 0; VirtIOBlockReq *req; if (nvqs > 1) { vq_idx = qemu_get_be32(f); if (vq_idx >= nvqs) { error_report("Invalid virtqueu... |
0 | void pci_device_hot_add(Monitor *mon, const QDict *qdict, QObject **ret_data){ PCIDevice *dev = NULL; const char *pci_addr = qdict_get_str(qdict, "pci_addr"); const char *type = qdict_get_str(qdict, "type"); const char *opts = qdict_get_try_str(qdict, "opts"); /* strip legacy tag */ if (!strncmp(pci_addr, "pci_addr=", ... |
0 | static int tta_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt){ const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; TTAContext *s = avctx->priv_data; int i, ret; int cur_chan = 0, framelen = s->frame_length; int32_t *p; if (avctx->err_recognition & AV_EF_CRCCHECK) { if (bu... |
0 | static bool pmsav7_use_background_region(ARMCPU *cpu, ARMMMUIdx mmu_idx, bool is_user){ /* Return true if we should use the default memory map as a * "background" region if there are no hits against any MPU regions. */ CPUARMState *env = &cpu->env; if (is_user) { return false; } if (arm_feature(env, ARM_FEATURE_M)) { r... |
0 | static void rtas_system_reboot(sPAPREnvironment *spapr, uint32_t token, uint32_t nargs, target_ulong args, uint32_t nret, target_ulong rets){ if (nargs != 0 || nret != 1) { rtas_st(rets, 0, -3); return; } qemu_system_reset_request(); rtas_st(rets, 0, 0);} |
0 | static int preallocate(BlockDriverState *bs){ uint64_t nb_sectors; uint64_t offset; uint64_t host_offset = 0; int num; int ret; QCowL2Meta *meta; nb_sectors = bdrv_getlength(bs) >> 9; offset = 0; while (nb_sectors) { num = MIN(nb_sectors, INT_MAX >> 9); ret = qcow2_alloc_cluster_offset(bs, offset, &num, &host_offset, &... |
0 | static int vfio_msix_vector_do_use(PCIDevice *pdev, unsigned int nr, MSIMessage *msg, IOHandler *handler){ VFIOPCIDevice *vdev = DO_UPCAST(VFIOPCIDevice, pdev, pdev); VFIOMSIVector *vector; int ret; trace_vfio_msix_vector_do_use(vdev->vbasedev.name, nr); vector = &vdev->msi_vectors[nr]; if (!vector->use) { vector->vdev... |
0 | int virtio_load(VirtIODevice *vdev, QEMUFile *f){ int i, ret; int32_t config_len; uint32_t num; uint32_t features; uint32_t supported_features; BusState *qbus = qdev_get_parent_bus(DEVICE(vdev)); VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus); if (k->load_config) { ret = k->load_config(qbus->parent, f); if (ret) return... |
0 | static int pci_vmsvga_initfn(PCIDevice *dev){ struct pci_vmsvga_state_s *s = DO_UPCAST(struct pci_vmsvga_state_s, card, dev); pci_config_set_vendor_id(s->card.config, PCI_VENDOR_ID_VMWARE); pci_config_set_device_id(s->card.config, SVGA_PCI_DEVICE_ID); pci_config_set_class(s->card.config, PCI_CLASS_DISPLAY_VGA); s->card... |
0 | static int qed_read_table(BDRVQEDState *s, uint64_t offset, QEDTable *table){ QEMUIOVector qiov; int noffsets; int i, ret; struct iovec iov = { .iov_base = table->offsets, .iov_len = s->header.cluster_size * s->header.table_size, }; qemu_iovec_init_external(&qiov, &iov, 1); trace_qed_read_table(s, offset, table); ret =... |
0 | long do_sigreturn(CPUState *env){ struct target_signal_frame *sf; uint32_t up_psr, pc, npc; target_sigset_t set; sigset_t host_set; abi_ulong fpu_save; int err, i; sf = (struct target_signal_frame *)g2h(env->regwptr[UREG_FP]);#if 0fprintf(stderr, "sigreturn\n");fprintf(stderr, "sf: %x pc %x fp %x sp %x\n", sf, env->pc,... |
0 | int cpu_exec(CPUState *cpu){ CPUClass *cc = CPU_GET_CLASS(cpu);#ifdef TARGET_I386 X86CPU *x86_cpu = X86_CPU(cpu); CPUArchState *env = &x86_cpu->env;#endif int ret, interrupt_request; TranslationBlock *tb; uint8_t *tc_ptr; uintptr_t next_tb; SyncClocks sc; if (cpu->halted) {#if defined(TARGET_I386) && !defined(CONFIG_US... |
0 | static int dvbsub_parse_clut_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size){ DVBSubContext *ctx = avctx->priv_data; const uint8_t *buf_end = buf + buf_size; int i, clut_id; int version; DVBSubCLUT *clut; int entry_id, depth , full_range; int y, cr, cb, alpha; int r, g, b, r_add, g_add, b_add; ff_dlog(... |
0 | static void load_word(DBDMA_channel *ch, int key, uint32_t addr, uint16_t len){ dbdma_cmd *current = &ch->current; uint32_t val; DBDMA_DPRINTF("load_word\n"); /* only implements KEY_SYSTEM */ if (key != KEY_SYSTEM) { printf("DBDMA: LOAD_WORD, unimplemented key %x\n", key); kill_channel(ch); return; } cpu_physical_memor... |
0 | static void nvdimm_dsm_device(NvdimmDsmIn *in, hwaddr dsm_mem_addr){ /* See the comments in nvdimm_dsm_root(). */ if (!in->function) { nvdimm_dsm_function0(0 /* No function supported other than function 0 */, dsm_mem_addr); return; } /* No function except function 0 is supported yet. */ nvdimm_dsm_no_payload(1 /* Not S... |
0 | static void bdrv_co_em_bh(void *opaque){ BlockAIOCBCoroutine *acb = opaque; acb->common.cb(acb->common.opaque, acb->req.error); qemu_bh_delete(acb->bh); qemu_aio_unref(acb);} |
0 | static int qcow2_change_backing_file(BlockDriverState *bs, const char *backing_file, const char *backing_fmt){ /* Backing file format doesn't make sense without a backing file */ if (backing_fmt && !backing_file) { return -EINVAL; } pstrcpy(bs->backing_file, sizeof(bs->backing_file), backing_file ?: ""); pstrcpy(bs->ba... |
0 | void helper_fcmp_eq_DT(CPUSH4State *env, float64 t0, float64 t1){ int relation; set_float_exception_flags(0, &env->fp_status); relation = float64_compare(t0, t1, &env->fp_status); if (unlikely(relation == float_relation_unordered)) { update_fpscr(env, GETPC()); } else { env->sr_t = (relation == float_relation_equal); }... |
0 | int qcow2_update_snapshot_refcount(BlockDriverState *bs, int64_t l1_table_offset, int l1_size, int addend){ BDRVQcow2State *s = bs->opaque; uint64_t *l1_table, *l2_table, l2_offset, offset, l1_size2, refcount; bool l1_allocated = false; int64_t old_offset, old_l2_offset; int i, j, l1_modified = 0, nb_csectors; int ret;... |
0 | static int enable_write_target(BDRVVVFATState *s, Error **errp){ BlockDriver *bdrv_qcow = NULL; QemuOpts *opts = NULL; 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 = get_tmp_filename(s->qco... |
0 | static void dca_init_vlcs(void){ static int vlcs_inited = 0; int i, j; if (vlcs_inited) return; dca_bitalloc_index.offset = 1; dca_bitalloc_index.wrap = 2; for (i = 0; i < 5; i++) init_vlc(&dca_bitalloc_index.vlc[i], bitalloc_12_vlc_bits[i], 12, bitalloc_12_bits[i], 1, 1, bitalloc_12_codes[i], 2, 2, 1); dca_scalefactor... |
0 | static inline int is_yuv_planar(PixFmtInfo *ps){ return (ps->color_type == FF_COLOR_YUV || ps->color_type == FF_COLOR_YUV_JPEG) && !ps->is_packed;} |
0 | AVFilter *avfilter_get_by_name(const char *name){ int i; for (i = 0; registered_avfilters[i]; i++) if (!strcmp(registered_avfilters[i]->name, name)) return registered_avfilters[i]; return NULL;} |
0 | static int output_frame(H264Context *h, AVFrame *dst, AVFrame *src){ int i; int ret = av_frame_ref(dst, src); if (ret < 0) return ret; if (!h->sps.crop) return 0; for (i = 0; i < 3; i++) { int hshift = (i > 0) ? h->chroma_x_shift : 0; int vshift = (i > 0) ? h->chroma_y_shift : 0; int off = ((h->sps.crop_left >> hshift)... |
1 | static inline void futex_wake(QemuEvent *ev, int n){ if (n == 1) { pthread_cond_signal(&ev->cond); } else { pthread_cond_broadcast(&ev->cond); }} |
1 | void vnc_flush(VncState *vs){ if (vs->output.offset) vnc_client_write(vs);} |
1 | static void get_private_data(OutputStream *os){ AVCodecContext *codec = os->ctx->streams[0]->codec; uint8_t *ptr = codec->extradata; int size = codec->extradata_size; int i; if (codec->codec_id == AV_CODEC_ID_H264) { ff_avc_write_annexb_extradata(ptr, &ptr, &size); if (!ptr) ptr = codec->extradata; } if (!ptr) return; ... |
1 | static int bdrv_qed_open(BlockDriverState *bs, int flags){ BDRVQEDState *s = bs->opaque; QEDHeader le_header; int64_t file_size; int ret; s->bs = bs; QSIMPLEQ_INIT(&s->allocating_write_reqs); ret = bdrv_pread(bs->file, 0, &le_header, sizeof(le_header)); if (ret < 0) { return ret; } ret = 0; /* ret should always be 0 or... |
1 | static void do_key_event(VncState *vs, int down, int keycode, int sym){ /* QEMU console switch */ switch(keycode) { case 0x2a: /* Left Shift */ case 0x36: /* Right Shift */ case 0x1d: /* Left CTRL */ case 0x9d: /* Right CTRL */ case 0x38: /* Left ALT */ case 0xb8: /* Right ALT */ if (down) vs->modifiers_state[keycode] ... |
1 | void set_link_completion(ReadLineState *rs, int nb_args, const char *str){ size_t len; len = strlen(str); readline_set_completion_index(rs, len); if (nb_args == 2) { NetClientState *ncs[MAX_QUEUE_NUM]; int count, i; count = qemu_find_net_clients_except(NULL, ncs, NET_CLIENT_OPTIONS_KIND_NONE, MAX_QUEUE_NUM); for (i = 0... |
1 | static void bufp_alloc(USBRedirDevice *dev, uint8_t *data, uint16_t len, uint8_t status, uint8_t ep, void *free_on_destroy){ struct buf_packet *bufp; if (!dev->endpoint[EP2I(ep)].bufpq_dropping_packets && dev->endpoint[EP2I(ep)].bufpq_size > 2 * dev->endpoint[EP2I(ep)].bufpq_target_size) { DPRINTF("bufpq overflow, drop... |
1 | static inline void check_hwrena(CPUMIPSState *env, int reg){ if ((env->hflags & MIPS_HFLAG_CP0) || (env->CP0_HWREna & (1 << reg))) { return; } do_raise_exception(env, EXCP_RI, GETPC());} |
1 | static bool xen_host_pci_dev_is_virtfn(XenHostPCIDevice *d){ char path[PATH_MAX]; struct stat buf; if (xen_host_pci_sysfs_path(d, "physfn", path, sizeof (path))) { return false; } return !stat(path, &buf);} |
1 | static gboolean guest_exec_output_watch(GIOChannel *ch, GIOCondition cond, gpointer p_){ GuestExecIOData *p = (GuestExecIOData *)p_; gsize bytes_read; GIOStatus gstatus; if (cond == G_IO_HUP || cond == G_IO_ERR) { goto close; } if (p->size == p->length) { gpointer t = NULL; if (!p->truncated && p->size < GUEST_EXEC_MAX... |
0 | static int hq_decode_block(HQContext *c, GetBitContext *gb, int16_t block[64], int qsel, int is_chroma, int is_hqa){ const int32_t *q; int val, pos = 1; memset(block, 0, 64 * sizeof(*block)); if (!is_hqa) { block[0] = get_sbits(gb, 9) << 6; q = ff_hq_quants[qsel][is_chroma][get_bits(gb, 2)]; } else { q = ff_hq_quants[q... |
1 | static void final(const short *i1, const short *i2, void *out, int *statbuf, int len){ int x, i; unsigned short int work[50]; short *ptr = work; memcpy(work, statbuf,20); memcpy(work + 10, i2, len * 2); for (i=0; i<len; i++) { int sum = 0; for(x=0; x<10; x++) sum += i1[9-x] * ptr[x]; sum >>= 12; if (ptr[10] - sum < -32... |
1 | static int showspectrumpic_request_frame(AVFilterLink *outlink){ AVFilterContext *ctx = outlink->src; ShowSpectrumContext *s = ctx->priv; AVFilterLink *inlink = ctx->inputs[0]; int ret; ret = ff_request_frame(inlink); if (ret == AVERROR_EOF && s->outpicref) { int samples = av_audio_fifo_size(s->fifo); int consumed = 0;... |
1 | static int usb_msd_initfn_storage(USBDevice *dev){ MSDState *s = DO_UPCAST(MSDState, dev, dev); BlockDriverState *bs = s->conf.bs; SCSIDevice *scsi_dev; Error *err = NULL; if (!bs) { error_report("drive property not set"); return -1; } blkconf_serial(&s->conf, &dev->serial); /* * Hack alert: this pretends to be a block... |
1 | static gnutls_anon_server_credentials_t vnc_tls_initialize_anon_cred(void){ gnutls_anon_server_credentials_t anon_cred; int ret; if ((ret = gnutls_anon_allocate_server_credentials(&anon_cred)) < 0) { VNC_DEBUG("Cannot allocate credentials %s\n", gnutls_strerror(ret)); return NULL; } gnutls_anon_set_server_dh_params(ano... |
1 | static void hypercall_init(void){ /* hcall-pft */ spapr_register_hypercall(H_ENTER, h_enter); spapr_register_hypercall(H_REMOVE, h_remove); spapr_register_hypercall(H_PROTECT, h_protect); /* qemu/KVM-PPC specific hcalls */ spapr_register_hypercall(KVMPPC_H_RTAS, h_rtas);} |
1 | static int mig_save_device_bulk(QEMUFile *f, BlkMigDevState *bmds){ int64_t total_sectors = bmds->total_sectors; int64_t cur_sector = bmds->cur_sector; BlockDriverState *bs = bmds->bs; BlkMigBlock *blk; int nr_sectors; if (bmds->shared_base) { qemu_mutex_lock_iothread(); while (cur_sector < total_sectors && !bdrv_is_al... |
1 | static int make_setup_request(AVFormatContext *s, const char *host, int port, int lower_transport, const char *real_challenge){ RTSPState *rt = s->priv_data; int rtx, j, i, err, interleave = 0; RTSPStream *rtsp_st; RTSPMessageHeader reply1, *reply = &reply1; char cmd[2048]; const char *trans_pref; if (rt->transport == ... |
1 | void gic_update(GICState *s){ int best_irq; int best_prio; int irq; int irq_level, fiq_level; int cpu; int cm; for (cpu = 0; cpu < s->num_cpu; cpu++) { cm = 1 << cpu; s->current_pending[cpu] = 1023; if (!(s->ctlr & (GICD_CTLR_EN_GRP0 | GICD_CTLR_EN_GRP1)) || !(s->cpu_ctlr[cpu] & (GICC_CTLR_EN_GRP0 | GICC_CTLR_EN_GRP1))... |
1 | static void residual_interp(int16_t *buf, int16_t *out, int lag, int gain, int *rseed){ int i; if (lag) { /* Voiced */ int16_t *vector_ptr = buf + PITCH_MAX; /* Attenuate */ for (i = 0; i < lag; i++) out[i] = vector_ptr[i - lag] * 3 >> 2; av_memcpy_backptr((uint8_t*)(out + lag), lag * sizeof(*out), (FRAME_LEN - lag) * ... |
1 | static int mpeg2_decode_block_non_intra(MpegEncContext *s, DCTELEM *block, int n){ int level, i, j, run; int code; RLTable *rl = &rl_mpeg1; const UINT8 *scan_table; const UINT16 *matrix; int mismatch; if (s->alternate_scan) scan_table = ff_alternate_vertical_scan; else scan_table = zigzag_direct; mismatch = 1; { int bi... |
0 | static int aiff_write_trailer(AVFormatContext *s){ AVIOContext *pb = s->pb; AIFFOutputContext *aiff = s->priv_data; AVCodecParameters *par = s->streams[0]->codecpar; /* Chunks sizes must be even */ int64_t file_size, end_size; end_size = file_size = avio_tell(pb); if (file_size & 1) { avio_w8(pb, 0); end_size++; } if (... |
0 | static void RENAME(yuv2rgb565_2)(SwsContext *c, const uint16_t *buf0, const uint16_t *buf1, const uint16_t *ubuf0, const uint16_t *ubuf1, const uint16_t *vbuf0, const uint16_t *vbuf1, const uint16_t *abuf0, const uint16_t *abuf1, uint8_t *dest, int dstW, int yalpha, int uvalpha, int y){ //Note 8280 == DSTW_OFFSET but t... |
0 | struct AACISError ff_aac_is_encoding_err(AACEncContext *s, ChannelElement *cpe, int start, int w, int g, float ener0, float ener1, float ener01, int use_pcoeffs, int phase){ int i, w2; SingleChannelElement *sce0 = &cpe->ch[0]; SingleChannelElement *sce1 = &cpe->ch[1]; float *L = use_pcoeffs ? sce0->pcoeffs : sce0->coef... |
0 | static int hls_write_packet(AVFormatContext *s, AVPacket *pkt){ HLSContext *hls = s->priv_data; AVFormatContext *oc = NULL; AVStream *st = s->streams[pkt->stream_index]; int64_t end_pts = hls->recording_time * hls->number; int is_ref_pkt = 1; int ret, can_split = 1; int stream_index = 0; if (hls->sequence - hls->nb_ent... |
1 | static void copy_cell(Indeo3DecodeContext *ctx, Plane *plane, Cell *cell){ int h, w, mv_x, mv_y, offset, offset_dst; uint8_t *src, *dst; /* setup output and reference pointers */ offset_dst = (cell->ypos << 2) * plane->pitch + (cell->xpos << 2); dst = plane->pixels[ctx->buf_sel] + offset_dst; mv_y = cell->mv_ptr[0]; mv... |
0 | static void h264_h_loop_filter_chroma_c(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0){ h264_loop_filter_chroma_c(pix, 1, stride, alpha, beta, tc0);} |
1 | static int ram_save_host_page(RAMState *rs, PageSearchStatus *pss, bool last_stage, ram_addr_t dirty_ram_abs){ int tmppages, pages = 0; size_t pagesize = qemu_ram_pagesize(pss->block); do { tmppages = ram_save_target_page(rs, pss, last_stage, dirty_ram_abs); if (tmppages < 0) { return tmppages; } pages += tmppages; pss... |
1 | static void gen_check_privilege(DisasContext *dc){ if (dc->cring) { gen_exception_cause(dc, PRIVILEGED_CAUSE); dc->is_jmp = DISAS_UPDATE; }} |
1 | MigrationState *unix_start_outgoing_migration(Monitor *mon, const char *path, int64_t bandwidth_limit, int detach, int blk, int inc){ FdMigrationState *s; struct sockaddr_un addr; int ret; addr.sun_family = AF_UNIX; snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", path); s = qemu_mallocz(sizeof(*s)); s->get_error =... |
1 | static int fdk_aac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt){ FDKAACDecContext *s = avctx->priv_data; AVFrame *frame = data; int ret; AAC_DECODER_ERROR err; UINT valid = avpkt->size; err = aacDecoder_Fill(s->handle, &avpkt->data, &avpkt->size, &valid); if (err != AAC_DEC_OK) {... |
1 | static void readline_completion(ReadLineState *rs){ Monitor *mon = cur_mon; int len, i, j, max_width, nb_cols, max_prefix; char *cmdline; rs->nb_completions = 0; cmdline = g_malloc(rs->cmd_buf_index + 1); memcpy(cmdline, rs->cmd_buf, rs->cmd_buf_index); cmdline[rs->cmd_buf_index] = '\0'; rs->completion_finder(cmdline);... |
1 | static av_cold int png_dec_init(AVCodecContext *avctx){ PNGDecContext *s = avctx->priv_data; s->avctx = avctx; s->previous_picture.f = av_frame_alloc(); s->last_picture.f = av_frame_alloc(); s->picture.f = av_frame_alloc(); if (!s->previous_picture.f || !s->last_picture.f || !s->picture.f) return AVERROR(ENOMEM); if (!... |
1 | static int tiff_unpack_fax(TiffContext *s, uint8_t *dst, int stride, const uint8_t *src, int size, int width, int lines){ int i, ret = 0; int line; uint8_t *src2 = av_malloc((unsigned)size + AV_INPUT_BUFFER_PADDING_SIZE); if (!src2) { av_log(s->avctx, AV_LOG_ERROR, "Error allocating temporary buffer\n"); return AVERROR... |
1 | int tlb_set_page_exec(CPUState *env, target_ulong vaddr, target_phys_addr_t paddr, int prot, int is_user, int is_softmmu){ PhysPageDesc *p; unsigned long pd; unsigned int index; target_ulong address; target_phys_addr_t addend; int ret; CPUTLBEntry *te; p = phys_page_find(paddr >> TARGET_PAGE_BITS); if (!p) { pd = IO_ME... |
1 | static void do_video_out(AVFormatContext *s, AVOutputStream *ost, AVInputStream *ist, AVPicture *in_picture, int *frame_size, AVOutputStream *audio_sync){ int nb_frames, i, ret; AVPicture *final_picture, *formatted_picture; AVPicture picture_format_temp, picture_crop_temp; static uint8_t *video_buffer; uint8_t *buf = N... |
1 | static int read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flags){ NUTContext *nut = s->priv_data; AVStream *st = s->streams[stream_index]; Syncpoint dummy = { .ts = pts * av_q2d(st->time_base) * AV_TIME_BASE }; Syncpoint nopts_sp = { .ts = AV_NOPTS_VALUE, .back_ptr = AV_NOPTS_VALUE }; Syncpoint *sp, *... |
1 | static QList *get_cpus(QDict **resp){ *resp = qmp("{ 'execute': 'query-cpus' }"); g_assert(*resp); g_assert(qdict_haskey(*resp, "return")); return qdict_get_qlist(*resp, "return");} |
1 | QemuOptsList *qemu_opts_append(QemuOptsList *dst, QemuOptsList *list){ size_t num_opts, num_dst_opts; QemuOptDesc *desc; bool need_init = false; if (!list) { return dst; } /* If dst is NULL, after realloc, some area of dst should be initialized * before adding options to it. */ if (!dst) { need_init = true; } num_opts ... |
1 | static void vnc_dpy_setdata(DisplayChangeListener *dcl, DisplayState *ds){ VncDisplay *vd = ds->opaque; qemu_pixman_image_unref(vd->guest.fb); vd->guest.fb = pixman_image_ref(ds->surface->image); vd->guest.format = ds->surface->format; vnc_dpy_update(dcl, ds, 0, 0, ds_get_width(ds), ds_get_height(ds));} |
1 | static inline int cris_addc(int a, const int b){asm ("addc\t%1, %0\n" : "+r" (a) : "r" (b));return a;} |
1 | void acpi_setup(PcGuestInfo *guest_info){ AcpiBuildTables tables; AcpiBuildState *build_state; if (!guest_info->fw_cfg) { ACPI_BUILD_DPRINTF("No fw cfg. Bailing out.\n"); return; } if (!guest_info->has_acpi_build) { ACPI_BUILD_DPRINTF("ACPI build disabled. Bailing out.\n"); return; } if (!acpi_enabled) { ACPI_BUILD_DPR... |
1 | static void reset_used_window(DisasContext *dc){ dc->used_window = 0;} |
1 | static int decode_block(MJpegDecodeContext *s, int16_t *block, int component, int dc_index, int ac_index, uint16_t *quant_matrix){ int code, i, j, level, val; /* DC coef */ val = mjpeg_decode_dc(s, dc_index); if (val == 0xfffff) { av_log(s->avctx, AV_LOG_ERROR, "error dc\n"); return AVERROR_INVALIDDATA; } val = val * q... |
1 | static int usb_host_scan(void *opaque, USBScanFunc *func){ FILE *f = 0; DIR *dir = 0; int ret = 0; const char *devices = "/devices"; const char *opened = "husb: opened %s%s\n"; const char *fs_type[] = {"unknown", "proc", "dev", "sys"}; char devpath[PATH_MAX]; /* only check the host once */ if (!usb_fs_type) { f = fopen... |
1 | static void convert_matrix(DSPContext *dsp, int (*qmat)[64], uint16_t (*qmat16)[2][64], const uint16_t *quant_matrix, int bias, int qmin, int qmax, int intra){ int qscale; int shift=0; for(qscale=qmin; qscale<=qmax; qscale++){ int i; if (dsp->fdct == ff_jpeg_fdct_islow #ifdef FAAN_POSTSCALE || dsp->fdct == ff_faandct#e... |
1 | static int process_frame_obj(SANMVideoContext *ctx){ uint16_t codec, top, left, w, h; codec = bytestream2_get_le16u(&ctx->gb); left = bytestream2_get_le16u(&ctx->gb); top = bytestream2_get_le16u(&ctx->gb); w = bytestream2_get_le16u(&ctx->gb); h = bytestream2_get_le16u(&ctx->gb); if (ctx->width < left + w || ctx->height... |
1 | static int tgq_decode_mb(TgqContext *s, AVFrame *frame, int mb_y, int mb_x){ int mode; int i; int8_t dc[6]; mode = bytestream2_get_byte(&s->gb); if (mode > 12) { GetBitContext gb; init_get_bits8(&gb, s->gb.buffer, FFMIN(bytestream2_get_bytes_left(&s->gb), mode)); for (i = 0; i < 6; i++) tgq_decode_block(s, s->block[i],... |
1 | static void stream_component_close(VideoState *is, int stream_index){ AVFormatContext *ic = is->ic; AVCodecContext *avctx; if (stream_index < 0 || stream_index >= ic->nb_streams) return; avctx = ic->streams[stream_index]->codec; switch(avctx->codec_type) { case AVMEDIA_TYPE_AUDIO: packet_queue_abort(&is->audioq); SDL_C... |
1 | void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len, int is_write, hwaddr access_len){ if (buffer != bounce.buffer) { if (is_write) { ram_addr_t addr1 = qemu_ram_addr_from_host_nofail(buffer); while (access_len) { unsigned l; l = TARGET_PAGE_SIZE; if (l > access_len) l = access_len; invalidate_and_set_d... |
1 | static inline void idct4col_put(uint8_t *dest, int line_size, const int16_t *col){ int c0, c1, c2, c3, a0, a1, a2, a3; a0 = col[8*0]; a1 = col[8*2]; a2 = col[8*4]; a3 = col[8*6]; c0 = ((a0 + a2) << (CN_SHIFT - 1)) + (1 << (C_SHIFT - 1)); c2 = ((a0 - a2) << (CN_SHIFT - 1)) + (1 << (C_SHIFT - 1)); c1 = a1 * C1 + a3 * C2;... |
1 | int mmubooke_get_physical_address (CPUState *env, mmu_ctx_t *ctx, target_ulong address, int rw, int access_type){ ppcemb_tlb_t *tlb; target_phys_addr_t raddr; int i, prot, ret; ret = -1; raddr = -1; for (i = 0; i < env->nb_tlb; i++) { tlb = &env->tlb[i].tlbe; if (ppcemb_tlb_check(env, tlb, &raddr, address, env->spr[SPR... |
1 | void fifo_realloc(FifoBuffer *f, int new_size){ int old_size= f->end - f->buffer; if(old_size < new_size){ uint8_t *old= f->buffer; f->buffer= av_realloc(f->buffer, new_size); f->rptr += f->buffer - old; f->wptr += f->buffer - old; if(f->wptr < f->rptr){ memmove(f->rptr + new_size - old_size, f->rptr, f->buffer + old_s... |
1 | FFAMediaCodec* ff_AMediaCodec_createDecoderByType(const char *mime){ JNIEnv *env = NULL; FFAMediaCodec *codec = NULL; jstring mime_type = NULL; codec = av_mallocz(sizeof(FFAMediaCodec)); if (!codec) { return NULL; } codec->class = &amediacodec_class; env = ff_jni_get_env(codec); if (!env) { av_freep(&codec); return NUL... |
1 | int vnc_tls_validate_certificate(VncState *vs){ int ret; unsigned int status; const gnutls_datum_t *certs; unsigned int nCerts, i; time_t now; VNC_DEBUG("Validating client certificate\n"); if ((ret = gnutls_certificate_verify_peers2 (vs->tls.session, &status)) < 0) { VNC_DEBUG("Verify failed %s\n", gnutls_strerror(ret)... |
1 | static void vc1_interp_mc(VC1Context *v){ MpegEncContext *s = &v->s; H264ChromaContext *h264chroma = &v->h264chroma; uint8_t *srcY, *srcU, *srcV; int dxy, mx, my, uvmx, uvmy, src_x, src_y, uvsrc_x, uvsrc_y; int off, off_uv; int v_edge_pos = s->v_edge_pos >> v->field_mode; int use_ic = v->next_use_ic; if (!v->field_mode... |
1 | static int virtio_blk_handle_rw_error(VirtIOBlockReq *req, int error, bool is_read){ BlockErrorAction action = blk_get_error_action(req->dev->blk, is_read, error); VirtIOBlock *s = req->dev; if (action == BLOCK_ERROR_ACTION_STOP) { req->next = s->rq; s->rq = req; } else if (action == BLOCK_ERROR_ACTION_REPORT) { virtio... |
1 | static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_size, int first_field){ static const uint8_t header_prefix[] = { 0x00, 0x00, 0x02, 0x80, 0x01 }; int i, cid; if (buf_size < 0x280) return -1; if (memcmp(buf, header_prefix, 5)) { av_log(ctx->avctx, AV_LOG_ERROR, "error in header\n"); return -... |
1 | static int ogg_write_trailer(AVFormatContext *s){ int i; /* flush current page */ for (i = 0; i < s->nb_streams; i++) ogg_buffer_page(s, s->streams[i]->priv_data); ogg_write_pages(s, 1); for (i = 0; i < s->nb_streams; i++) { AVStream *st = s->streams[i]; OGGStreamContext *oggstream = st->priv_data; if (st->codec->codec... |
1 | static void do_inject_mce(Monitor *mon, const QDict *qdict){ CPUState *cenv; int cpu_index = qdict_get_int(qdict, "cpu_index"); int bank = qdict_get_int(qdict, "bank"); uint64_t status = qdict_get_int(qdict, "status"); uint64_t mcg_status = qdict_get_int(qdict, "mcg_status"); uint64_t addr = qdict_get_int(qdict, "addr"... |
0 | static int avi_sync(AVFormatContext *s, int exit_early){ AVIContext *avi = s->priv_data; AVIOContext *pb = s->pb; int n; unsigned int d[8]; unsigned int size; int64_t i, sync;start_sync: memset(d, -1, sizeof(d)); for (i = sync = avio_tell(pb); !avio_feof(pb); i++) { int j; for (j = 0; j < 7; j++) d[j] = d[j + 1]; d[7] ... |
0 | static int roq_probe(AVProbeData *p){ if (p->buf_size < 6) return 0; if ((AV_RL16(&p->buf[0]) != RoQ_MAGIC_NUMBER) || (AV_RL32(&p->buf[2]) != 0xFFFFFFFF)) return 0; return AVPROBE_SCORE_MAX;} |
0 | inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, const uint8_t *src1, const uint8_t *src2, int srcW, int xInc, const int16_t *hChrFilter, const int16_t *hChrFilterPos, int hChrFilterSize, uint8_t *formatConvBuffer, uint32_t *pal){ src1 += c->chrSrcOffset; src2 += c->chrSrcOffset; if (c->c... |
1 | static int net_init_nic(QemuOpts *opts, const char *name, VLANState *vlan){ int idx; NICInfo *nd; const char *netdev; idx = nic_get_free_idx(); if (idx == -1 || nb_nics >= MAX_NICS) { error_report("Too Many NICs"); return -1; } nd = &nd_table[idx]; memset(nd, 0, sizeof(*nd)); if ((netdev = qemu_opt_get(opts, "netdev"))... |
1 | void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts, int *duration){ int64_t out_pts = AV_NOPTS_VALUE; int removed_samples = 0; int i; if (afq->frame_count || afq->frame_alloc) { if (afq->frames->pts != AV_NOPTS_VALUE) out_pts = afq->frames->pts; } if(!afq->frame_count) av_log(afq->avctx, AV_LOG_... |
1 | static bool qvirtio_pci_get_config_isr_status(QVirtioDevice *d){ QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d; uint32_t data; if (dev->pdev->msix_enabled) { g_assert_cmpint(dev->config_msix_entry, !=, -1); if (qpci_msix_masked(dev->pdev, dev->config_msix_entry)) { /* No ISR checking should be done if masked, but read ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.