Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
FFmpeg
libavcodec/h264_slice.c
int ff_thread_ref_frame(ThreadFrame *dst, ThreadFrame *src) { int ret; dst->owner = src->owner; ret = av_frame_ref(dst->f, src->f); if (ret < 0) return ret; av_assert0(!dst->progress); if (src->progress && !(dst->progress = av_buffer_ref(src->progress))) { ff_thread_release_buffer(ds...
[ 1, 0 ]
qemu
hw/vfio/pci-quirks.c
static void vfio_vga_probe_ati_3c3_quirk(VFIOPCIDevice *vdev) { VFIOQuirk *quirk; /* * As long as the BAR is >= 256 bytes it will be aligned such that the * lower byte is always zero. Filter out anything else, if it exists. */ if (!vfio_pci_is(vdev, PCI_VENDOR_ID_ATI, PCI_ANY_ID) || !vdev-...
[ 1, 0 ]
qemu
hw/device-hotplug.c
void *etraxfs_eth_init(NICInfo *nd, target_phys_addr_t base, int phyaddr) { struct etraxfs_dma_client *dma = NULL; struct fs_eth *eth = NULL; qemu_check_nic_model(nd, "fseth"); dma = qemu_mallocz(sizeof *dma * 2); eth = qemu_mallocz(sizeof *eth); dma[0].client.push = eth_tx_push; dma[0].client.opa...
[ 1, 0 ]
qemu
target-ppc/translate.c
static inline void gen_op_arith_add(DisasContext *ctx, TCGv ret, TCGv arg1, TCGv arg2, bool add_ca, bool compute_ca, bool compute_ov, bool compute_rc0) { TCGv t0 = ret; if (((compute_ca && add_ca) || compute_ov) && (TCGV_EQUAL(ret, ...
[ 1, 0 ]
qemu
hw/qxl.c
static void qxl_check_state(PCIQXLDevice *d) { QXLRam *ram = d->ram; assert(SPICE_RING_IS_EMPTY(&ram->cmd_ring)); assert(SPICE_RING_IS_EMPTY(&ram->cursor_ring)); }
[ 1, 0 ]
qemu
tests/test-qmp-input-strict.c
static Visitor *visitor_input_test_init_raw(TestInputVisitorData *data, const char *json_string) { Visitor *v; data->obj = qobject_from_json(json_string); g_assert(data->obj != NULL); data->qiv = qmp_input_visitor_new(data->obj); g_assert(data->qiv != NULL); ...
[ 1, 0 ]
FFmpeg
libavcodec/noise_bsf.c
static int noise(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe) { unsigned int *state = bsfc->priv_data; int amount = args ? atoi(args) : (*state % 1...
[ 1, 0 ]
FFmpeg
libavcodec/x86/cavsdsp.c
av_cold void ff_dsputil_init_x86(DSPContext *c, AVCodecContext *avctx) { int cpu_flags = av_get_cpu_flags(); #if HAVE_7REGS && HAVE_INLINE_ASM if (cpu_flags & AV_CPU_FLAG_CMOV) c->add_hfyu_median_prediction = ff_add_hfyu_median_prediction_cmov; #endif if (cpu_flags & AV_CPU_FLAG_MMX) dsputil_init_...
[ 0, 0 ]
FFmpeg
libavformat/matroska.c
matroska_read_close(AVFormatContext *s) { MatroskaDemuxContext *matroska = s->priv_data; int n = 0; if (matroska->writing_app) av_free(matroska->writing_app); if (matroska->muxing_app) av_free(matroska->muxing_app); if (matroska->index) av_free(matroska->index); if (matroska->packets !...
[ 1, 0 ]
FFmpeg
ffmpeg.c
static void sub2video_update(InputStream *ist, AVSubtitle *sub) { AVFrame *frame = ist->sub2video.frame; int8_t *dst; int dst_linesize; int num_rects, i; int64_t pts, end_pts; if (!frame) return; if (sub) { pts = av_rescale_q(sub->pts + sub->start_display_time * 1000LL, ...
[ 0, 0 ]
FFmpeg
libavcodec/intrax8.c
av_cold int ff_intrax8_common_init(IntraX8Context *w, IDCTDSPContext *idsp, MpegEncContext *const s) { int ret = x8_vlc_init(); if (ret < 0) return ret; w->idsp = *idsp; w->s = s; // two rows, 2 blocks per cannon mb w->prediction_table = av_mallocz(s->mb_width...
[ 1, 0 ]
qemu
hw/vfio/pci-quirks.c
static void vfio_probe_rtl8168_bar2_quirk(VFIOPCIDevice *vdev, int nr) { VFIOQuirk *quirk; VFIOrtl8168Quirk *rtl; if (!vfio_pci_is(vdev, PCI_VENDOR_ID_REALTEK, 0x8168) || nr != 2) { return; } quirk = g_malloc0(sizeof(*quirk)); quirk->mem = g_malloc0(sizeof(MemoryRegion) * 2); quirk->nr_mem = 2...
[ 1, 0 ]
FFmpeg
libavformat/allformats.c
static int gif_read_header1(GifState *s) { ByteIOContext *f = s->f; uint8_t sig[6]; int ret, v, n; int has_global_palette; /* read gif signature */ ret = get_buffer(f, sig, 6); if (ret != 6) return -1; if (memcmp(sig, gif87a_sig, 6) != 0 && memcmp(sig, gif89a_sig, 6) != 0) retu...
[ 1, 0 ]
qemu
hw/virtio/virtio.c
VirtQueue *virtio_add_queue(VirtIODevice *vdev, int queue_size, VirtIOHandleOutput handle_output) { int i; for (i = 0; i < VIRTIO_QUEUE_MAX; i++) { if (vdev->vq[i].vring.num == 0) break; } if (i == VIRTIO_QUEUE_MAX || queue_size > VIRTQUEUE_MAX_SIZE) abort(); ...
[ 0, 0 ]
qemu
migration/ram.c
void migrate_compress_threads_create(void) { int i, thread_count; if (!migrate_use_compression()) { return; } quit_comp_thread = false; compression_switch = true; thread_count = migrate_compress_threads(); compress_threads = g_new0(QemuThread, thread_count); comp_param = g_new0(CompressPara...
[ 0, 0 ]
qemu
bootdevice.c
void validate_bootdevices(const char *devices) { /* We just do some generic consistency checks */ const char *p; int bitmap = 0; for (p = devices; *p != '\0'; p++) { /* Allowed boot devices are: * a-b: floppy disk drives * c-f: IDE disk drives * g-m: machine implementation dependent ...
[ 0, 0 ]
FFmpeg
libavutil/Makefile
static int test_butterflies_float(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp, const float *v1, const float *v2) { LOCAL_ALIGNED(32, float, cv1, [LEN]); LOCAL_ALIGNED(32, float, cv2, [LEN]); LOCAL_ALIGNED(32, float, ov1, [LEN]); LOCA...
[ 1, 0 ]
qemu
target-ppc/cpu-qom.h
static hwaddr ppc_hash64_pteg_search(PowerPCCPU *cpu, hwaddr hash, bool secondary, target_ulong ptem, ppc_hash_pte64_t *pte) { CPUPPCState *env = &cpu->env; int i; uint64_t token; target_ulong pte0, pte1; target_ulong pte_index;...
[ 1, 0 ]
qemu
hw/scsi-disk.c
SCSIDevice *scsi_disk_init(BlockDriverState *bdrv, int tcq, scsi_completionfn completion, void *opaque) { SCSIDevice *d; SCSIDeviceState *s; s = (SCSIDeviceState *)qemu_mallocz(sizeof(SCSIDeviceState)); s->bdrv = bdrv; s->tcq = tcq; s->completion = completion; s->opaque...
[ 1, 0 ]
qemu
target/ppc/cpu.c
void cpu_write_xer(CPUPPCState *env, target_ulong xer) { env->so = (xer >> XER_SO) & 1; env->ov = (xer >> XER_OV) & 1; env->ca = (xer >> XER_CA) & 1; env->xer = xer & ~((1u << XER_SO) | (1u << XER_OV) | (1u << XER_CA)); }
[ 1, 0 ]
qemu
hw/scsi/virtio-scsi.c
static void virtio_scsi_hotplug(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { VirtIODevice *vdev = VIRTIO_DEVICE(hotplug_dev); VirtIOSCSI *s = VIRTIO_SCSI(vdev); SCSIDevice *sd = SCSI_DEVICE(dev); if (s->ctx && !s->dataplane_disabled) { VirtIOSCSIBlkCh...
[ 1, 0 ]
FFmpeg
libswscale/x86/rgb2rgb_template.c
static void RENAME(uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, int width, int height, int lumStride, int chromStride, int srcStride) { int y; const int chromWidth = FF_CEIL_RSHI...
[ 1, 0 ]
qemu
target-arm/translate.c
static int gen_set_psr(DisasContext *s, uint32_t mask, int spsr, TCGv t0) { TCGv tmp; if (spsr) { /* ??? This is also undefined in system mode. */ if (IS_USER(s)) return 1; tmp = load_cpu_field(spsr); tcg_gen_andi_i32(tmp, tmp, ~mask); tcg_gen_andi_i32(t0, t0, mask); tcg_gen...
[ 1, 0 ]
FFmpeg
libavutil/imgutils.c
int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int width) { int i; const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; int max_step[4]; /* max pixel step for each plane */ int max_step_comp[4]; /* the component for each plane which has the...
[ 1, 0 ]
qemu
hw/s390x/s390-virtio-bus.c
static int virtio_ccw_blk_init(VirtioCcwDevice *ccw_dev) { VirtIOBlkCcw *dev = VIRTIO_BLK_CCW(ccw_dev); DeviceState *vdev = DEVICE(&dev->vdev); virtio_blk_set_conf(vdev, &(dev->blk)); qdev_set_parent_bus(vdev, BUS(&ccw_dev->bus)); if (qdev_init(vdev) < 0) { return -1; } return virtio_ccw_devic...
[ 1, 0 ]
FFmpeg
Changelog
static av_cold int libschroedinger_decode_close(AVCodecContext *avctx) { SchroDecoderParams *p_schro_params = avctx->priv_data; /* Free the decoder. */ schro_decoder_free(p_schro_params->decoder); av_freep(&p_schro_params->format); /* Free data in the output frame queue. */ ff_schro_queue_free(&p_sch...
[ 1, 0 ]
FFmpeg
ffmpeg.c
static int check_output_constraints(InputStream *ist, OutputStream *ost) { OutputFile *of = output_files[ost->file_index]; int ist_index = input_files[ist->file_index]->ist_index + ist->st->index; if (ost->source_index != ist_index) return 0; if (of->start_time && ist->pts < of->start_time) retur...
[ 1, 0 ]
FFmpeg
doc/APIchanges
static int try_decode_frame(AVStream *st, AVPacket *avpkt, AVDictionary **options) { AVCodec *codec; int got_picture = 1, ret = 0; AVFrame picture; AVPacket pkt = *avpkt; if (!st->codec->codec) { AVDictionary *thread_opt = NULL; codec = avcodec_find_decoder(st->code...
[ 1, 0 ]
FFmpeg
libavcodec/xxan.c
static int xan_unpack_luma(const uint8_t *src, const int src_size, uint8_t *dst, const int dst_size) { int tree_size, eof; const uint8_t *tree; int bits, mask; int tree_root, node; const uint8_t *dst_end = dst + dst_size; const uint8_t *src_end = src + src_size; tree_si...
[ 1, 0 ]
FFmpeg
libavcodec/hevc_parser.c
static int hevc_init(AVCodecParserContext *s) { HEVCContext *h = &((HEVCParseContext *)s->priv_data)->h; h->HEVClc = av_mallocz(sizeof(HEVCLocalContext)); h->skipped_bytes_pos_size = INT_MAX; return 0; }
[ 1, 0 ]
FFmpeg
libavformat/aviobuf.c
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer) { DynBuffer *d = s->opaque; int size; static const char padbuf[FF_INPUT_BUFFER_PADDING_SIZE] = {0}; int padding = 0; if (!s) { *pbuffer = NULL; return 0; } /* don't attempt to pad fixed-size packet buffers */ if (!s->max_packet_...
[ 1, 0 ]
FFmpeg
libavcodec/imgconvert.c
static void rgb24_to_pal8(AVPicture *dst, AVPicture *src, int width, int height) { const unsigned char *p; unsigned char *q; int r, g, b, dst_wrap, src_wrap; int x, y, i; static const uint8_t pal_value[6] = {0x00, 0x33, 0x66, 0x99, 0xcc, 0xff}; uint32_t *pal; p = src->da...
[ 1, 1 ]
qemu
contrib/libvhost-user/libvhost-user.c
vu_queue_flush(VuDev *dev, VuVirtq *vq, unsigned int count) { uint16_t old, new; if (unlikely(dev->broken)) { return; } /* Make sure buffer is written before we update index. */ smp_wmb(); old = vq->used_idx; new = old + count; vring_used_idx_set(dev, vq, new); vq->inuse -= count; if ...
[ 1, 0 ]
FFmpeg
libavcodec/h264_loopfilter.c
static void av_always_inline filter_mb_edgeh(uint8_t *pix, int stride, 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_offse...
[ 1, 0 ]
FFmpeg
avprobe.c
static void show_format(AVFormatContext *fmt_ctx) { AVDictionaryEntry *tag = NULL; char val_str[128]; int64_t size = fmt_ctx->pb ? avio_size(fmt_ctx->pb) : -1; print_format_entry(NULL, "[FORMAT]"); print_format_entry("filename", fmt_ctx->filename); snprintf(val_str, sizeof(val_str) - 1, "%d", fmt_ctx...
[ 1, 0 ]
FFmpeg
Changelog
static void *get_surface(const AVFrame *frame) { return frame->data[3]; }
[ 0, 0 ]
qemu
hw/ppce500_pci.c
static uint32_t pci_reg_read4(void *opaque, target_phys_addr_t addr) { PPCE500PCIState *pci = opaque; unsigned long win; uint32_t value = 0; win = addr & 0xfe0; switch (win) { case PPCE500_PCI_OW1: case PPCE500_PCI_OW2: case PPCE500_PCI_OW3: case PPCE500_PCI_OW4: switch (addr & 0xC) { ...
[ 1, 0 ]
qemu
qapi/qmp-output-visitor.c
static QObject *qmp_output_first(QmpOutputVisitor *qov) { QStackEntry *e = QTAILQ_LAST(&qov->stack, QStack); /* FIXME - find a better way to deal with NULL values */ if (!e) { return NULL; } return e->value; }
[ 1, 1 ]
FFmpeg
libswscale/output.c
yuv2422_2_c_template(SwsContext *c, const int16_t *buf[2], const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf[2], uint8_t *dest, int dstW, int yalpha, int uvalpha, int y, enum PixelFormat target) { const int16_t...
[ 1, 0 ]
FFmpeg
libavcodec/v4l2_buffers.c
int ff_v4l2_m2m_codec_init(AVCodecContext *avctx) { int ret = AVERROR(EINVAL); struct dirent *entry; char node[PATH_MAX]; DIR *dirp; V4L2m2mContext *s = avctx->priv_data; s->avctx = avctx; dirp = opendir("/dev"); if (!dirp) return AVERROR(errno); for (entry = readdir(dirp); entry; entry...
[ 1, 0 ]
FFmpeg
libavcodec/iff.c
static int decode_frame_ilbm(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { IffContext *s = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; const uint8_t *buf_end = buf + buf_size; int y, p...
[ 1, 0 ]
FFmpeg
libavcodec/proresenc.c
static av_cold int prores_encode_init(AVCodecContext *avctx) { int i; ProresContext *ctx = avctx->priv_data; if (avctx->pix_fmt != PIX_FMT_YUV422P10LE) { av_log(avctx, AV_LOG_ERROR, "need YUV422P10\n"); return -1; } if (avctx->width & 0x1) { av_log(avctx, AV_LOG_ERROR, "frame w...
[ 1, 0 ]
qemu
cpus.c
static void test_visitor_out_union_flat(TestOutputVisitorData *data, const void *unused) { QObject *arg; QDict *qdict; UserDefFlatUnion *tmp = g_malloc0(sizeof(UserDefFlatUnion)); tmp->enum1 = ENUM_ONE_VALUE1; tmp->string = g_strdup("str"); tmp->u.value1 = g_m...
[ 1, 0 ]
qemu
target-arm/helper.c
static int bad_mode_switch(CPUARMState *env, int mode) { /* Return true if it is not valid for us to switch to * this CPU mode (ie all the UNPREDICTABLE cases in * the ARM ARM CPSRWriteByInstr pseudocode). */ switch (mode) { case ARM_CPU_MODE_USR: case ARM_CPU_MODE_SYS: case ARM_CPU_MODE_SVC...
[ 1, 0 ]
qemu
hw/scsi-disk.c
static void scsi_write_complete(void *opaque, int ret) { SCSIDiskReq *r = (SCSIDiskReq *)opaque; SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); uint32_t n; if (r->req.aiocb != NULL) { r->req.aiocb = NULL; bdrv_acct_done(s->qdev.conf.bs, &r->acct); } if (ret < 0) { if (sc...
[ 1, 0 ]
qemu
hw/esp.c
static void do_busid_cmd(ESPState *s, uint8_t *buf, uint8_t busid) { int32_t datalen; int lun; DPRINTF("do_busid_cmd: busid 0x%x\n", busid); lun = busid & 7; datalen = s->current_dev->info->send_command(s->current_dev, 0, buf, lun); s->ti_size = datalen; if (datalen != 0) { s->rregs[ESP_RSTAT...
[ 1, 0 ]
FFmpeg
libavcodec/dvdsubdec.c
static int decode_rle(uint8_t *bitmap, int linesize, int w, int h, const uint8_t *buf, int start, int buf_size, int is_8bit) { GetBitContext gb; int bit_len; int x, y, len, color; uint8_t *d; if (start >= buf_size) bit_len = (buf_size - start) * 8; init_get_bi...
[ 1, 0 ]
FFmpeg
doc/examples/decode_video.c
static void decode(AVCodecContext *dec_ctx, AVFrame *frame, AVPacket *pkt, const char *filename) { char buf[1024]; int ret; ret = avcodec_send_packet(dec_ctx, pkt); if (ret < 0) { fprintf(stderr, "Error sending a packet for decoding\n"); exit(1); } while (ret >= 0) { ...
[ 1, 0 ]
qemu
target-arm/translate.c
static TCGv neon_load_scratch(int scratch) { TCGv tmp = new_tmp(); tcg_gen_ld_i32(tmp, cpu_env, offsetof(CPUARMState, vfp.scratch[scratch])); return tmp; }
[ 1, 0 ]
qemu
hw/usb/redirect.c
static void usbredir_realize(USBDevice *udev, Error **errp) { USBRedirDevice *dev = USB_REDIRECT(udev); int i; if (!qemu_chr_fe_get_driver(&dev->cs)) { error_setg(errp, QERR_MISSING_PARAMETER, "chardev"); return; } if (dev->filter_str) { i = usbredirfilter_string_to_rules(dev->filter_str, ...
[ 1, 0 ]
qemu
hw/tpm/tpm_passthrough.c
static int tpm_passthrough_open_sysfs_cancel(TPMPassthruState *tpm_pt) { int fd = -1; char *dev; char path[PATH_MAX]; if (tpm_pt->options->cancel_path) { fd = qemu_open(tpm_pt->options->cancel_path, O_WRONLY); if (fd < 0) { error_report("Could not open TPM cancel path : %s", ...
[ 1, 0 ]
qemu
fpu/softfloat.c
int32 float64_to_int32_round_to_zero(float64 a STATUS_PARAM) { flag aSign; int16 aExp, shiftCount; uint64_t aSig, savedASig; int32 z; a = float64_squash_input_denormal(a STATUS_VAR); aSig = extractFloat64Frac(a); aExp = extractFloat64Exp(a); aSign = extractFloat64Sign(a); if (0x41E < aExp) {...
[ 1, 0 ]
qemu
hw/core/qdev-properties.c
static void set_bit(Object *obj, Visitor *v, void *opaque, const char *name, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; Error *local_err = NULL; bool value; if (dev->realized) { qdev_prop_set_after_realize(dev, name, errp); return; } visi...
[ 0, 0 ]
qemu
target/i386/translate.c
static inline void gen_goto_tb(DisasContext *s, int tb_num, target_ulong eip) { target_ulong pc = s->cs_base + eip; if (use_goto_tb(s, pc)) { /* jump to same page: we can use a direct jump */ tcg_gen_goto_tb(tb_num); gen_jmp_im(eip); tcg_gen_exit_tb((uintptr_t)s->tb + tb_num); } else { ...
[ 0, 0 ]
qemu
HACKING
static uint64_t megasas_port_read(void *opaque, target_phys_addr_t addr, unsigned size) { return megasas_mmio_read(opaque, addr & 0xff, size); }
[ 0, 0 ]
qemu
hw/core/loader.c
int load_elf_as(const char *filename, uint64_t (*translate_fn)(void *, uint64_t), void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr, uint64_t *highaddr, int big_endian, int elf_machine, int clear_lsb, int data_swab, AddressSpace *as) { in...
[ 1, 0 ]
qemu
target-ppc/helper.c
int ppcmas_tlb_check(CPUState *env, ppcmas_tlb_t *tlb, target_phys_addr_t *raddrp, target_ulong address, uint32_t pid) { target_ulong mask; uint32_t tlb_pid; /* Check valid flag */ if (!(tlb->mas1 & MAS1_VALID)) { return -1; } mask = ~(booke206_tlb_to_p...
[ 1, 0 ]
qemu
hw/qxl-render.c
void qxl_render_resize(PCIQXLDevice *qxl) { QXLSurfaceCreate *sc = &qxl->guest_primary.surface; qxl->guest_primary.stride = sc->stride; qxl->guest_primary.resized++; switch (sc->format) { case SPICE_SURFACE_FMT_16_555: qxl->guest_primary.bytes_pp = 2; qxl->guest_primary.bits_pp = 15; brea...
[ 0, 0 ]
FFmpeg
libavutil/log.c
static void format_line(void *ptr, int level, const char *fmt, va_list vl, AVBPrint part[3], int *print_prefix, int type[2]) { AVClass *avc = ptr ? *(AVClass **)ptr : NULL; av_bprint_init(part + 0, 0, 1); av_bprint_init(part + 1, 0, 1); av_bprint_init(part + 2, 0, 65536); if (ty...
[ 1, 0 ]
FFmpeg
libavcodec/dnxhddata.h
static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid) { if (cid != ctx->cid) { int index; if ((index = ff_dnxhd_get_cid_table(cid)) < 0) { av_log(ctx->avctx, AV_LOG_ERROR, "unsupported cid %d\n", cid); return AVERROR(ENOSYS); } if (ff_dnxhd_cid_table[index].bit_depth != ctx->bi...
[ 0, 0 ]
FFmpeg
libavutil/opencl.c
int av_opencl_create_kernel(AVOpenCLKernelEnv *env, const char *kernel_name) { cl_int status; int i, ret = 0; LOCK_OPENCL; if (strlen(kernel_name) + 1 > AV_OPENCL_MAX_KERNEL_NAME_SIZE) { av_log(&openclutils, AV_LOG_ERROR, "Created kernel name %s is too long\n", kernel_name); ret = AVER...
[ 1, 0 ]
FFmpeg
libavcodec/libx264.c
static void check_default_settings(AVCodecContext *avctx) { X264Context *x4 = avctx->priv_data; int score = 0; score += x4->params.analyse.i_me_range == 0; score += x4->params.rc.i_qp_step == 3; score += x4->params.i_keyint_max == 12; score += x4->params.rc.i_qp_min == 2; score += x4->params.rc.i_...
[ 1, 0 ]
qemu
kvm-all.c
int kvm_set_signal_mask(CPUState *env, const sigset_t *sigset) { struct kvm_signal_mask *sigmask; int r; if (!sigset) return kvm_vcpu_ioctl(env, KVM_SET_SIGNAL_MASK, NULL); sigmask = qemu_malloc(sizeof(*sigmask) + sizeof(*sigset)); sigmask->len = 8; memcpy(sigmask->sigset, sigset, sizeof(*sigset...
[ 1, 0 ]
qemu
HACKING
static const char *exynos4210_uart_regname(target_phys_addr_t offset) { int regs_number = sizeof(exynos4210_uart_regs) / sizeof(Exynos4210UartReg); int i; for (i = 0; i < regs_number; i++) { if (offset == exynos4210_uart_regs[i].offset) { return exynos4210_uart_regs[i].name; } } return NU...
[ 1, 0 ]
qemu
vl.c
void qemu_system_suspend_request(void) { if (is_suspended) { return; } suspend_requested = 1; cpu_stop_current(); qemu_notify_event(); }
[ 0, 0 ]
qemu
net/filter.c
static void netfilter_set_status(Object *obj, const char *str, Error **errp) { NetFilterState *nf = NETFILTER(obj); NetFilterClass *nfc = NETFILTER_GET_CLASS(obj); if (strcmp(str, "on") && strcmp(str, "off")) { error_setg(errp, "Invalid value for netfilter status, " "should be 'on' ...
[ 0, 0 ]
qemu
target-mips/translate.c
static void gen_movci(DisasContext *ctx, int rd, int rs, int cc, int tf) { int l1 = gen_new_label(); uint32_t ccbit; TCGCond cond; TCGv t0 = tcg_temp_local_new(TCG_TYPE_TL); TCGv t1 = tcg_temp_local_new(TCG_TYPE_TL); TCGv r_tmp = tcg_temp_local_new(TCG_TYPE_I32); if (cc) ccbit = 1 << (24 + cc...
[ 0, 0 ]
qemu
Makefile.objs
void json_prop_str(QJSON *json, const char *name, const char *str) { json_emit_element(json, name); qstring_append_chr(json->str, '"'); qstring_append(json->str, str); qstring_append_chr(json->str, '"'); }
[ 0, 0 ]
qemu
include/exec/memory.h
static void memory_region_write_accessor(MemoryRegion *mr, hwaddr addr, uint64_t *value, unsigned size, unsigned shift, ...
[ 1, 0 ]
qemu
qemu-common.h
void qemu_bh_cancel(QEMUBH *bh) { QEMUBH **pbh; if (bh->scheduled) { pbh = &first_bh; while (*pbh != bh) pbh = &(*pbh)->next; *pbh = bh->next; bh->scheduled = 0; } }
[ 1, 0 ]
qemu
Makefile.objs
static int unix_close(void *opaque) { QEMUFileSocket *s = opaque; close(s->fd); g_free(s); return 0; }
[ 1, 0 ]
qemu
block/vvfat.c
static uint32_t bonito_spciconf_readw(void *opaque, target_phys_addr_t addr) { PCIBonitoState *s = opaque; uint32_t pciaddr; uint16_t status; DPRINTF("bonito_spciconf_readw " TARGET_FMT_plx " \n", addr); assert((addr & 0x1) == 0); pciaddr = bonito_sbridge_pciaddr(s, addr); if (pciaddr == 0xffffff...
[ 1, 0 ]
qemu
HACKING
static uint64_t uart_read(void *opaque, target_phys_addr_t offset, unsigned size) { UartState *s = (UartState *)opaque; uint32_t c = 0; offset >>= 2; if (offset >= R_MAX) { return 0; } else if (offset == R_TX_RX) { uart_read_rx_fifo(s, &c); return c; } retu...
[ 1, 0 ]
FFmpeg
libavformat/adtsenc.c
static int adts_write_packet(AVFormatContext *s, AVPacket *pkt) { ADTSContext *adts = s->priv_data; AVIOContext *pb = s->pb; uint8_t buf[ADTS_HEADER_SIZE]; if (!pkt->size) return 0; if (adts->write_adts) { ff_adts_write_frame_header(adts, buf, pkt->size, adts->pce_size); avio_write(pb, bu...
[ 0, 0 ]
qemu
arch_init.c
static void smbios_build_type_1_fields(QemuOpts *opts) { const char *val; val = qemu_opt_get(opts, "manufacturer"); if (val) { smbios_add_field(1, offsetof(struct smbios_type_1, manufacturer_str), val, strlen(val) + 1); } val = qemu_opt_get(opts, "product"); if (val) { ...
[ 0, 0 ]
qemu
json-parser.c
static QObject *parse_array(JSONParserContext *ctxt, QList **tokens, va_list *ap) { QList *list = NULL; QObject *token, *peek; QList *working = qlist_copy(*tokens); token = qlist_pop(working); if (token == NULL) { goto out; } if (!token_is_operator(token, '[')) { ...
[ 0, 0 ]
qemu
block/qcow2-cache.c
int qcow2_cache_put(BlockDriverState *bs, Qcow2Cache *c, void **table) { int i = qcow2_cache_get_table_idx(bs, c, *table); if (c->entries[i].offset == 0) { return -ENOENT; } c->entries[i].ref--; *table = NULL; if (c->entries[i].ref == 0) { c->entries[i].lru_counter = ++c->lru_counter; } ...
[ 1, 0 ]
qemu
target-i386/exec.h
void helper_lsl(void) { unsigned int selector, limit; uint32_t e1, e2; CC_SRC = cc_table[CC_OP].compute_all() & ~CC_Z; selector = T0 & 0xffff; if (load_segment(&e1, &e2, selector) != 0) return; limit = (e1 & 0xffff) | (e2 & 0x000f0000); if (e2 & (1 << 23)) limit = (limit << 12) | 0xfff; ...
[ 1, 0 ]
qemu
Makefile.objs
void tcp_start_outgoing_migration(MigrationState *s, const char *host_port, Error **errp) { inet_nonblocking_connect(host_port, tcp_wait_for_connect, s, errp); }
[ 1, 0 ]
qemu
hw/scsi/mptconfig.c
size_t mptsas_config_manufacturing_1(MPTSASState *s, uint8_t **data, int address) { /* VPD - all zeros */ return MPTSAS_CONFIG_PACK(1, MPI_CONFIG_PAGETYPE_MANUFACTURING, 0x00, "s256"); }
[ 1, 0 ]
qemu
target-ppc/cpu.h
static void init_proc_620(CPUPPCState *env) { gen_spr_ne_601(env); gen_spr_620(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, ...
[ 0, 1 ]
qemu
acl.c
int drive_get_max_bus(BlockInterfaceType type) { int max_bus; DriveInfo *dinfo; max_bus = -1; TAILQ_FOREACH(dinfo, &drives, next) { if (dinfo->type == type && dinfo->bus > max_bus) max_bus = dinfo->bus; } return max_bus; }
[ 1, 0 ]
qemu
include/migration/qemu-file.h
static void qemu_fflush(QEMUFile *f) { int ret = 0; if (!f->ops->put_buffer) { return; } if (f->is_write && f->buf_index > 0) { ret = f->ops->put_buffer(f->opaque, f->buf, f->buf_offset, f->buf_index); if (ret >= 0) { f->buf_offset += f->buf_index; } f->buf_index = 0; } i...
[ 1, 0 ]
qemu
hw/pci.c
PCIBus *pci_find_bus(PCIBus *bus, int bus_num) { PCIBus *sec; if (!bus) return NULL; if (pci_bus_num(bus) == bus_num) { return bus; } /* try child bus */ QLIST_FOREACH(sec, &bus->child, sibling) { if (!bus->parent_dev /* pci host bridge */ || (pci_bus_num(sec) <= bus_num && ...
[ 0, 0 ]
qemu
HACKING
static void omap_mpui_write(void *opaque, target_phys_addr_t addr, uint64_t value, unsigned size) { struct omap_mpu_state_s *s = (struct omap_mpu_state_s *)opaque; if (size != 4) { return omap_badwidth_write32(opaque, addr, value); } switch (addr) { case 0x00: /* CTRL */...
[ 1, 0 ]
FFmpeg
libavcodec/cook.c
static int mono_decode(COOKContext *q, COOKSubpacket *p, float *mlt_buffer) { int category_index[128]; int quant_index_table[102]; int category[128]; int ret; memset(&category, 0, sizeof(category)); memset(&category_index, 0, sizeof(category_index)); if ((ret = decode_envelope(q, p, quant_index_ta...
[ 1, 0 ]
qemu
net/hub.c
int net_init_hubport(const NetClientOptions *opts, const char *name, NetClientState *peer) { const NetdevHubPortOptions *hubport; assert(opts->kind == NET_CLIENT_OPTIONS_KIND_HUBPORT); hubport = opts->hubport; if (peer) { return -EINVAL; } net_hub_add_port(hubport->hubid, na...
[ 0, 0 ]
qemu
monitor.c
static void term_delete_char(void) { if (term_cmd_buf_index < term_cmd_buf_size) { memmove(term_cmd_buf + term_cmd_buf_index, term_cmd_buf + term_cmd_buf_index + 1, term_cmd_buf_size - term_cmd_buf_index - 1); term_cmd_buf_size--; } }
[ 1, 0 ]
qemu
Makefile.target
static TranslationBlock *tb_find_slow(target_ulong pc, target_ulong cs_base, uint64_t flags) { TranslationBlock *tb, **ptb1; unsigned int h; tb_page_addr_t phys_pc, phys_page1, phys_page2; target_ulong virt_page2; tb_invalidat...
[ 1, 0 ]
qemu
io/channel-websock.c
static ssize_t qio_channel_websock_decode_payload(QIOChannelWebsock *ioc, Error **errp) { size_t i; size_t payload_len; uint32_t *payload32; if (!ioc->payload_remain) { error_setg(errp, "Decoding payload but no bytes of payload remain"...
[ 1, 0 ]
qemu
hw/arm/virt.c
static void create_flash(const VirtBoardInfo *vbi) { /* Create two flash devices to fill the VIRT_FLASH space in the memmap. * Any file passed via -bios goes in the first of these. */ hwaddr flashsize = vbi->memmap[VIRT_FLASH].size / 2; hwaddr flashbase = vbi->memmap[VIRT_FLASH].base; char *nodenam...
[ 1, 0 ]
FFmpeg
libavformat/gxfenc.c
static int gxf_interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush) { GXFContext *gxf = s->priv_data; AVPacket new_pkt; int i; for (i = 0; i < s->nb_streams; i++) { if (s->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO) { GXFStreamCo...
[ 1, 0 ]
qemu
kvm-all.c
static void kvm_mem_ioeventfd_add(MemoryListener *listener, MemoryRegionSection *section, bool match_data, uint64_t data, EventNotifier *e) { int fd = event_notifier_get_fd(e); int r; r = kvm_set_ioeventfd...
[ 1, 0 ]
qemu
fsdev/virtfs-proxy-helper.c
static int send_status(int sockfd, struct iovec *iovec, int status) { ProxyHeader header; int retval, msg_size; if (status < 0) { header.type = T_ERROR; } else { header.type = T_SUCCESS; header.size = sizeof(status); /* * marshal the return status. We don't check error. * be...
[ 1, 0 ]
FFmpeg
doc/APIchanges
int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int height, uint8_t *ptr, const int linesizes[4]) { int i, total_size, size[4], has_plane[4]; const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; memset(data, 0, sizeof(...
[ 1, 0 ]
qemu
target-ppc/cpu.h
PPC_OP(addic) { T1 = T0; T0 += PARAM(1); if (T0 < T1) { xer_ca = 1; } else { xer_ca = 0; } RETURN(); }
[ 1, 0 ]
qemu
Makefile.objs
void qemu_update_position(QEMUFile *f, size_t size) { f->pos += size; }
[ 1, 0 ]
FFmpeg
libavformat/msf.c
static int msf_probe(AVProbeData *p) { if (memcmp(p->buf, "MSF", 3)) return 0; if (AV_RB32(p->buf + 8) <= 0) return 0; if (AV_RB32(p->buf + 16) <= 0) return 0; return AVPROBE_SCORE_MAX / 3 * 2; }
[ 1, 0 ]
qemu
hw/ppc/spapr.c
static void check_exception(PowerPCCPU *cpu, sPAPREnvironment *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; sPAPREventLogE...
[ 1, 0 ]
qemu
Makefile
static void raw_fd_pool_put(RawAIOCB *acb) { BDRVRawState *s = acb->common.bs->opaque; int i; for (i = 0; i < RAW_FD_POOL_SIZE; i++) { if (s->fd_pool[i] == acb->fd) { close(s->fd_pool[i]); s->fd_pool[i] = -1; } } }
[ 1, 0 ]