Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
FFmpeg
libavcodec/common.c
static int mpeg1_decode_picture(AVCodecContext *avctx, UINT8 *buf, int buf_size) { Mpeg1Context *s1 = avctx->priv_data; MpegEncContext *s = &s1->mpeg_enc_ctx; int ref, f_code; init_get_bits(&s->gb, buf, buf_size); ref = get_bits(&s->gb, 10); /* temporal ref */ s->pict...
[ 1, 0 ]
FFmpeg
libavcodec/mpeg12.c
static int mpeg1_find_frame_end(MpegEncContext *s, uint8_t *buf, int buf_size) { ParseContext *pc = &s->parse_context; int i; uint32_t state; state = pc->state; i = 0; if (!pc->frame_start_found) { for (i = 0; i < buf_size; i++) { state = (state << 8) | buf[i]; if (state >= SLICE_MI...
[ 1, 0 ]
FFmpeg
libavcodec/ac3dec.c
static inline int16_t calc_lowcomp(int16_t a, int16_t b0, int16_t b1, uint8_t bin) { if (bin < 7) { if ((b0 + 256) == b1) a = 384; else if (b0 > b1) a = FFMAX(0, a - 64); } else if (bin < 20) { if ((b0 + 256) == b1) a = 320; else if (...
[ 0, 0 ]
FFmpeg
libavcodec/celp_filters.c
void ff_celp_lp_synthesis_filterf(float *out, const float *filter_coeffs, const float *in, int buffer_length, int filter_length) { int i, n; // Avoids a +1 in the inner loop...
[ 0, 0 ]
FFmpeg
libavcodec/gifdec.c
static void gif_copy_img_rect(const uint32_t *src, uint32_t *dst, int linesize, int l, int t, int w, int h) { const int y_start = t * linesize; const uint32_t *src_px, *src_pr, *src_py = src + y_start, *dst_py = dst + y_start; const uint32_t *src_pb = src_py + t * ...
[ 1, 0 ]
qemu
include/sysemu/kvm.h
int kvm_has_xcrs(void) { return kvm_state->xcrs; }
[ 0, 0 ]
qemu
linux-user/syscall.c
static int open_self_cmdline(void *cpu_env, int fd) { int fd_orig = -1; bool word_skipped = false; fd_orig = open("/proc/self/cmdline", O_RDONLY); if (fd_orig < 0) { return fd_orig; } while (true) { ssize_t nb_read; char buf[128]; char *cp_buf = buf; nb_read = read(fd_orig, bu...
[ 1, 0 ]
qemu
hw/i386/intel_iommu.c
static void vtd_context_device_invalidate(IntelIOMMUState *s, uint16_t source_id, uint16_t func_mask) { uint16_t mask; VTDAddressSpace **pvtd_as; VTDAddressSpace *vtd_as; uint16_t devfn; uint16_t devfn_it; switch (f...
[ 1, 0 ]
qemu
block/nbd.c
static void tcp_chr_tls_init(Chardev *chr) { SocketChardev *s = SOCKET_CHARDEV(chr); QIOChannelTLS *tioc; Error *err = NULL; gchar *name; if (s->is_listen) { tioc = qio_channel_tls_new_server( s->ioc, s->tls_creds, NULL, /* XXX Use an ACL */ &err); } else { tioc =...
[ 1, 1 ]
FFmpeg
libavfilter/vf_libopencv.c
static av_cold int dilate_init(AVFilterContext *ctx, const char *args) { OCVContext *ocv = ctx->priv; DilateContext *dilate = ocv->priv; char default_kernel_str[] = "3x3+0x0/rect"; char *kernel_str; const char *buf = args; int ret; dilate->nb_iterations = 1; if (args) kernel_str = av_get_t...
[ 1, 0 ]
qemu
Makefile.objs
static int qemu_rdma_init_ram_blocks(RDMAContext *rdma) { RDMALocalBlocks *local = &rdma->local_ram_blocks; assert(rdma->blockmap == NULL); rdma->blockmap = g_hash_table_new(g_direct_hash, g_direct_equal); memset(local, 0, sizeof *local); qemu_ram_foreach_block(qemu_rdma_init_one_block, rdma); DPRINT...
[ 1, 0 ]
FFmpeg
libavcodec/hevc_cabac.c
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)) ...
[ 1, 0 ]
qemu
hw/vhost.c
static void vhost_dev_sync_region(struct vhost_dev *dev, MemoryRegionSection *section, uint64_t mfirst, uint64_t mlast, uint64_t rfirst, uint64_t rlast) { uint64_t start = MAX(mfirst, rfirst); uint64_t end = ...
[ 1, 0 ]
FFmpeg
libavformat/cafenc.c
static int caf_write_trailer(AVFormatContext *s) { AVIOContext *pb = s->pb; AVCodecContext *enc = s->streams[0]->codec; if (pb->seekable) { CAFContext *caf = s->priv_data; int64_t file_size = avio_tell(pb); avio_seek(pb, caf->data, SEEK_SET); avio_wb64(pb, file_size - caf->data - 8); ...
[ 1, 0 ]
qemu
target-ppc/cpu.h
static void init_proc_970GX(CPUPPCState *env) { gen_spr_ne_601(env); gen_spr_7xx(env); /* Time base */ gen_tbl(env); /* Hardware implementation registers */ /* XXX : not implemented */ spr_register(env, SPR_HID0, "HID0", SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic...
[ 1, 1 ]
FFmpeg
libavcodec/mjpegdec.c
static int find_marker(const uint8_t **pbuf_ptr, const uint8_t *buf_end) { const uint8_t *buf_ptr; unsigned int v, v2; int val; int skipped = 0; buf_ptr = *pbuf_ptr; while (buf_ptr < buf_end) { v = *buf_ptr++; v2 = *buf_ptr; if ((v == 0xff) && (v2 >= 0xc0) && (v2 <= 0xfe) && buf_ptr < ...
[ 1, 0 ]
qemu
hw/pci.c
static int get_pci_config_device(QEMUFile *f, void *pv, size_t size) { PCIDevice *s = container_of(pv, PCIDevice, config); uint8_t config[size]; int i; qemu_get_buffer(f, config, size); for (i = 0; i < size; ++i) if ((config[i] ^ s->config[i]) & s->cmask[i] & ~s->wmask[i]) return -EINVAL; ...
[ 1, 0 ]
FFmpeg
doc/APIchanges
static int segment_hls_window(AVFormatContext *s, int last) { SegmentContext *seg = s->priv_data; int i, ret = 0; char buf[1024]; if ((ret = avio_open2(&seg->pb, seg->list, AVIO_FLAG_WRITE, &s->interrupt_callback, NULL)) < 0) goto fail; avio_printf(seg->pb, "#EXTM3U\n"); ...
[ 1, 0 ]
FFmpeg
libavcodec/mips/aaccoder_mips.c
void ff_aac_coder_init_mips(AACEncContext *c) { #if HAVE_INLINE_ASM AACCoefficientsEncoder *e = c->coder; int option = c->options.aac_coder; if (option == 2) { e->quantize_and_encode_band = quantize_and_encode_band_mips; e->encode_window_bands_info = codebook_trellis_rate; #if HAVE_MIPSFPU e->...
[ 1, 0 ]
FFmpeg
libavcodec/j2kdec.c
static int get_cox(J2kDecoderContext *s, J2kCodingStyle *c) { if (s->buf_end - s->buf < 5) return AVERROR(EINVAL); c->nreslevels = bytestream_get_byte(&s->buf) + 1; // num of resolution levels - 1 c->log2_cblk_width = bytestream_get_byte(&s->buf) + 2; // cblk width c->log2_cblk_height = bytestre...
[ 1, 0 ]
qemu
qapi/qmp-input-visitor.c
QFloat *qobject_to_qfloat(const QObject *obj) { if (qobject_type(obj) != QTYPE_QFLOAT) return NULL; return container_of(obj, QFloat, base); }
[ 1, 0 ]
qemu
hw/xen_disk.c
static struct ioreq *ioreq_start(struct XenBlkDev *blkdev) { struct ioreq *ioreq = NULL; if (QLIST_EMPTY(&blkdev->freelist)) { if (blkdev->requests_total >= max_requests) { goto out; } /* allocate new struct */ ioreq = g_malloc0(sizeof(*ioreq)); ioreq->blkdev = blkdev; blkdev-...
[ 1, 0 ]
qemu
linux-user/main.c
static void gen_mfdcr(DisasContext *ctx) { #if defined(CONFIG_USER_ONLY) gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG); #else TCGv dcrn; if (unlikely(ctx->pr)) { gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG); return; } /* NIP cannot be restored if the memory exception comes from an helper...
[ 1, 0 ]
FFmpeg
libavcodec/libgsm.c
static av_cold int libgsm_init(AVCodecContext *avctx) { if (avctx->channels > 1) { av_log(avctx, AV_LOG_ERROR, "Mono required for GSM, got %d channels\n", avctx->channels); return -1; } if (avctx->codec->decode) { if (!avctx->channels) avctx->channels = 1; if (!avctx->samp...
[ 1, 0 ]
FFmpeg
libavcodec/truemotion1.c
static av_cold int truemotion1_decode_init(AVCodecContext *avctx) { TrueMotion1Context *s = avctx->priv_data; s->avctx = avctx; // FIXME: it may change ? // if (avctx->bits_per_sample == 24) // avctx->pix_fmt = AV_PIX_FMT_RGB24; // else // avctx->pix_fmt = AV_PIX_FMT_RGB555; ...
[ 1, 1 ]
qemu
target-tricore/op_helper.c
static uint32_t suov32(CPUTriCoreState *env, int64_t arg) { uint32_t ret; int64_t max_pos = UINT32_MAX; if (arg > max_pos) { env->PSW_USB_V = (1 << 31); env->PSW_USB_SV = (1 << 31); ret = (target_ulong)max_pos; } else { if (arg < 0) { env->PSW_USB_V = (1 << 31); env->PSW_U...
[ 1, 0 ]
qemu
target-arm/helper.c
static int get_S2prot(CPUARMState *env, int s2ap, int xn) { int prot = 0; if (s2ap & 1) { prot |= PAGE_READ; } if (s2ap & 2) { prot |= PAGE_WRITE; } if (!xn) { prot |= PAGE_EXEC; } return prot; }
[ 1, 0 ]
qemu
linux-user/signal.c
restore_sigcontext(CPUX86State *env, struct target_sigcontext *sc, int *peax) { unsigned int err = 0; abi_ulong fpstate_addr; unsigned int tmpflags; cpu_x86_load_seg(env, R_GS, tswap16(sc->gs)); cpu_x86_load_seg(env, R_FS, tswap16(sc->fs)); cpu_x86_load_seg(env, R_ES, tswap16(sc->es)); cpu_x86_loa...
[ 1, 0 ]
qemu
hw/9pfs/9p-local.c
static ssize_t local_readlink(FsContext *fs_ctx, V9fsPath *fs_path, char *buf, size_t bufsz) { ssize_t tsize = -1; char *buffer; char *path = fs_path->data; if ((fs_ctx->export_flags & V9FS_SM_MAPPED) || (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE)) { int fd; ...
[ 1, 0 ]
qemu
include/ui/console.h
static void vnc_dpy_resize(DisplayChangeListener *dcl, DisplayState *ds) { VncDisplay *vd = ds->opaque; VncState *vs; vnc_abort_display_jobs(vd); /* server surface */ qemu_pixman_image_unref(vd->server); vd->server = pixman_image_create_bits(VNC_SERVER_FB_FORMAT, ...
[ 1, 1 ]
qemu
include/qemu/hbitmap.h
void hbitmap_iter_init(HBitmapIter *hbi, const HBitmap *hb, uint64_t first) { unsigned i, bit; uint64_t pos; hbi->hb = hb; pos = first >> hb->granularity; hbi->pos = pos >> BITS_PER_LEVEL; hbi->granularity = hb->granularity; for (i = HBITMAP_LEVELS; i-- > 0;) { bit = pos & (BITS_PER_LONG - 1)...
[ 1, 0 ]
FFmpeg
ffserver.c
static void extract_mpeg4_header(AVFormatContext *infile) { int mpeg4_count, i, size; AVPacket pkt; AVStream *st; const uint8_t *p; mpeg4_count = 0; for (i = 0; i < infile->nb_streams; i++) { st = infile->streams[i]; if (st->codec.codec_id == CODEC_ID_MPEG4 && st->codec.extradata_s...
[ 1, 1 ]
FFmpeg
doc/APIchanges
void avfilter_unref_buffer(AVFilterBufferRef *ref) { if (!ref) return; av_assert0(ref->buf->refcount > 0); if (!(--ref->buf->refcount)) { if (!ref->buf->free) { store_in_pool(ref); return; } ref->buf->free(ref->buf); } if (ref->extended_data != ref->data) av_freep(&r...
[ 1, 0 ]
qemu
block/qcow2.c
static int qcow2_make_empty(BlockDriverState *bs) { BDRVQcow2State *s = bs->opaque; uint64_t offset, end_offset; int step = QEMU_ALIGN_DOWN(INT_MAX, s->cluster_size); int l1_clusters, ret = 0; l1_clusters = DIV_ROUND_UP(s->l1_size, s->cluster_size / sizeof(uint64_t)); if (s->qcow_version >= 3 && !s->...
[ 1, 0 ]
FFmpeg
libavcodec/dsputil.c
static inline void FUNC(idctSparseColAdd)(pixel *dest, int line_size, DCTELEM *col) { int a0, a1, a2, a3, b0, b1, b2, b3; INIT_CLIP; IDCT_COLS; dest[0] = CLIP(dest[0] + ((a0 + b0) >> COL_SHIFT)); dest += line_size; dest[0] = CLIP(dest[0] + ((a1 + b1) >> COL_...
[ 1, 0 ]
qemu
buffered_file.c
static void text_console_do_init(CharDriverState *chr, DisplayState *ds) { TextConsole *s; static int color_inited; s = chr->opaque; chr->chr_write = console_puts; chr->chr_send_event = console_send_event; s->out_fifo.buf = s->out_fifo_buf; s->out_fifo.buf_size = sizeof(s->out_fifo_buf); s->kbd...
[ 1, 0 ]
qemu
hw/usb-bt.c
static int usb_bt_initfn(USBDevice *dev) { struct USBBtState *s = DO_UPCAST(struct USBBtState, dev, dev); s->dev.speed = USB_SPEED_HIGH; return 0; }
[ 0, 0 ]
qemu
linux-user/main.c
static void gen_dcbi(DisasContext *ctx) { #if defined(CONFIG_USER_ONLY) gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); #else TCGv EA, val; if (unlikely(ctx->pr)) { gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); return; } EA = tcg_temp_new(); gen_set_access_type(ctx, ACCESS_CACHE); g...
[ 1, 1 ]
qemu
tests/boot-order-test.c
static int setup_common(char *argv[], int argv_sz) { memset(cur_ide, 0, sizeof(cur_ide)); return append_arg(0, argv, argv_sz, g_strdup("-nodefaults -display none")); }
[ 1, 0 ]
qemu
tests/e1000e-test.c
void qvirtio_pci_set_msix_configuration_vector(QVirtioPCIDevice *d, QGuestAllocator *alloc, uint16_t entry) { uint16_t vector; uint32_t control; void *addr; g_assert(d->pdev->msix_enabled); addr = d->pdev->msi...
[ 1, 0 ]
qemu
cpu-exec.c
uint32_t HELPER(get_cp_reg)(CPUARMState *env, void *rip) { const ARMCPRegInfo *ri = rip; return ri->readfn(env, ri); }
[ 1, 0 ]
qemu
linux-user/mips/target_cpu.h
static void gen_rdhwr(DisasContext *ctx, int rt, int rd) { TCGv t0; #if !defined(CONFIG_USER_ONLY) /* The Linux kernel will emulate rdhwr if it's not supported natively. Therefore only check the ISA in system mode. */ check_insn(ctx, ISA_MIPS32R2); #endif t0 = tcg_temp_new(); switch (rd) { c...
[ 1, 1 ]
FFmpeg
libavcodec/mips/h264qpel_msa.c
void ff_put_h264_qpel16_mc23_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride) { avc_luma_midv_qrt_16w_msa(src - (2 * stride) - 2, stride, dst, stride, 16, 1); }
[ 0, 0 ]
qemu
target-s390x/cpu.h
int kvm_arch_insert_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint *bp) { if (cpu_memory_rw_debug(cs, bp->pc, (uint8_t *)&bp->saved_insn, sizeof(diag_501), 0) || cpu_memory_rw_debug(cs, bp->pc, (uint8_t *)diag_501, sizeof(diag_501), 1)) { retur...
[ 1, 0 ]
qemu
target-ppc/cpu.h
void do_addeo(void) { T2 = T0; T0 += T1 + xer_ca; if (likely(!(T0 < T2 || (xer_ca == 1 && T0 == T2)))) { xer_ca = 0; } else { xer_ca = 1; } if (likely(!((T2 ^ T1 ^ (-1)) & (T2 ^ T0) & (1 << 31)))) { xer_ov = 0; } else { xer_so = 1; xer_ov = 1; } }
[ 1, 0 ]
qemu
target-arm/translate.c
static TCGv_i64 gen_mulu_i64_i32(TCGv a, TCGv b) { TCGv_i64 tmp1 = tcg_temp_new_i64(); TCGv_i64 tmp2 = tcg_temp_new_i64(); tcg_gen_extu_i32_i64(tmp1, a); dead_tmp(a); tcg_gen_extu_i32_i64(tmp2, b); dead_tmp(b); tcg_gen_mul_i64(tmp1, tmp1, tmp2); tcg_temp_free_i64(tmp2); return tmp1; }
[ 1, 0 ]
FFmpeg
libavcodec/dnxhdenc.c
static int init_duplicate_context(MpegEncContext *s, MpegEncContext *base) { int i; // edge emu needs blocksize + filter length - 1 (=17x17 for halfpel / 21x21 // for h264) CHECKED_ALLOCZ(s->allocated_edge_emu_buffer, (s->width + 64) * 2 * 21 * 2); //(width + edge + alig...
[ 1, 1 ]
FFmpeg
libavfilter/buffersink.c
static int vsink_query_formats(AVFilterContext *ctx) { BufferSinkContext *buf = ctx->priv; AVFilterFormats *formats = NULL; unsigned i; int ret; if (buf->pixel_fmts_size % sizeof(*buf->pixel_fmts)) { av_log(ctx, AV_LOG_ERROR, "Invalid size for format list\n"); return AVERROR(EINVAL); } if...
[ 1, 0 ]
FFmpeg
libavcodec/arm/Makefile
av_cold void ff_vp56_init(AVCodecContext *avctx, int flip, int has_alpha) { VP56Context *s = avctx->priv_data; int i; s->avctx = avctx; avctx->pix_fmt = has_alpha ? PIX_FMT_YUVA420P : PIX_FMT_YUV420P; if (avctx->idct_algo == FF_IDCT_AUTO) avctx->idct_algo = FF_IDCT_VP3; ff_dsputil_init(&s->dsp, ...
[ 0, 0 ]
qemu
block/qcow2-snapshot.c
static int sd_snapshot_delete(BlockDriverState *bs, const char *snapshot_id) { /* FIXME: Delete specified snapshot id. */ return 0; }
[ 1, 1 ]
qemu
target-ppc/cpu.h
PPC_OP(subfze) { T1 = ~T0; T0 = T1 + xer_ca; if (T0 < T1) { xer_ca = 1; } else { xer_ca = 0; } RETURN(); }
[ 1, 0 ]
FFmpeg
libavcodec/celp_filters.c
void ff_celp_lp_zero_synthesis_filterf(float *out, const float *filter_coeffs, const float *in, int buffer_length, int filter_length) { int i, n; // Avoi...
[ 0, 0 ]
FFmpeg
doc/APIchanges
int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device, VdpGetProcAddress *get_proc, unsigned flags) { VDPAUHWContext *hwctx; if (flags != 0) return AVERROR(EINVAL); if (av_reallocp(&avctx->hwaccel_context, sizeof(*hwctx))) return AVERROR(ENOMEM); hwctx = avc...
[ 1, 0 ]
FFmpeg
libavcodec/h264_loopfilter.c
static void av_always_inline filter_mb_edgeh(uint8_t *pix, int stride, const int16_t bS[4], unsigned int qp, H264Context *h) { const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8); const unsigned int index_a = qp - qp_bd...
[ 1, 0 ]
qemu
hw/ppc/spapr_pci_vfio.c
static void spapr_phb_vfio_finish_realize(sPAPRPHBState *sphb, Error **errp) { sPAPRPHBVFIOState *svphb = SPAPR_PCI_VFIO_HOST_BRIDGE(sphb); struct vfio_iommu_spapr_tce_info info = {.argsz = sizeof(info)}; int ret; sPAPRTCETable *tcet; uint32_t liobn = svphb->phb.dma_liobn; if (svphb->iommugroupid == ...
[ 1, 0 ]
FFmpeg
libavformat/concatdec.c
static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt) { ConcatContext *cat = avf->priv_data; int ret; int64_t delta; while (1) { if ((ret = av_read_frame(cat->avf, pkt)) != AVERROR_EOF || (ret = open_next_file(avf)) < 0) break; } delta = av_rescale_q(cat->cur_file->start_time ...
[ 1, 0 ]
FFmpeg
libswscale/bfin/internal_bfin.S
static inline void RENAME(rgb24ToY)(uint8_t *dst, const uint8_t *src, int width, uint32_t *unused) { #if COMPILE_TEMPLATE_MMX RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_RGB24); #else int i; for (i = 0; i < width; i++) { int r = src[i * 3 + 0]; int g = src[i *...
[ 1, 0 ]
FFmpeg
libavcodec/adxenc.c
static av_cold int adx_encode_init(AVCodecContext *avctx) { ADXContext *c = avctx->priv_data; if (avctx->channels > 2) return -1; avctx->frame_size = 32; avctx->coded_frame = avcodec_alloc_frame(); avctx->coded_frame->key_frame = 1; /* the cutoff can be adjusted, but this seems to work pretty we...
[ 0, 0 ]
qemu
target-ppc/cpu.h
PPC_OP(btest_T1) { if (T0) { regs->nip = T1 & ~3; } else { regs->nip = PARAM1; } RETURN(); }
[ 1, 0 ]
qemu
hw/virtio/vhost-user.c
static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base, struct vhost_log *log) { int fds[VHOST_MEMORY_MAX_NREGIONS]; size_t fd_num = 0; bool shmfd = virtio_has_feature(dev->protocol_features, VHOST_USER_PROTOCOL_F_LOG_SHMF...
[ 1, 0 ]
qemu
block/backup.c
static void drive_backup_abort(BlkActionState *common) { DriveBackupState *state = DO_UPCAST(DriveBackupState, common, common); BlockDriverState *bs = state->bs; /* Only cancel if it's the job we started */ if (bs && bs->job && bs->job == state->job) { block_job_cancel_sync(bs->job); } }
[ 1, 0 ]
qemu
hw/misc/ivshmem.c
static void ivshmem_check_version(void *opaque, const uint8_t *buf, int size) { IVShmemState *s = opaque; int tmp; int64_t version; if (!fifo_update_and_get_i64(s, buf, size, &version)) { return; } tmp = qemu_chr_fe_get_msgfd(s->server_chr); if (tmp != -1 || version != IVSHMEM_PROTOCOL_VERSION...
[ 1, 0 ]
FFmpeg
libavformat/rtsp.c
static int tcp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st, uint8_t *buf, int buf_size) { RTSPState *rt = s->priv_data; int id, len, i, ret; RTSPStream *rtsp_st; #ifdef DEBUG_RTP_TCP dprintf(s, "tcp_read_packet:\n"); #endif redo: for (;;) { RTSPMessageHeader...
[ 1, 1 ]
FFmpeg
libavformat/rm.c
static int rm_read_header_old(AVFormatContext *s, AVFormatParameters *ap) { RMContext *rm = s->priv_data; AVStream *st; rm->old_format = 1; st = av_new_stream(s, 0); if (!st) goto fail; rm_read_audio_stream_info(s, st, 1); return 0; fail: return -1; }
[ 1, 0 ]
qemu
Makefile.objs
static void alloc_aio_bitmap(BlkMigDevState *bmds) { BlockDriverState *bs = bmds->bs; int64_t bitmap_size; bitmap_size = bdrv_nb_sectors(bs) + BDRV_SECTORS_PER_DIRTY_CHUNK * 8 - 1; bitmap_size /= BDRV_SECTORS_PER_DIRTY_CHUNK * 8; bmds->aio_bitmap = g_malloc0(bitmap_size); }
[ 1, 0 ]
qemu
block/blkreplay.c
static int coroutine_fn blkreplay_co_flush(BlockDriverState *bs) { uint64_t reqid = request_id++; int ret = bdrv_co_flush(bs->file->bs); block_request_create(reqid, bs, qemu_coroutine_self()); qemu_coroutine_yield(); return ret; }
[ 1, 0 ]
qemu
hw/dp8393x.c
USBDevice *usb_net_init(NICInfo *nd) { USBNetState *s; s = qemu_mallocz(sizeof(USBNetState)); s->dev.speed = USB_SPEED_FULL; s->dev.handle_packet = usb_generic_handle_packet; s->dev.handle_reset = usb_net_handle_reset; s->dev.handle_control = usb_net_handle_control; s->dev.handle_data = usb_net_ha...
[ 1, 0 ]
FFmpeg
postproc/rgb2rgb.c
void rgb15tobgr15(const uint8_t *src, uint8_t *dst, unsigned int src_size) { unsigned i; unsigned num_pixels = src_size >> 1; for (i = 0; i < num_pixels; i++) { unsigned b, g, r; register uint16_t rgb; rgb = src[2 * i]; r = rgb & 0x1F; g = (rgb & 0x3E0) >> 5; b = (rgb & 0x7C00...
[ 1, 0 ]
FFmpeg
libavcodec/j2kenc.c
static int encode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_size, void *data) { int tileno, ret; J2kEncoderContext *s = avctx->priv_data; // init: s->buf = s->buf_start = buf; s->buf_end = buf + buf_size; s->picture = data; s->lambda = s->...
[ 1, 0 ]
qemu
target-ppc/cpu.h
void do_POWER_divs(void) { if ((Ts0 == INT32_MIN && Ts1 == -1) || Ts1 == 0) { T0 = (long)((-1) * (T0 >> 31)); env->spr[SPR_MQ] = 0; } else { env->spr[SPR_MQ] = T0 % T1; T0 = Ts0 / Ts1; } }
[ 1, 0 ]
FFmpeg
libavcodec/atrac3.c
static int decode_bytes(const uint8_t *input, uint8_t *out, int bytes) { int i, off; uint32_t c; const uint32_t *buf; uint32_t *output = (uint32_t *)out; off = (intptr_t)input & 3; buf = (const uint32_t *)(input - off); c = av_be2ne32((0x537F6103 >> (off * 8)) | (0x537F6103 << (32 - (off * 8)))); ...
[ 1, 0 ]
FFmpeg
libavcodec/vc9.c
int decode_luma_intra_block(VC9Context *v, int mquant) { GetBitContext *gb = &v->s.gb; int dcdiff; dcdiff = get_vlc2(gb, v->luma_dc_vlc->table, DC_VLC_BITS, 2); if (dcdiff) { if (dcdiff == 119 /* ESC index value */) { /* TODO: Optimize */ if (mquant == 1) ...
[ 1, 1 ]
qemu
include/exec/gen-icount.h
static void dec10_reg_scc(DisasContext *dc) { int cond = dc->dst; LOG_DIS("s%s $r%u\n", cc_name(cond), dc->src); if (cond != CC_A) { int l1; gen_tst_cc(dc, cpu_R[dc->src], cond); l1 = gen_new_label(); tcg_gen_brcondi_tl(TCG_COND_EQ, cpu_R[dc->src], 0, l1); tcg_gen_movi_tl(cpu_R[dc-...
[ 0, 0 ]
qemu
hw/intc/armv7m_nvic.c
void armv7m_nvic_acknowledge_irq(void *opaque) { NVICState *s = (NVICState *)opaque; CPUARMState *env = &s->cpu->env; const int pending = s->vectpending; const int running = nvic_exec_prio(s); int pendgroupprio; VecInfo *vec; assert(pending > ARMV7M_EXCP_RESET && pending < s->num_irq); vec = &s...
[ 1, 0 ]
qemu
docs/migration.txt
static int64_t migration_get_rate_limit(void *opaque) { MigrationState *s = opaque; return s->xfer_limit; }
[ 0, 0 ]
qemu
hw/ppc/spapr_pci.c
static void rtas_ibm_set_eeh_option(PowerPCCPU *cpu, sPAPREnvironment *spapr, uint32_t token, uint32_t nargs, target_ulong args, uint32_t nret, target_ulong rets) { sPA...
[ 1, 0 ]
qemu
hw/acpi/pcihp.c
static uint64_t pci_read(void *opaque, hwaddr addr, unsigned int size) { AcpiPciHpState *s = opaque; uint32_t val = 0; int bsel = s->hotplug_select; if (bsel < 0 || bsel > ACPI_PCIHP_MAX_HOTPLUG_BUS) { return 0; } switch (addr) { case PCI_UP_BASE - PCI_HOTPLUG_ADDR: /* Manufacture an "up"...
[ 1, 0 ]
qemu
block/qapi.c
BlockInfoList *qmp_query_block(Error **errp) { BlockInfoList *head = NULL, **p_next = &head; BlockBackend *blk; Error *local_err = NULL; for (blk = blk_next(NULL); blk; blk = blk_next(blk)) { BlockInfoList *info = g_malloc0(sizeof(*info)); bdrv_query_info(blk, &info->value, &local_err); if (...
[ 0, 0 ]
qemu
net/filter-rewriter.c
static int handle_primary_tcp_pkt(NetFilterState *nf, Connection *conn, Packet *pkt) { struct tcphdr *tcp_pkt; tcp_pkt = (struct tcphdr *)pkt->transport_header; if (trace_event_get_state(TRACE_COLO_FILTER_REWRITER_DEBUG)) { trace_colo_...
[ 1, 1 ]
qemu
hw/intc/armv7m_nvic.c
static bool nvic_user_access_ok(NVICState *s, hwaddr offset) { /* Return true if unprivileged access to this register is permitted. */ switch (offset) { case 0xf00: /* STIR: accessible only if CCR.USERSETMPEND permits */ return s->cpu->env.v7m.ccr & R_V7M_CCR_USERSETMPEND_MASK; default: /* All ot...
[ 1, 0 ]
qemu
hw/acpi/pcihp.c
static PXBDev *convert_to_pxb(PCIDevice *dev) { return pci_bus_is_express(dev->bus) ? PXB_PCIE_DEV(dev) : PXB_DEV(dev); }
[ 0, 0 ]
qemu
qapi/qmp-input-visitor.c
QString *qobject_to_qstring(const QObject *obj) { if (qobject_type(obj) != QTYPE_QSTRING) return NULL; return container_of(obj, QString, base); }
[ 1, 0 ]
qemu
hw/ppc/spapr.c
static void spapr_add_lmbs(DeviceState *dev, uint64_t addr, uint64_t size, uint32_t node, Error **errp) { sPAPRDRConnector *drc; sPAPRDRConnectorClass *drck; uint32_t nr_lmbs = size / SPAPR_MEMORY_BLOCK_SIZE; int i, fdt_offset, fdt_size; void *fdt; for (i = 0; i < nr_lmbs;...
[ 1, 0 ]
FFmpeg
libavcodec/mips/h264qpel_msa.c
static void avc_luma_hv_qrt_16w_msa(const uint8_t *src_x, const uint8_t *src_y, int32_t src_stride, uint8_t *dst, int32_t dst_stride, int32_t height) { uint32_t multiple8_cnt; for (multiple8_cnt = 2; multiple8_cnt--;) { avc_luma_hv_qr...
[ 0, 0 ]
qemu
monitor.c
int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func, void *opaque) { if (monitor_ctrl_mode(mon)) { qerror_report(QERR_MISSING_PARAMETER, "password"); return -EINVAL; } else if (mon->rs) { readline_start(mon->rs, "Password: ", 1, readline_func, opaque); ...
[ 0, 0 ]
qemu
hw/openrisc/openrisc_sim.c
static void openrisc_sim_net_init(MemoryRegion *address_space, hwaddr base, hwaddr descriptors, qemu_irq irq, NICInfo *nd) { DeviceState *dev; SysBusDevice *s; dev = qdev_create(NULL, "open_eth"); qdev_...
[ 0, 0 ]
qemu
block/io.c
static int coroutine_fn bdrv_driver_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) { BlockDriver *drv = bs->drv; int64_t sector_num = offset >> BDRV_SECTOR_BITS; unsigned int n...
[ 1, 0 ]
qemu
cpus.c
static int64_t cpu_get_icount_locked(void) { int64_t icount; CPUState *cpu = current_cpu; icount = timers_state.qemu_icount; if (cpu) { if (!cpu_can_do_io(cpu)) { fprintf(stderr, "Bad clock read\n"); } icount -= (cpu->icount_decr.u16.low + cpu->icount_extra); } return timers_state...
[ 0, 0 ]
qemu
block/block-backend.c
SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockDriverState *bdrv, int unit, bool removable, int bootindex, const char *serial, Error **errp) { const char *driver; DeviceState *dev; Error *err = NULL; driver = bdrv_is_sg...
[ 0, 0 ]
qemu
hw/ppc/spapr.c
static void check_exception(PowerPCCPU *cpu, sPAPRMachineState *spapr, uint32_t token, uint32_t nargs, target_ulong args, uint32_t nret, target_ulong rets) { uint32_t mask, buf, len, event_len; uint64_t xinfo; sPAPREventLog...
[ 1, 0 ]
qemu
kvm-all.c
int kvm_init_vcpu(CPUState *env) { KVMState *s = kvm_state; long mmap_size; int ret; DPRINTF("kvm_init_vcpu\n"); ret = kvm_vm_ioctl(s, KVM_CREATE_VCPU, env->cpu_index); if (ret < 0) { DPRINTF("kvm_create_vcpu failed\n"); goto err; } env->kvm_fd = ret; env->kvm_state = s; mmap_siz...
[ 0, 0 ]
qemu
Makefile.objs
void timerlist_free(QEMUTimerList *timer_list) { assert(!timerlist_has_timers(timer_list)); if (timer_list->clock) { QLIST_REMOVE(timer_list, list); } qemu_mutex_destroy(&timer_list->active_timers_lock); g_free(timer_list); }
[ 0, 0 ]
qemu
Makefile.objs
static AioContext *thread_pool_get_aio_context(BlockAIOCB *acb) { ThreadPoolElement *elem = (ThreadPoolElement *)acb; ThreadPool *pool = elem->pool; return pool->ctx; }
[ 0, 0 ]
qemu
linux-user/strace.c
print_syscall_ret(int num, abi_long ret) { int i; for (i = 0; i < nsyscalls; i++) if (scnames[i].nr == num) { if (scnames[i].result != NULL) { scnames[i].result(&scnames[i], ret); } else { if (ret < 0) { gemu_log(" = -1 errno=" TARGET_ABI_FMT_ld " (%s)\n", -ret, ...
[ 1, 0 ]
qemu
hw/apb_pci.c
static void apc_init(target_phys_addr_t power_base, qemu_irq cpu_halt) { DeviceState *dev; SysBusDevice *s; dev = qdev_create(NULL, "apc"); qdev_init(dev); s = sysbus_from_qdev(dev); /* Power management (APC) XXX: not a Slavio device */ sysbus_mmio_map(s, 0, power_base); sysbus_connect_irq(s, 0...
[ 1, 1 ]
qemu
nbd/client.c
static ssize_t drop_sync(QIOChannel *ioc, size_t size) { ssize_t ret = 0; char small[1024]; char *buffer; buffer = sizeof(small) < size ? small : g_malloc(MIN(65536, size)); while (size > 0) { ssize_t count = read_sync(ioc, buffer, MIN(65536, size)); if (count <= 0) { goto cleanup; ...
[ 1, 0 ]
qemu
hw/scsi/mptsas.c
void *qemu_get_virtqueue_element(VirtIODevice *vdev, QEMUFile *f, size_t sz) { VirtQueueElement *elem; VirtQueueElementOld data; int i; qemu_get_buffer(f, (uint8_t *)&data, sizeof(VirtQueueElementOld)); /* TODO: teach all callers that this can fail, and return failure instead * of asserting here. ...
[ 1, 1 ]
qemu
savevm.c
int qemu_get_buffer(QEMUFile *f, uint8_t *buf, int size1) { int size, l; if (f->is_write) { abort(); } size = size1; while (size > 0) { l = f->buf_size - f->buf_index; if (l == 0) { qemu_fill_buffer(f); l = f->buf_size - f->buf_index; if (l == 0) { break; ...
[ 1, 0 ]
qemu
hw/net/virtio-net.c
static void virtio_net_vhost_status(VirtIONet *n, uint8_t status) { VirtIODevice *vdev = VIRTIO_DEVICE(n); NetClientState *nc = qemu_get_queue(n->nic); int queues = n->multiqueue ? n->max_queues : 1; if (!get_vhost_net(nc->peer)) { return; } if (!!n->vhost_started == (virtio_net_started(n,...
[ 0, 0 ]
qemu
hw/ppc/spapr.c
static void spapr_cpu_core_host_initfn(Object *obj) { sPAPRCPUCore *core = SPAPR_CPU_CORE(obj); char *name = g_strdup_printf("%s-" TYPE_POWERPC_CPU, "host"); ObjectClass *oc = object_class_by_name(name); g_assert(oc); g_free((void *)name); core->cpu_class = oc; }
[ 0, 0 ]