label int64 0 1 | func1 stringlengths 23 97k | id int64 0 27.3k |
|---|---|---|
0 | 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 { co_aio_sleep_ns(blk_get_aio_context(jo... | 12,845 |
0 | void mixeng_clear (st_sample_t *buf, int len) { memset (buf, 0, len * sizeof (st_sample_t)); } | 12,847 |
0 | 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->cputimer_bit; } slavio_check_interrup... | 12,848 |
0 | void address_space_init(AddressSpace *as, MemoryRegion *root, const char *name) { if (QTAILQ_EMPTY(&address_spaces)) { memory_init(); } memory_region_transaction_begin(); as->root = root; as->current_map = g_new(FlatView, 1); flatview_init(as->current_map); as->ioeventfd_nb = 0; as->ioeventfds = NULL; QTAILQ_INSERT_TAI... | 12,849 |
0 | int avpriv_dca_parse_core_frame_header(GetBitContext *gb, DCACoreFrameHeader *h) { if (get_bits_long(gb, 32) != DCA_SYNCWORD_CORE_BE) return DCA_PARSE_ERROR_SYNC_WORD; h->normal_frame = get_bits1(gb); h->deficit_samples = get_bits(gb, 5) + 1; if (h->deficit_samples != DCA_PCMBLOCK_SAMPLES) return DCA_PARSE_ERROR_DEFICI... | 12,850 |
0 | static void padzero(unsigned long elf_bss) { unsigned long nbyte; char * fpnt; nbyte = elf_bss & (host_page_size-1); /* was TARGET_PAGE_SIZE - JRP */ if (nbyte) { nbyte = host_page_size - nbyte; fpnt = (char *) elf_bss; do { *fpnt++ = 0; } while (--nbyte); } } | 12,851 |
0 | static int vmdk_open(BlockDriverState *bs, int flags) { int ret; BDRVVmdkState *s = bs->opaque; if (vmdk_open_sparse(bs, bs->file, flags) == 0) { s->desc_offset = 0x200; } else { ret = vmdk_open_desc_file(bs, flags, 0); if (ret) { goto fail; } } /* try to open parent images, if exist */ ret = vmdk_parent_open(bs); if (... | 12,852 |
0 | static void coroutine_fn pdu_complete(V9fsPDU *pdu, ssize_t len) { int8_t id = pdu->id + 1; /* Response */ V9fsState *s = pdu->s; if (len < 0) { int err = -len; len = 7; if (s->proto_version != V9FS_PROTO_2000L) { V9fsString str; str.data = strerror(err); str.size = strlen(str.data); len += pdu_marshal(pdu, len, "s", &... | 12,855 |
0 | 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"); return NULL; } if (qobjec... | 12,856 |
0 | static void gen_rlwnm(DisasContext *ctx) { uint32_t mb, me; mb = MB(ctx->opcode); me = ME(ctx->opcode); if (likely(mb == 0 && me == 31)) { TCGv_i32 t0, t1; t0 = tcg_temp_new_i32(); t1 = tcg_temp_new_i32(); tcg_gen_trunc_tl_i32(t0, cpu_gpr[rB(ctx->opcode)]); tcg_gen_trunc_tl_i32(t1, cpu_gpr[rS(ctx->opcode)]); tcg_gen_an... | 12,857 |
0 | static void test_native_list(TestOutputVisitorData *data, const void *unused, UserDefNativeListUnionKind kind) { UserDefNativeListUnion *cvalue = g_new0(UserDefNativeListUnion, 1); QObject *obj; cvalue->type = kind; init_native_list(cvalue); visit_type_UserDefNativeListUnion(data->ov, NULL, &cvalue, &error_abort); obj ... | 12,858 |
0 | static void FUNCC(pred8x8l_horizontal_add)(uint8_t *_pix, const int16_t *_block, ptrdiff_t stride) { int i; pixel *pix = (pixel*)_pix; const dctcoef *block = (const dctcoef*)_block; stride >>= sizeof(pixel)-1; for(i=0; i<8; i++){ pixel v = pix[-1]; pix[0]= v += block[0]; pix[1]= v += block[1]; pix[2]= v += block[2]; pi... | 12,859 |
0 | static int vtenc_create_encoder(AVCodecContext *avctx, CMVideoCodecType codec_type, CFStringRef profile_level, CFNumberRef gamma_level, CFDictionaryRef enc_info, CFDictionaryRef pixel_buffer_info, VTCompressionSessionRef *session) { VTEncContext *vtctx = avctx->priv_data; SInt32 bit_rate = avctx->bit_rate; CFNumberRef ... | 12,860 |
0 | static av_cold int libspeex_decode_init(AVCodecContext *avctx) { LibSpeexContext *s = avctx->priv_data; const SpeexMode *mode; // defaults in the case of a missing header if (avctx->sample_rate <= 8000) mode = &speex_nb_mode; else if (avctx->sample_rate <= 16000) mode = &speex_wb_mode; else mode = &speex_uwb_mode; if (... | 12,861 |
0 | static int mpegts_set_stream_info(AVStream *st, PESContext *pes, uint32_t stream_type, uint32_t prog_reg_desc) { int old_codec_type= st->codec->codec_type; int old_codec_id = st->codec->codec_id; if (old_codec_id != AV_CODEC_ID_NONE && avcodec_is_open(st->codec)) { av_log(pes->stream, AV_LOG_DEBUG, "cannot set stream i... | 12,863 |
0 | void ff_cavs_init_top_lines(AVSContext *h) { /* alloc top line of predictors */ h->top_qp = av_malloc( h->mb_width); h->top_mv[0] = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector)); h->top_mv[1] = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector)); h->top_pred_Y = av_malloc( h->mb_width*2*sizeof(*h->top_pred_Y)); h->top_... | 12,864 |
0 | static void gen_dmfc0 (CPUState *env, DisasContext *ctx, int reg, int sel) { const char *rn = "invalid"; if (sel != 0) check_insn(env, ctx, ISA_MIPS64); switch (reg) { case 0: switch (sel) { case 0: gen_op_mfc0_index(); rn = "Index"; break; case 1: check_mips_mt(env, ctx); gen_op_mfc0_mvpcontrol(); rn = "MVPControl"; b... | 12,865 |
0 | static BlockBackend *img_open(const char *id, const char *filename, const char *fmt, int flags, bool require_io, bool quiet) { BlockBackend *blk; BlockDriverState *bs; char password[256]; Error *local_err = NULL; QDict *options = NULL; if (fmt) { options = qdict_new(); qdict_put(options, "driver", qstring_from_str(fmt)... | 12,866 |
0 | 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, "setting boot device list fail... | 12,867 |
0 | void restore_state_to_opc(CPUARMState *env, TranslationBlock *tb, int pc_pos) { if (is_a64(env)) { env->pc = tcg_ctx.gen_opc_pc[pc_pos]; } else { env->regs[15] = tcg_ctx.gen_opc_pc[pc_pos]; } env->condexec_bits = gen_opc_condexec_bits[pc_pos]; } | 12,868 |
0 | void kvm_set_phys_mem(target_phys_addr_t start_addr, ram_addr_t size, ram_addr_t phys_offset) { KVMState *s = kvm_state; ram_addr_t flags = phys_offset & ~TARGET_PAGE_MASK; KVMSlot *mem; /* KVM does not support read-only slots */ phys_offset &= ~IO_MEM_ROM; mem = kvm_lookup_slot(s, start_addr); if (mem) { if (flags == ... | 12,870 |
0 | static int virtio_pci_set_host_notifier(void *opaque, int n, bool assign) { VirtIOPCIProxy *proxy = opaque; VirtQueue *vq = virtio_get_queue(proxy->vdev, n); EventNotifier *notifier = virtio_queue_get_host_notifier(vq); int r; if (assign) { r = event_notifier_init(notifier, 1); if (r < 0) { return r; } r = kvm_set_ioev... | 12,872 |
0 | static inline void neon_load_reg64(TCGv var, int reg) { tcg_gen_ld_i64(var, cpu_env, vfp_reg_offset(1, reg)); } | 12,873 |
0 | static void encode_sigpass(Jpeg2000T1Context *t1, int width, int height, int bandno, int *nmsedec, int bpno) { int y0, x, y, mask = 1 << (bpno + NMSEDEC_FRACBITS); for (y0 = 0; y0 < height; y0 += 4) for (x = 0; x < width; x++) for (y = y0; y < height && y < y0+4; y++){ if (!(t1->flags[y+1][x+1] & JPEG2000_T1_SIG) && (t... | 12,874 |
0 | static void qdev_set_legacy_property(DeviceState *dev, Visitor *v, void *opaque, const char *name, Error **errp) { Property *prop = opaque; if (dev->state != DEV_STATE_CREATED) { error_set(errp, QERR_PERMISSION_DENIED); return; } if (prop->info->parse) { Error *local_err = NULL; char *ptr = NULL; visit_type_str(v, &ptr... | 12,875 |
0 | static void channel_load_d(struct fs_dma_ctrl *ctrl, int c) { target_phys_addr_t addr = channel_reg(ctrl, c, RW_SAVED_DATA); /* Load and decode. FIXME: handle endianness. */ D(printf("%s ch=%d addr=" TARGET_FMT_plx "\n", __func__, c, addr)); cpu_physical_memory_read (addr, (void *) &ctrl->channels[c].current_d, sizeof ... | 12,876 |
0 | static int xenfb_map_fb(struct XenFB *xenfb) { struct xenfb_page *page = xenfb->c.page; char *protocol = xenfb->c.xendev.protocol; int n_fbdirs; unsigned long *pgmfns = NULL; unsigned long *fbmfns = NULL; void *map, *pd; int mode, ret = -1; /* default to native */ pd = page->pd; mode = sizeof(unsigned long) * 8; if (!p... | 12,877 |
0 | static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n) { if (n < 32) { GET_REGL(env->active_tc.gpr[n]); } if (env->CP0_Config1 & (1 << CP0C1_FP)) { if (n >= 38 && n < 70) { if (env->CP0_Status & (1 << CP0St_FR)) GET_REGL(env->active_fpu.fpr[n - 38].d); else GET_REGL(env->active_fpu.fpr[n - 38].w[FP_EN... | 12,878 |
0 | static int update_rom_mapping(VAPICROMState *s, CPUX86State *env, target_ulong ip) { target_phys_addr_t paddr; uint32_t rom_state_vaddr; uint32_t pos, patch, offset; /* nothing to do if already activated */ if (s->state == VAPIC_ACTIVE) { return 0; } /* bail out if ROM init code was not executed (missing ROM?) */ if (s... | 12,879 |
0 | void omap_badwidth_write32(void *opaque, target_phys_addr_t addr, uint32_t value) { OMAP_32B_REG(addr); cpu_physical_memory_write(addr, (void *) &value, 4); } | 12,880 |
0 | static void file_put_buffer(void *opaque, const uint8_t *buf, int64_t pos, int size) { QEMUFileStdio *s = opaque; fseek(s->outfile, pos, SEEK_SET); fwrite(buf, 1, size, s->outfile); } | 12,881 |
0 | void qio_channel_socket_connect_async(QIOChannelSocket *ioc, SocketAddress *addr, QIOTaskFunc callback, gpointer opaque, GDestroyNotify destroy) { QIOTask *task = qio_task_new( OBJECT(ioc), callback, opaque, destroy); SocketAddress *addrCopy; addrCopy = QAPI_CLONE(SocketAddress, addr); /* socket_connect() does a non-bl... | 12,882 |
0 | connect_to_qemu( const char *host, const char *port ) { struct addrinfo hints; struct addrinfo *server; int ret, sock; sock = qemu_socket(AF_INET, SOCK_STREAM, 0); if (sock < 0) { /* Error */ fprintf(stderr, "Error opening socket!\n"); return -1; } memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC... | 12,883 |
0 | 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); } | 12,884 |
0 | static int escape(char **dst, const char *src, const char *special_chars, enum EscapeMode mode) { AVBPrint dstbuf; av_bprint_init(&dstbuf, 1, AV_BPRINT_SIZE_UNLIMITED); switch (mode) { case ESCAPE_MODE_FULL: case ESCAPE_MODE_LAZY: /* \-escape characters */ if (mode == ESCAPE_MODE_LAZY && strchr(WHITESPACES, *src)) av_b... | 12,885 |
0 | static void spapr_machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(oc); FWPathProviderClass *fwc = FW_PATH_PROVIDER_CLASS(oc); NMIClass *nc = NMI_CLASS(oc); HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc); mc->desc = "pSeries Logica... | 12,886 |
0 | 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); } | 12,888 |
0 | void gen_intermediate_code(CPUSH4State * env, struct TranslationBlock *tb) { SuperHCPU *cpu = sh_env_get_cpu(env); CPUState *cs = CPU(cpu); DisasContext ctx; target_ulong pc_start; int num_insns; int max_insns; pc_start = tb->pc; ctx.pc = pc_start; ctx.tbflags = (uint32_t)tb->flags; ctx.envflags = tb->flags & DELAY_SLO... | 12,889 |
0 | void OPPROTO op_cli(void) { raise_exception(EXCP0D_GPF); } | 12,890 |
0 | 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, 0xffff); } if (type == TCG_TYPE_I32) { t... | 12,891 |
0 | void mips_malta_init(QEMUMachineInitArgs *args) { ram_addr_t ram_size = args->ram_size; const char *cpu_model = args->cpu_model; const char *kernel_filename = args->kernel_filename; const char *kernel_cmdline = args->kernel_cmdline; const char *initrd_filename = args->initrd_filename; char *filename; pflash_t *fl; Memo... | 12,892 |
0 | static void test_pci_enable(void) { AHCIQState *ahci; ahci = ahci_boot(); ahci_pci_enable(ahci); ahci_shutdown(ahci); } | 12,893 |
0 | 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(&psinfo->pr_psargs, ts->info... | 12,895 |
0 | 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); } | 12,896 |
0 | static TileExcp decode_y0(DisasContext *dc, tilegx_bundle_bits bundle) { unsigned opc = get_Opcode_Y0(bundle); unsigned ext = get_RRROpcodeExtension_Y0(bundle); unsigned dest = get_Dest_Y0(bundle); unsigned srca = get_SrcA_Y0(bundle); unsigned srcb; int imm; switch (opc) { case RRR_1_OPCODE_Y0: if (ext == UNARY_RRR_1_O... | 12,897 |
0 | void ioinst_handle_schm(S390CPU *cpu, uint64_t reg1, uint64_t reg2, uint32_t ipb) { uint8_t mbk; int update; int dct; CPUS390XState *env = &cpu->env; trace_ioinst("schm"); if (SCHM_REG1_RES(reg1)) { program_interrupt(env, PGM_OPERAND, 2); return; } mbk = SCHM_REG1_MBK(reg1); update = SCHM_REG1_UPD(reg1); dct = SCHM_REG... | 12,898 |
0 | QPCIBus *qpci_init_spapr(QGuestAllocator *alloc) { QPCIBusSPAPR *ret; ret = g_malloc(sizeof(*ret)); ret->alloc = alloc; ret->bus.io_readb = qpci_spapr_io_readb; ret->bus.io_readw = qpci_spapr_io_readw; ret->bus.io_readl = qpci_spapr_io_readl; ret->bus.io_writeb = qpci_spapr_io_writeb; ret->bus.io_writew = qpci_spapr_io... | 12,899 |
0 | static void icount_warp_rt(void *opaque) { if (vm_clock_warp_start == -1) { return; } if (runstate_is_running()) { int64_t clock = qemu_clock_get_ns(QEMU_CLOCK_REALTIME); int64_t warp_delta = clock - vm_clock_warp_start; if (use_icount == 1) { qemu_icount_bias += warp_delta; } else { /* * In adaptive mode, do not let Q... | 12,900 |
0 | static abi_long do_sendrecvmsg(int fd, abi_ulong target_msg, int flags, int send) { abi_long ret, len; struct target_msghdr *msgp; struct msghdr msg; int count; struct iovec *vec; abi_ulong target_vec; /* FIXME */ if (!lock_user_struct(send ? VERIFY_READ : VERIFY_WRITE, msgp, target_msg, send ? 1 : 0)) return -TARGET_E... | 12,901 |
1 | void av_image_copy_plane(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int bytewidth, int height) { if (!dst || !src) return; for (;height > 0; height--) { memcpy(dst, src, bytewidth); dst += dst_linesize; src += src_linesize; } } | 12,902 |
1 | static int latm_decode_frame(AVCodecContext *avctx, void *out, int *got_frame_ptr, AVPacket *avpkt) { struct LATMContext *latmctx = avctx->priv_data; int muxlength, err; GetBitContext gb; if ((err = init_get_bits8(&gb, avpkt->data, avpkt->size)) < 0) return err; // check for LOAS sync word if (get_bits(&gb, 11) != LOAS... | 12,903 |
1 | static int ioreq_runio_qemu_aio(struct ioreq *ioreq) { struct XenBlkDev *blkdev = ioreq->blkdev; if (ioreq->req.nr_segments && ioreq_map(ioreq) == -1) goto err; ioreq->aio_inflight++; if (ioreq->presync) bdrv_flush(blkdev->bs); /* FIXME: aio_flush() ??? */ switch (ioreq->req.operation) { case BLKIF_OP_READ: ioreq->aio_... | 12,904 |
1 | 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_LOG_ERROR, "buffer smaller than minimum size\n"); return -1; } av_init_packet(&pkt); pkt.data = buf; pkt.siz... | 12,905 |
1 | static void spapr_pci_pre_save(void *opaque) { sPAPRPHBState *sphb = opaque; GHashTableIter iter; gpointer key, value; int i; g_free(sphb->msi_devs); sphb->msi_devs = NULL; sphb->msi_devs_num = g_hash_table_size(sphb->msi); if (!sphb->msi_devs_num) { return; } sphb->msi_devs = g_malloc(sphb->msi_devs_num * sizeof(spapr... | 12,906 |
1 | static void print_report(AVFormatContext **output_files, AVOutputStream **ost_table, int nb_ostreams, int is_last_report) { char buf[1024]; AVOutputStream *ost; AVFormatContext *oc, *os; int64_t total_size; AVCodecContext *enc; int frame_number, vid, i; double bitrate, ti1, pts; static int64_t last_time = -1; static in... | 12,907 |
1 | static void decode_opc(DisasContext * ctx) { uint32_t old_flags = ctx->envflags; _decode_opc(ctx); if (old_flags & DELAY_SLOT_MASK) { /* go out of the delay slot */ ctx->envflags &= ~DELAY_SLOT_MASK; tcg_gen_movi_i32(cpu_flags, ctx->envflags); ctx->bstate = BS_BRANCH; if (old_flags & DELAY_SLOT_CONDITIONAL) { gen_delay... | 12,908 |
1 | 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 Only */ return; case CONTROL_OFFSET: /* Not... | 12,909 |
1 | static void vhost_set_memory(MemoryListener *listener, MemoryRegionSection *section, bool add) { struct vhost_dev *dev = container_of(listener, struct vhost_dev, memory_listener); hwaddr start_addr = section->offset_within_address_space; ram_addr_t size = int128_get64(section->size); bool log_dirty = memory_region_get_... | 12,910 |
1 | void do_tw (int flags) { if (!likely(!((Ts0 < Ts1 && (flags & 0x10)) || (Ts0 > Ts1 && (flags & 0x08)) || (Ts0 == Ts1 && (flags & 0x04)) || (T0 < T1 && (flags & 0x02)) || (T0 > T1 && (flags & 0x01))))) do_raise_exception_err(EXCP_PROGRAM, EXCP_TRAP); } | 12,911 |
0 | static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MSS2Context *ctx = avctx->priv_data; MSS12Context *c = &ctx->c; AVFrame *frame = data; GetBitContext gb; GetByteContext gB; ArithCoder acoder; int keyframe, ha... | 12,912 |
1 | static int output_packet(InputStream *ist, int ist_index, OutputStream *ost_table, int nb_ostreams, const AVPacket *pkt) { AVFormatContext *os; OutputStream *ost; int ret, i; int got_output; void *buffer_to_free = NULL; static unsigned int samples_size= 0; AVSubtitle subtitle, *subtitle_to_free; int64_t pkt_pts = AV_NO... | 12,913 |
1 | void wdt_i6300esb_init(void) { watchdog_add_model(&model); } | 12,914 |
1 | static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, UINT8 * buf, int buf_size) { MPADecodeContext *s = avctx->priv_data; UINT32 header; UINT8 *buf_ptr; int len, out_size; short *out_samples = data; *data_size = 0; buf_ptr = buf; while (buf_size > 0) { len = s->inbuf_ptr - s->inbuf; if (s->frame_... | 12,915 |
0 | static int mpegps_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp) { int64_t pos_min, pos_max, pos; int64_t dts_min, dts_max, dts; timestamp = (timestamp * 90000) / AV_TIME_BASE; #ifdef DEBUG_SEEK printf("read_seek: %d %0.3f\n", stream_index, timestamp / 90000.0); #endif /* XXX: find stream_index by l... | 12,917 |
0 | static void dxva2_uninit(AVCodecContext *s) { InputStream *ist = s->opaque; DXVA2Context *ctx = ist->hwaccel_ctx; ist->hwaccel_uninit = NULL; ist->hwaccel_get_buffer = NULL; ist->hwaccel_retrieve_data = NULL; if (ctx->decoder_service) IDirectXVideoDecoderService_Release(ctx->decoder_service); av_buffer_unref(&ctx->hw_f... | 12,918 |
0 | 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->twopassbuffer) { av_free(x->... | 12,919 |
1 | 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 = 0; test_cases[i].encoded; i++) { QObject *obj; QSt... | 12,920 |
1 | static void calculate_code_lengths(uint8_t *lengths, uint32_t *counts) { uint32_t nr_nodes, nr_heap, node1, node2; int i, j; int32_t k; /* Heap and node entries start from 1 */ uint32_t weights[512]; uint32_t heap[512]; int32_t parents[512]; /* Set initial weights */ for (i = 0; i < 256; i++) weights[i + 1] = (counts[i... | 12,922 |
1 | static av_always_inline void autocorrelate(const int x[40][2], SoftFloat phi[3][2][2], int lag) { int i; int64_t real_sum, imag_sum; int64_t accu_re = 0, accu_im = 0; if (lag) { for (i = 1; i < 38; i++) { accu_re += (int64_t)x[i][0] * x[i+lag][0]; accu_re += (int64_t)x[i][1] * x[i+lag][1]; accu_im += (int64_t)x[i][0] *... | 12,923 |
1 | 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_tell(s->pb) < oc->content_start) goto wipe; if ((e... | 12,924 |
1 | 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_get_attached_dev(blk); if (ds) { blk_det... | 12,925 |
1 | int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src) { const AVCodec *orig_codec = dest->codec; uint8_t *orig_priv_data = dest->priv_data; if (avcodec_is_open(dest)) { // check that the dest context is uninitialized av_log(dest, AV_LOG_ERROR, "Tried to copy AVCodecContext %p into already-initialize... | 12,926 |
0 | static int ftp_open(URLContext *h, const char *url, int flags) { char proto[10], path[MAX_URL_SIZE]; int err; FTPContext *s = h->priv_data; av_dlog(h, "ftp protocol open\n"); s->state = DISCONNECTED; s->filesize = -1; s->position = 0; av_url_split(proto, sizeof(proto), s->credencials, sizeof(s->credencials), s->hostnam... | 12,928 |
1 | static void vnc_convert_pixel(VncState *vs, uint8_t *buf, uint32_t v) { uint8_t r, g, b; r = ((v >> vs->server_red_shift) & vs->server_red_max) * (vs->client_red_max + 1) / (vs->server_red_max + 1); g = ((v >> vs->server_green_shift) & vs->server_green_max) * (vs->client_green_max + 1) / (vs->server_green_max + 1); b =... | 12,929 |
1 | static int thread_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs) { ThreadContext *c = ctx->graph->internal->thread; int dummy_ret; if (nb_jobs <= 0) return 0; pthread_mutex_lock(&c->current_job_lock); c->current_job = c->nb_threads; c->nb_jobs = nb_jobs; c->ctx = ctx; c->arg... | 12,930 |
1 | static int asf_read_payload(AVFormatContext *s, AVPacket *pkt) { ASFContext *asf = s->priv_data; AVIOContext *pb = s->pb; int ret, i; ASFPacket *asf_pkt = NULL; if (!asf->sub_left) { uint32_t off_len, media_len; uint8_t stream_num; stream_num = avio_r8(pb); asf->stream_index = stream_num & ASF_STREAM_NUM; for (i = 0; i... | 12,931 |
1 | 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++){ ((uint32_t*)(src+i*stride))[0]= dc0; ((uint32_t*)(src+i*stride))[1]= dc0; } for(i... | 12,932 |
0 | static int set_expr(AVExpr **pexpr, const char *expr, void *log_ctx) { int ret; AVExpr *old = NULL; if (*pexpr) old = *pexpr; ret = av_expr_parse(pexpr, expr, var_names, NULL, NULL, NULL, NULL, 0, log_ctx); if (ret < 0) { av_log(log_ctx, AV_LOG_ERROR, "Error when evaluating the expression '%s'\n", expr); *pexpr = old; ... | 12,933 |
0 | static void av_estimate_timings_from_pts(AVFormatContext *ic, offset_t old_offset) { AVPacket pkt1, *pkt = &pkt1; AVStream *st; int read_size, i, ret; int64_t end_time; int64_t filesize, offset, duration; /* free previous packet */ if (ic->cur_st && ic->cur_st->parser) av_free_packet(&ic->cur_pkt); ic->cur_st = NULL; /... | 12,934 |
0 | static inline void RENAME(rgb32tobgr16)(const uint8_t *src, uint8_t *dst, unsigned int src_size) { const uint8_t *s = src; const uint8_t *end; #ifdef HAVE_MMX const uint8_t *mm_end; #endif uint16_t *d = (uint16_t *)dst; end = s + src_size; #ifdef HAVE_MMX __asm __volatile(PREFETCH" %0"::"m"(*src):"memory"); __asm __vol... | 12,935 |
0 | static int dv_read_header(AVFormatContext *s, AVFormatParameters *ap) { RawDVContext *c = s->priv_data; c->dv_demux = dv_init_demux(s); return c->dv_demux ? 0 : -1; } | 12,937 |
1 | static void vfio_map_bar(VFIOPCIDevice *vdev, int nr) { VFIOBAR *bar = &vdev->bars[nr]; uint64_t size = bar->region.size; char name[64]; uint32_t pci_bar; uint8_t type; int ret; /* Skip both unimplemented BARs and the upper half of 64bit BARS. */ if (!size) { return; } snprintf(name, sizeof(name), "VFIO %04x:%02x:%02x.... | 12,939 |
1 | static void cpu_common_reset(CPUState *cpu) { CPUClass *cc = CPU_GET_CLASS(cpu); int i; if (qemu_loglevel_mask(CPU_LOG_RESET)) { qemu_log("CPU Reset (CPU %d)\n", cpu->cpu_index); log_cpu_state(cpu, cc->reset_dump_flags); } cpu->interrupt_request = 0; cpu->halted = 0; cpu->mem_io_pc = 0; cpu->mem_io_vaddr = 0; cpu->icou... | 12,941 |
1 | 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); } | 12,942 |
1 | int ff_rtsp_connect(AVFormatContext *s) { RTSPState *rt = s->priv_data; char host[1024], path[1024], tcpname[1024], cmd[2048], auth[128]; char *option_list, *option, *filename; URLContext *rtsp_hd, *rtsp_hd_out; int port, err, tcp_fd; RTSPMessageHeader reply1 = {}, *reply = &reply1; int lower_transport_mask = 0; char r... | 12,943 |
1 | static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts) { ASFContext *asf = s->priv_data; AVStream *st; AVPacket pkt1, *pkt; int block_align; int64_t pos; int64_t pos_min, pos_max, pts_min, pts_max, cur_pts; pkt = &pkt1; // Validate pts if (pts < 0) pts = 0; if (stream_index == -1) stream_index= av_... | 12,944 |
1 | static void decode_src_opc(CPUTriCoreState *env, DisasContext *ctx, int op1) { int r1; int32_t const4; TCGv temp, temp2; r1 = MASK_OP_SRC_S1D(ctx->opcode); const4 = MASK_OP_SRC_CONST4_SEXT(ctx->opcode); switch (op1) { case OPC1_16_SRC_ADD: gen_addi_d(cpu_gpr_d[r1], cpu_gpr_d[r1], const4); break; case OPC1_16_SRC_ADD_A1... | 12,945 |
1 | int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, unsigned char **data) { if (s->buf_end - s->buf_ptr >= size && !s->write_flag) { *data = s->buf_ptr; s->buf_ptr += size; return size; } else { *data = buf; return avio_read(s, buf, size); } } | 12,947 |
0 | int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut **open_inputs_ptr, AVFilterInOut **open_outputs_ptr, void *log_ctx) { int index = 0, ret = 0; char chr = 0; AVFilterInOut *curr_inputs = NULL; AVFilterInOut *open_inputs = open_inputs_ptr ? *open_inputs_ptr : NULL; AVFilterInOut *open_out... | 12,948 |
1 | static inline int vorbis_residue_decode(vorbis_context *vc, vorbis_residue *vr, unsigned ch, uint8_t *do_not_decode, float *vec, unsigned vlen) { if (vr->type == 2) return vorbis_residue_decode_internal(vc, vr, ch, do_not_decode, vec, vlen, 2); else if (vr->type == 1) return vorbis_residue_decode_internal(vc, vr, ch, d... | 12,950 |
1 | 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); } } | 12,952 |
1 | static av_cold int ape_decode_close(AVCodecContext * avctx) { APEContext *s = avctx->priv_data; int i; for (i = 0; i < APE_FILTER_LEVELS; i++) av_freep(&s->filterbuf[i]); av_freep(&s->data); return 0; } | 12,953 |
1 | static int qemu_chr_open_file_out(QemuOpts *opts, CharDriverState **_chr) { int fd_out; TFR(fd_out = qemu_open(qemu_opt_get(opts, "path"), O_WRONLY | O_TRUNC | O_CREAT | O_BINARY, 0666)); if (fd_out < 0) { return -errno; } *_chr = qemu_chr_open_fd(-1, fd_out); return 0; } | 12,954 |
1 | 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) return -1; if (xenstor... | 12,955 |
1 | static void writer_close(WriterContext **wctx) { int i; if (!*wctx) return; if ((*wctx)->writer->uninit) (*wctx)->writer->uninit(*wctx); for (i = 0; i < SECTION_MAX_NB_LEVELS; i++) av_bprint_finalize(&(*wctx)->section_pbuf[i], NULL); if ((*wctx)->writer->priv_class) av_opt_free((*wctx)->priv); av_freep(&((*wctx)->priv)... | 12,956 |
0 | static int avi_read_tag(AVFormatContext *s, AVStream *st, uint32_t tag, uint32_t size) { AVIOContext *pb = s->pb; char key[5] = {0}, *value; size += (size & 1); if (size == UINT_MAX) return -1; value = av_malloc(size+1); if (!value) return -1; avio_read(pb, value, size); value[size]=0; AV_WL32(key, tag); return av_dict... | 12,957 |
1 | 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); } } | 12,958 |
1 | static inline void RENAME(nvXXtoUV)(uint8_t *dst1, uint8_t *dst2, const uint8_t *src, int width) { #if COMPILE_TEMPLATE_MMX __asm__ volatile( "movq "MANGLE(bm01010101)", %%mm4 \n\t" "mov %0, %%"REG_a" \n\t" "1: \n\t" "movq (%1, %%"REG_a",2), %%mm0 \n\t" "movq 8(%1, %%"REG_a",2), %%mm1 \n\t" "movq %%mm0, %%mm2 \n\t" "mo... | 12,959 |
1 | static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy) { int i; dst->key_frame = src->key_frame; dst->pict_type = src->pict_type; dst->sample_aspect_ratio = src->sample_aspect_ratio; dst->pts = src->pts; dst->repeat_pict = src->repeat_pict; dst->interlaced_frame = src->interlaced_frame; dst->top_... | 12,960 |
1 | 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) { break; } switch(c) { case '?': case '... | 12,961 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.