label int64 0 1 | func1 stringlengths 23 97k | id int64 0 27.3k |
|---|---|---|
1 | static inline int get_chroma_qp(int chroma_qp_index_offset, int qscale){ return chroma_qp[av_clip(qscale + chroma_qp_index_offset, 0, 51)]; } | 8,097 |
1 | static int coroutine_fn iscsi_co_flush(BlockDriverState *bs) { IscsiLun *iscsilun = bs->opaque; struct IscsiTask iTask; if (bdrv_is_sg(bs)) { return 0; } if (!iscsilun->force_next_flush) { return 0; } iscsilun->force_next_flush = false; iscsi_co_init_iscsitask(iscsilun, &iTask); retry: if (iscsi_synchronizecache10_task... | 8,098 |
1 | static void mch_update_smram(MCHPCIState *mch) { PCIDevice *pd = PCI_DEVICE(mch); bool h_smrame = (pd->config[MCH_HOST_BRIDGE_ESMRAMC] & MCH_HOST_BRIDGE_ESMRAMC_H_SMRAME); uint32_t tseg_size; /* implement SMRAM.D_LCK */ if (pd->config[MCH_HOST_BRIDGE_SMRAM] & MCH_HOST_BRIDGE_SMRAM_D_LCK) { pd->config[MCH_HOST_BRIDGE_SM... | 8,099 |
1 | int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask, int mb_bitmask_size, const AVFrame *reference) { int len, nb_components, i, h, v, predictor, point_transform; int index, id, ret; const int block_size = s->lossless ? 1 : 8; int ilv, prev_shift; if (!s->got_picture) { av_log(s->avctx, AV_LOG_WARN... | 8,100 |
1 | static void gen_rot_rm_im(DisasContext *s, int ot, int op1, int op2, int is_right) { int mask = (ot == OT_QUAD ? 0x3f : 0x1f); int shift; /* load */ if (op1 == OR_TMP0) { gen_op_ld_T0_A0(ot + s->mem_index); } else { gen_op_mov_TN_reg(ot, 0, op1); } op2 &= mask; if (op2 != 0) { switch (ot) { #ifdef TARGET_X86_64 case OT... | 8,101 |
1 | void do_savevm(const char *name) { BlockDriverState *bs, *bs1; QEMUSnapshotInfo sn1, *sn = &sn1, old_sn1, *old_sn = &old_sn1; int must_delete, ret, i; BlockDriverInfo bdi1, *bdi = &bdi1; QEMUFile *f; int saved_vm_running; #ifdef _WIN32 struct _timeb tb; #else struct timeval tv; #endif bs = get_bs_snapshots(); if (!bs) ... | 8,102 |
1 | static void co_sleep_cb(void *opaque) { CoSleepCB *sleep_cb = opaque; aio_co_wake(sleep_cb->co); } | 8,104 |
1 | static int stellaris_enet_init(SysBusDevice *sbd) { DeviceState *dev = DEVICE(sbd); stellaris_enet_state *s = STELLARIS_ENET(dev); memory_region_init_io(&s->mmio, OBJECT(s), &stellaris_enet_ops, s, "stellaris_enet", 0x1000); sysbus_init_mmio(sbd, &s->mmio); sysbus_init_irq(sbd, &s->irq); qemu_macaddr_default_if_unset(&... | 8,106 |
1 | static int tcp_chr_new_client(CharDriverState *chr, QIOChannelSocket *sioc) { TCPCharDriver *s = chr->opaque; if (s->ioc != NULL) { return -1; } s->ioc = QIO_CHANNEL(sioc); object_ref(OBJECT(sioc)); if (s->do_nodelay) { qio_channel_set_delay(s->ioc, false); } if (s->listen_tag) { g_source_remove(s->listen_tag); s->list... | 8,107 |
1 | static int raw_read_packet(AVFormatContext *s, AVPacket *pkt) { int ret, size, bps; // AVStream *st = s->streams[0]; size= RAW_SAMPLES*s->streams[0]->codec->block_align; ret= av_get_packet(s->pb, pkt, size); pkt->stream_index = 0; if (ret < 0) return ret; bps= av_get_bits_per_sample(s->streams[0]->codec->codec_id); ass... | 8,108 |
1 | static int vdpau_hevc_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { HEVCContext *h = avctx->priv_data; HEVCFrame *pic = h->ref; struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private; VdpPictureInfoHEVC *info = &pic_ctx->info.hevc; const HEVCSPS *sps = h->ps.sps; const HEVCPPS... | 8,109 |
1 | void usb_cancel_packet(USBPacket * p) { assert(p->owner != NULL); usb_device_cancel_packet(p->owner->dev, p); p->owner = NULL; } | 8,110 |
0 | static int cmp_func_names(const char *a, const char *b) { int ascii_diff, digit_diff; for (; !(ascii_diff = *a - *b) && *a; a++, b++); for (; av_isdigit(*a) && av_isdigit(*b); a++, b++); return (digit_diff = av_isdigit(*a) - av_isdigit(*b)) ? digit_diff : ascii_diff; } | 8,113 |
1 | vu_queue_fill(VuDev *dev, VuVirtq *vq, const VuVirtqElement *elem, unsigned int len, unsigned int idx) { struct vring_used_elem uelem; if (unlikely(dev->broken)) { return; } vu_log_queue_fill(dev, vq, elem, len); idx = (idx + vq->used_idx) % vq->vring.num; uelem.id = elem->index; uelem.len = len; vring_used_write(dev, ... | 8,114 |
1 | void kvm_physical_sync_dirty_bitmap(target_phys_addr_t start_addr, target_phys_addr_t end_addr) { KVMState *s = kvm_state; KVMDirtyLog d; KVMSlot *mem = kvm_lookup_slot(s, start_addr); unsigned long alloc_size; ram_addr_t addr; target_phys_addr_t phys_addr = start_addr; dprintf("sync addr: %llx into %lx\n", start_addr,... | 8,115 |
1 | static void gen_mullwo(DisasContext *ctx) { TCGv_i32 t0 = tcg_temp_new_i32(); TCGv_i32 t1 = tcg_temp_new_i32(); tcg_gen_trunc_tl_i32(t0, cpu_gpr[rA(ctx->opcode)]); tcg_gen_trunc_tl_i32(t1, cpu_gpr[rB(ctx->opcode)]); tcg_gen_muls2_i32(t0, t1, t0, t1); #if defined(TARGET_PPC64) tcg_gen_concat_i32_i64(cpu_gpr[rD(ctx->opco... | 8,116 |
1 | static int http_parse_request(HTTPContext *c) { char *p; int post; char cmd[32]; char info[1024], *filename; char url[1024], *q; char protocol[32]; char msg[1024]; const char *mime_type; FFStream *stream; p = c->buffer; q = cmd; while (!isspace(*p) && *p != '\0') { if ((q - cmd) < sizeof(cmd) - 1) *q++ = *p; p++; } *q ... | 8,117 |
1 | static int add_doubles_metadata(int count, const char *name, const char *sep, TiffContext *s) { char *ap; int i; double *dp; if (count >= INT_MAX / sizeof(int64_t) || count <= 0) return AVERROR_INVALIDDATA; if (bytestream2_get_bytes_left(&s->gb) < count * sizeof(int64_t)) return AVERROR_INVALIDDATA; dp = av_malloc(coun... | 8,118 |
1 | static av_cold int che_configure(AACContext *ac, enum ChannelPosition che_pos, int type, int id, int *channels) { if (*channels >= MAX_CHANNELS) return AVERROR_INVALIDDATA; if (che_pos) { if (!ac->che[type][id]) { if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement)))) return AVERROR(ENOMEM); ff_aac_sbr_ctx_init... | 8,119 |
1 | int64_t qdict_get_int(const QDict *qdict, const char *key) { QObject *obj = qdict_get_obj(qdict, key, QTYPE_QINT); return qint_get_int(qobject_to_qint(obj)); } | 8,120 |
1 | static target_ulong h_client_architecture_support(PowerPCCPU *cpu, sPAPRMachineState *spapr, target_ulong opcode, target_ulong *args) { target_ulong list = ppc64_phys_to_real(args[0]); target_ulong ov_table; bool explicit_match = false; /* Matched the CPU's real PVR */ uint32_t max_compat = cpu->max_compat; uint32_t be... | 8,121 |
0 | static int cbs_read_ue_golomb(CodedBitstreamContext *ctx, BitstreamContext *bc, const char *name, uint32_t *write_to, uint32_t range_min, uint32_t range_max) { uint32_t value; int position; if (ctx->trace_enable) { char bits[65]; unsigned int k; int i, j; position = bitstream_tell(bc); for (i = 0; i < 32; i++) { k = bi... | 8,122 |
1 | void qmp_block_set_io_throttle(const char *device, int64_t bps, int64_t bps_rd, int64_t bps_wr, int64_t iops, int64_t iops_rd, int64_t iops_wr, bool has_bps_max, int64_t bps_max, bool has_bps_rd_max, int64_t bps_rd_max, bool has_bps_wr_max, int64_t bps_wr_max, bool has_iops_max, int64_t iops_max, bool has_iops_rd_max, ... | 8,123 |
1 | void palette8torgb32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette) { long i; /* for(i=0; i<num_pixels; i++) ((unsigned *)dst)[i] = ((unsigned *)palette)[ src[i] ]; */ for(i=0; i<num_pixels; i++) { #ifdef WORDS_BIGENDIAN dst[3]= palette[ src[i]*4+2 ]; dst[2]= palette[ src[i]*4+1 ]; dst[1]= p... | 8,125 |
0 | const char * avdevice_configuration(void) { return FFMPEG_CONFIGURATION; } | 8,126 |
1 | int ff_amf_tag_size(const uint8_t *data, const uint8_t *data_end) { const uint8_t *base = data; if (data >= data_end) return -1; switch (*data++) { case AMF_DATA_TYPE_NUMBER: return 9; case AMF_DATA_TYPE_BOOL: return 2; case AMF_DATA_TYPE_STRING: return 3 + AV_RB16(data); case AMF_DATA_TYPE_LONG_STRING: return 5 + AV_R... | 8,127 |
1 | static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap) { struct video_data *s = s1->priv_data; AVStream *st; int width, height; int res, frame_rate, frame_rate_base; uint32_t desired_format, capabilities; if (ap->width <= 0 || ap->height <= 0 || ap->time_base.den <= 0) { av_log(s1, AV_LOG_ERROR, "Miss... | 8,128 |
0 | const char *bdrv_get_node_name(const BlockDriverState *bs) { return bs->node_name; } | 8,131 |
0 | static unsigned decode_skip_count(GetBitContext* gb) { unsigned value; // This function reads a maximum of 23 bits, // which is within the padding space if (!can_safely_read(gb, 1)) return -1; value = get_bits1(gb); if (!value) return value; value += get_bits(gb, 3); if (value != (1 + ((1 << 3) - 1))) return value; val... | 8,132 |
0 | void qmp_drive_mirror(const char *device, const char *target, bool has_format, const char *format, bool has_node_name, const char *node_name, bool has_replaces, const char *replaces, enum MirrorSyncMode sync, bool has_mode, enum NewImageMode mode, bool has_speed, int64_t speed, bool has_granularity, uint32_t granularit... | 8,133 |
0 | build_rsdp(GArray *rsdp_table, BIOSLinker *linker, unsigned rsdt) { AcpiRsdpDescriptor *rsdp = acpi_data_push(rsdp_table, sizeof *rsdp); bios_linker_loader_alloc(linker, ACPI_BUILD_RSDP_FILE, rsdp_table, 16, true /* fseg memory */); memcpy(&rsdp->signature, "RSD PTR ", 8); memcpy(rsdp->oem_id, ACPI_BUILD_APPNAME6, 6); ... | 8,135 |
0 | static int tcp_chr_new_client(CharDriverState *chr, QIOChannelSocket *sioc) { TCPCharDriver *s = chr->opaque; if (s->ioc != NULL) { return -1; } s->ioc = QIO_CHANNEL(sioc); object_ref(OBJECT(sioc)); if (s->do_nodelay) { qio_channel_set_delay(s->ioc, false); } if (s->listen_tag) { g_source_remove(s->listen_tag); s->list... | 8,136 |
0 | static void q35_host_get_pci_hole64_start(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { PCIHostState *h = PCI_HOST_BRIDGE(obj); Range w64; pci_bus_get_w64_range(h->bus, &w64); visit_type_uint64(v, name, &w64.begin, errp); } | 8,137 |
0 | static void dma_mem_writel(void *opaque, target_phys_addr_t addr, uint32_t val) { DMAState *s = opaque; uint32_t saddr; saddr = (addr & DMA_MASK) >> 2; DPRINTF("write dmareg " TARGET_FMT_plx ": 0x%8.8x -> 0x%8.8x\n", addr, s->dmaregs[saddr], val); switch (saddr) { case 0: if (val & DMA_INTREN) { if (val & DMA_INTR) { D... | 8,138 |
0 | static uint64_t nvic_sysreg_read(void *opaque, target_phys_addr_t addr, unsigned size) { /* At the moment we only support the ID registers for byte/word access. * This is not strictly correct as a few of the other registers also * allow byte access. */ uint32_t offset = addr; if (offset >= 0xfe0) { if (offset & 3) { re... | 8,139 |
0 | static void qemu_run_timers(QEMUClock *clock) { QEMUTimer **ptimer_head, *ts; int64_t current_time; if (!clock->enabled) return; current_time = qemu_get_clock (clock); ptimer_head = &active_timers[clock->type]; for(;;) { ts = *ptimer_head; if (!ts || ts->expire_time > current_time) break; /* remove timer from the list ... | 8,140 |
0 | static void pci_apb_iowriteb (void *opaque, target_phys_addr_t addr, uint32_t val) { cpu_outb(addr & IOPORTS_MASK, val); } | 8,141 |
0 | void s390_sclp_extint(uint32_t parm) { if (kvm_enabled()) { kvm_s390_service_interrupt(parm); } else { S390CPU *dummy_cpu = s390_cpu_addr2state(0); cpu_inject_ext(dummy_cpu, EXT_SERVICE, parm, 0); } } | 8,142 |
0 | static int check_init_output_file(OutputFile *of, int file_index) { int ret, i; for (i = 0; i < of->ctx->nb_streams; i++) { OutputStream *ost = output_streams[of->ost_index + i]; if (!ost->initialized) return 0; } of->ctx->interrupt_callback = int_cb; ret = avformat_write_header(of->ctx, &of->opts); if (ret < 0) { av_l... | 8,143 |
0 | static void colo_compare_connection(void *opaque, void *user_data) { CompareState *s = user_data; Connection *conn = opaque; Packet *pkt = NULL; GList *result = NULL; int ret; while (!g_queue_is_empty(&conn->primary_list) && !g_queue_is_empty(&conn->secondary_list)) { qemu_mutex_lock(&s->timer_check_lock); pkt = g_queu... | 8,144 |
0 | int main_loop(void *opaque) { struct pollfd ufds[3], *pf, *serial_ufd, *net_ufd, *gdb_ufd; int ret, n, timeout, serial_ok; uint8_t ch; CPUState *env = global_env; if (!term_inited) { /* initialize terminal only there so that the user has a chance to stop QEMU with Ctrl-C before the gdb connection is launched */ term_in... | 8,146 |
0 | static int get_phys_addr_v5(CPUARMState *env, uint32_t address, int access_type, int is_user, hwaddr *phys_ptr, int *prot, target_ulong *page_size) { CPUState *cs = CPU(arm_env_get_cpu(env)); int code; uint32_t table; uint32_t desc; int type; int ap; int domain = 0; int domain_prot; hwaddr phys_addr; /* Pagetable walk.... | 8,147 |
0 | static void an5206_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; CPUM68KState *env; int kernel_size; uint64_t elf_entry; target_phys_addr_t entry; MemoryRegion *address_space_mem = get_system_memory()... | 8,148 |
0 | int cpu_x86_signal_handler(int host_signum, struct siginfo *info, void *puc) { uint32_t *regs = (uint32_t *)(info + 1); void *sigmask = (regs + 20); unsigned long pc; int is_write; uint32_t insn; /* XXX: is there a standard glibc define ? */ pc = regs[1]; /* XXX: need kernel patch to get write flag faster */ is_write =... | 8,150 |
0 | static void test_visitor_out_native_list_number(TestOutputVisitorData *data, const void *unused) { test_native_list(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_NUMBER); } | 8,151 |
1 | static int read_uncompressed_sgi(unsigned char* out_buf, SgiState *s) { int x, y, z; unsigned int offset = s->height * s->width * s->bytes_per_channel; GetByteContext gp[4]; uint8_t *out_end; /* Test buffer size. */ if (offset * s->depth > bytestream2_get_bytes_left(&s->g)) return AVERROR_INVALIDDATA; /* Create a reade... | 8,152 |
1 | static void rtas_ibm_configure_connector(PowerPCCPU *cpu, sPAPRMachineState *spapr, uint32_t token, uint32_t nargs, target_ulong args, uint32_t nret, target_ulong rets) { uint64_t wa_addr; uint64_t wa_offset; uint32_t drc_index; sPAPRDRConnector *drc; sPAPRDRConnectorClass *drck; sPAPRConfigureConnectorState *ccs; sPAP... | 8,153 |
1 | static int64_t seek_to_sector(BlockDriverState *bs, int64_t sector_num) { BDRVBochsState *s = bs->opaque; int64_t offset = sector_num * 512; int64_t extent_index, extent_offset, bitmap_offset; char bitmap_entry; // seek to sector extent_index = offset / s->extent_size; extent_offset = (offset % s->extent_size) / 512; i... | 8,156 |
0 | static int decode_fctl_chunk(AVFormatContext *s, APNGDemuxContext *ctx, AVPacket *pkt) { uint32_t sequence_number, width, height, x_offset, y_offset; uint16_t delay_num, delay_den; uint8_t dispose_op, blend_op; sequence_number = avio_rb32(s->pb); width = avio_rb32(s->pb); height = avio_rb32(s->pb); x_offset = avio_rb32... | 8,159 |
0 | static int ape_tag_read_field(AVFormatContext *s) { AVIOContext *pb = s->pb; uint8_t key[1024], *value; uint32_t size, flags; int i, c; size = avio_rl32(pb); /* field size */ flags = avio_rl32(pb); /* field flags */ for (i = 0; i < sizeof(key) - 1; i++) { c = avio_r8(pb); if (c < 0x20 || c > 0x7E) break; else key[i] = ... | 8,161 |
0 | static inline void RENAME(rgb2rgb_init)(void) { rgb15to16 = RENAME(rgb15to16); rgb15tobgr24 = RENAME(rgb15tobgr24); rgb15to32 = RENAME(rgb15to32); rgb16tobgr24 = RENAME(rgb16tobgr24); rgb16to32 = RENAME(rgb16to32); rgb16to15 = RENAME(rgb16to15); rgb24tobgr16 = RENAME(rgb24tobgr16); rgb24tobgr15 = RENAME(rgb24tobgr15); ... | 8,163 |
0 | static av_always_inline int vc1_filter_line(uint8_t* src, int stride, int pq){ uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; int a0 = (2*(src[-2*stride] - src[ 1*stride]) - 5*(src[-1*stride] - src[ 0*stride]) + 4) >> 3; int a0_sign = a0 >> 31; /* Store sign */ a0 = (a0 ^ a0_sign) - a0_sign; /* a0 = FFABS(a0); */ if(a0 < pq)... | 8,165 |
1 | static av_cold void RENAME(sws_init_swScale)(SwsContext *c) { enum PixelFormat srcFormat = c->srcFormat, dstFormat = c->dstFormat; if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat)) { if (!(c->flags & SWS_BITEXACT)) { if (c->flags & SWS_ACCURATE_RND) { c->yuv2yuv1 = RENAME(yuv2yuv1_ar ); c->yuv2yuvX = RENAME(yuv2yuvX... | 8,166 |
1 | static void new_subtitle_stream(AVFormatContext *oc) { AVStream *st; AVCodec *codec=NULL; AVCodecContext *subtitle_enc; st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0); if (!st) { fprintf(stderr, "Could not alloc stream\n"); ffmpeg_exit(1); } subtitle_enc = st->codec; output_... | 8,167 |
1 | static int qemu_rdma_registration_handle(QEMUFile *f, void *opaque) { RDMAControlHeader reg_resp = { .len = sizeof(RDMARegisterResult), .type = RDMA_CONTROL_REGISTER_RESULT, .repeat = 0, }; RDMAControlHeader unreg_resp = { .len = 0, .type = RDMA_CONTROL_UNREGISTER_FINISHED, .repeat = 0, }; RDMAControlHeader blocks = { ... | 8,170 |
1 | static void set_sigmask(const sigset_t *set) { do_sigprocmask(SIG_SETMASK, set, NULL); } | 8,172 |
1 | int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t min_size, bool exact_size) { BDRVQcowState *s = bs->opaque; int new_l1_size2, ret, i; uint64_t *new_l1_table; int64_t old_l1_table_offset, old_l1_size; int64_t new_l1_table_offset, new_l1_size; uint8_t data[12]; if (min_size <= s->l1_size) return 0; if (exact_size)... | 8,174 |
1 | static void test_submit_aio(void) { WorkerTestData data = { .n = 0, .ret = -EINPROGRESS }; data.aiocb = thread_pool_submit_aio(pool, worker_cb, &data, done_cb, &data); /* The callbacks are not called until after the first wait. */ active = 1; g_assert_cmpint(data.ret, ==, -EINPROGRESS); qemu_aio_wait_all(); g_assert_cm... | 8,175 |
1 | static inline void silk_stabilize_lsf(int16_t nlsf[16], int order, const uint16_t min_delta[17]) { int pass, i; for (pass = 0; pass < 20; pass++) { int k, min_diff = 0; for (i = 0; i < order+1; i++) { int low = i != 0 ? nlsf[i-1] : 0; int high = i != order ? nlsf[i] : 32768; int diff = (high - low) - (min_delta[i]); if... | 8,176 |
1 | static void virtio_scsi_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq) { VirtIOSCSI *s = (VirtIOSCSI *)vdev; VirtIOSCSIReq *req; if (s->ctx && !s->dataplane_started) { virtio_scsi_dataplane_start(s); return; } while ((req = virtio_scsi_pop_req(s, vq))) { virtio_scsi_handle_ctrl_req(s, req); } } | 8,178 |
0 | static int decode_channel_sound_unit(ATRAC3Context *q, GetBitContext *gb, ChannelUnit *snd, float *output, int channel_num, int coding_mode) { int band, ret, num_subbands, last_tonal, num_bands; GainBlock *gain1 = &snd->gain_block[ snd->gc_blk_switch]; GainBlock *gain2 = &snd->gain_block[1 - snd->gc_blk_switch]; if (co... | 8,179 |
0 | static void RENAME(extract_odd2)(const uint8_t *src, uint8_t *dst0, uint8_t *dst1, x86_reg count) { dst0+= count; dst1+= count; src += 4*count; count= - count; #if COMPILE_TEMPLATE_MMX if(count <= -8) { count += 7; __asm__ volatile( "pcmpeqw %%mm7, %%mm7 \n\t" "psrlw $8, %%mm7 \n\t" "1: \n\t" "movq -28(%1, %0, 4), %%mm... | 8,180 |
0 | static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; H264Context *h = avctx->priv_data; MpegEncContext *s = &h->s; AVFrame *pict = data; int buf_index; s->flags= avctx->flags; s->flags2= avctx->flags2; /* end of strea... | 8,183 |
0 | static int tscc2_decode_mb(TSCC2Context *c, int *q, int vlc_set, uint8_t *dst, int stride, int plane) { GetBitContext *gb = &c->gb; int prev_dc, dc, nc, ac, bpos, val; int i, j, k, l; if (get_bits1(gb)) { if (get_bits1(gb)) { val = get_bits(gb, 8); for (i = 0; i < 8; i++, dst += stride) memset(dst, val, 16); } else { i... | 8,184 |
0 | static void subband_transform(DCAEncContext *c, const int32_t *input) { int ch, subs, i, k, j; for (ch = 0; ch < c->fullband_channels; ch++) { /* History is copied because it is also needed for PSY */ int32_t hist[512]; int hist_start = 0; const int chi = c->channel_order_tab[ch]; for (i = 0; i < 512; i++) hist[i] = c-... | 8,185 |
1 | static void test_in_coroutine(void) { Coroutine *coroutine; g_assert(!qemu_in_coroutine()); coroutine = qemu_coroutine_create(verify_in_coroutine); qemu_coroutine_enter(coroutine, NULL); } | 8,186 |
1 | static void pcx_palette(const uint8_t **src, uint32_t *dst, unsigned int pallen) { unsigned int i; for (i=0; i<pallen; i++) *dst++ = 0xFF000000 | bytestream_get_be24(src); if (pallen < 256) memset(dst, 0, (256 - pallen) * sizeof(*dst)); } | 8,187 |
1 | block_crypto_open_opts_init(QCryptoBlockFormat format, QemuOpts *opts, Error **errp) { OptsVisitor *ov; QCryptoBlockOpenOptions *ret = NULL; Error *local_err = NULL; ret = g_new0(QCryptoBlockOpenOptions, 1); ret->format = format; ov = opts_visitor_new(opts); visit_start_struct(opts_get_visitor(ov), NULL, NULL, 0, &loca... | 8,188 |
1 | static void xhci_class_init(ObjectClass *klass, void *data) { PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); DeviceClass *dc = DEVICE_CLASS(klass); dc->vmsd = &vmstate_xhci; dc->props = xhci_properties; dc->reset = xhci_reset; k->init = usb_xhci_initfn; k->vendor_id = PCI_VENDOR_ID_NEC; k->device_id = PCI_DEVICE_ID_NEC_U... | 8,189 |
1 | static int mxf_read_sequence(MXFSequence *sequence, ByteIOContext *pb, int tag) { switch(tag) { case 0x0202: sequence->duration = get_be64(pb); break; case 0x0201: get_buffer(pb, sequence->data_definition_ul, 16); break; case 0x1001: sequence->structural_components_count = get_be32(pb); if (sequence->structural_compone... | 8,191 |
1 | static int common_init(AVCodecContext *avctx){ HYuvContext *s = avctx->priv_data; int i; s->avctx= avctx; s->flags= avctx->flags; dsputil_init(&s->dsp, avctx); s->width= avctx->width; s->height= avctx->height; assert(s->width>0 && s->height>0); for(i=0; i<3; i++){ s->temp[i]= av_malloc(avctx->width + 16); } return 0; } | 8,192 |
1 | static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps) { int log2_min_cb_size = sps->log2_min_cb_size; int width = sps->width; int height = sps->height; int pic_size_in_ctb = ((width >> log2_min_cb_size) + 1) * ((height >> log2_min_cb_size) + 1); int ctb_count = sps->ctb_width * sps->ctb_height; int min_pu_size... | 8,193 |
1 | static int decode_dc_progressive(MJpegDecodeContext *s, int16_t *block, int component, int dc_index, int16_t *quant_matrix, int Al) { int val; s->bdsp.clear_block(block); 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... | 8,194 |
1 | static int config_input(AVFilterLink *inlink) { HQDN3DContext *s = inlink->dst->priv; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); int i; s->hsub = desc->log2_chroma_w; s->vsub = desc->log2_chroma_h; s->depth = desc->comp[0].depth_minus1+1; s->line = av_malloc(inlink->w * sizeof(*s->line)); if ... | 8,195 |
0 | static int64_t mkv_write_cues(AVIOContext *pb, mkv_cues *cues, mkv_track *tracks, int num_tracks) { ebml_master cues_element; int64_t currentpos; int i, j; currentpos = avio_tell(pb); cues_element = start_ebml_master(pb, MATROSKA_ID_CUES, 0); for (i = 0; i < cues->num_entries; i++) { ebml_master cuepoint, track_positio... | 8,198 |
1 | static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index, int pixel_stride) { int x, y; int16_t *sample[2]; sample[0] = s->sample_buffer + 3; sample[1] = s->sample_buffer + w + 6 + 3; s->run_index = 0; memset(s->sample_buffer, 0, 2 * (w + 6) * sizeof(*s->sample_buffer)); for (y =... | 8,200 |
1 | void curses_display_init(DisplayState *ds, int full_screen) { #ifndef _WIN32 if (!isatty(1)) { fprintf(stderr, "We need a terminal output\n"); exit(1); } #endif curses_setup(); curses_keyboard_setup(); atexit(curses_atexit); curses_winch_init(); dcl = (DisplayChangeListener *) g_malloc0(sizeof(DisplayChangeListener)); ... | 8,201 |
1 | static int wav_read_header(AVFormatContext *s, AVFormatParameters *ap) { int size; unsigned int tag; ByteIOContext *pb = s->pb; AVStream *st; WAVContext *wav = s->priv_data; /* check RIFF header */ tag = get_le32(pb); if (tag != MKTAG('R', 'I', 'F', 'F')) return -1; get_le32(pb); /* file size */ tag = get_le32(pb); if ... | 8,202 |
1 | static void add_to_iovec(QEMUFile *f, const uint8_t *buf, int size) { /* check for adjacent buffer and coalesce them */ if (f->iovcnt > 0 && buf == f->iov[f->iovcnt - 1].iov_base + f->iov[f->iovcnt - 1].iov_len) { f->iov[f->iovcnt - 1].iov_len += size; } else { f->iov[f->iovcnt].iov_base = (uint8_t *)buf; f->iov[f->iov... | 8,203 |
1 | int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt) { AVCodecInternal *avci = avctx->internal; int ret; *got_picture_ptr = 0; if ((avctx->coded_width || avctx->coded_height) && av_image_check_size(avctx->coded_width, avctx->coded_height, 0, avctx... | 8,204 |
1 | int av_new_packet(AVPacket *pkt, int size) { uint8_t *data; if((unsigned)size > (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE) return AVERROR(ENOMEM); data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); if (!data) return AVERROR(ENOMEM); memset(data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE); av_init_packet(pkt); pkt-... | 8,205 |
1 | static int decode_slice(H264Context *h){ MpegEncContext * const s = &h->s; const int part_mask= s->partitioned_frame ? (AC_END|AC_ERROR) : 0x7F; s->mb_skip_run= -1; if( h->pps.cabac ) { int i; /* realign */ align_get_bits( &s->gb ); /* init cabac */ ff_init_cabac_states( &h->cabac, ff_h264_lps_range, ff_h264_mps_state,... | 8,206 |
1 | static av_cold int dirac_decode_init(AVCodecContext *avctx) { DiracContext *s = avctx->priv_data; int i; s->avctx = avctx; s->frame_number = -1; if (avctx->flags&CODEC_FLAG_EMU_EDGE) { av_log(avctx, AV_LOG_ERROR, "Edge emulation not supported!\n"); return AVERROR_PATCHWELCOME; } ff_dsputil_init(&s->dsp, avctx); ff_dira... | 8,207 |
1 | static int qemu_chr_open_win_file(HANDLE fd_out, CharDriverState **pchr) { CharDriverState *chr; WinCharState *s; chr = g_malloc0(sizeof(CharDriverState)); s = g_malloc0(sizeof(WinCharState)); s->hcom = fd_out; chr->opaque = s; chr->chr_write = win_chr_write; qemu_chr_generic_open(chr); *pchr = chr; return 0; } | 8,210 |
1 | int qcrypto_cipher_encrypt(QCryptoCipher *cipher, const void *in, void *out, size_t len, Error **errp) { QCryptoCipherNettle *ctx = cipher->opaque; switch (cipher->mode) { case QCRYPTO_CIPHER_MODE_ECB: ctx->alg_encrypt(ctx->ctx_encrypt, len, out, in); break; case QCRYPTO_CIPHER_MODE_CBC: cbc_encrypt(ctx->ctx_encrypt, c... | 8,212 |
1 | static int color_distance(uint32_t a, uint32_t b) { int r = 0, d, i; for (i = 0; i < 32; i += 8) { d = ((a >> i) & 0xFF) - ((b >> i) & 0xFF); r += d * d; } return r; } | 8,213 |
1 | static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag, uint8_t *cmd, int lun) { SCSIGenericState *s = DO_UPCAST(SCSIGenericState, qdev, d); SCSIGenericReq *r; SCSIBus *bus; int ret; if (cmd[0] != REQUEST_SENSE && (lun != s->lun || (cmd[1] >> 5) != s->lun)) { DPRINTF("Unimplemented LUN %d\n", lun ? lun : cmd[1] >... | 8,214 |
1 | static void gen_mfsr_64b(DisasContext *ctx) { #if defined(CONFIG_USER_ONLY) gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG); #else TCGv t0; if (unlikely(ctx->pr)) { gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG); return; } t0 = tcg_const_tl(SR(ctx->opcode)); gen_helper_load_sr(cpu_gpr[rD(ctx->opcode)], cpu_env, t0); t... | 8,215 |
1 | struct omap_gpmc_s *omap_gpmc_init(target_phys_addr_t base, qemu_irq irq) { struct omap_gpmc_s *s = (struct omap_gpmc_s *) g_malloc0(sizeof(struct omap_gpmc_s)); memory_region_init_io(&s->iomem, &omap_gpmc_ops, s, "omap-gpmc", 0x1000); memory_region_add_subregion(get_system_memory(), base, &s->iomem); omap_gpmc_reset(s... | 8,216 |
1 | static void sbr_qmf_deint_bfly_c(INTFLOAT *v, const INTFLOAT *src0, const INTFLOAT *src1) { int i; for (i = 0; i < 64; i++) { v[ i] = AAC_SRA_R((src0[i] - src1[63 - i]), 5); v[127 - i] = AAC_SRA_R((src0[i] + src1[63 - i]), 5); } } | 8,219 |
1 | 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 + h) * linesize; uint32_t *dst_px; for (; src_py < src_p... | 8,220 |
1 | void OPPROTO op_divd (void) { if (unlikely(((int64_t)T0 == INT64_MIN && (int64_t)T1 == -1) || (int64_t)T1 == 0)) { T0 = (int64_t)((-1ULL) * ((uint64_t)T0 >> 63)); } else { T0 = (int64_t)T0 / (int64_t)T1; } RETURN(); } | 8,222 |
1 | static uint64_t cg3_reg_read(void *opaque, hwaddr addr, unsigned size) { CG3State *s = opaque; int val; switch (addr) { case CG3_REG_BT458_ADDR: case CG3_REG_BT458_COLMAP: val = 0; break; case CG3_REG_FBC_CTRL: val = s->regs[0]; break; case CG3_REG_FBC_STATUS: /* monitor ID 6, board type = 1 (color) */ val = s->regs[1]... | 8,223 |
1 | static int expand_rle_row(SgiState *s, uint8_t *out_buf, uint8_t *out_end, int pixelstride) { unsigned char pixel, count; unsigned char *orig = out_buf; while (1) { if (bytestream2_get_bytes_left(&s->g) < 1) return AVERROR_INVALIDDATA; pixel = bytestream2_get_byteu(&s->g); if (!(count = (pixel & 0x7f))) { return (out_b... | 8,224 |
1 | static void new_connection(int server_fd, int is_rtsp) { struct sockaddr_in from_addr; int fd, len; HTTPContext *c = NULL; len = sizeof(from_addr); fd = accept(server_fd, (struct sockaddr *)&from_addr, &len); if (fd < 0) return; fcntl(fd, F_SETFL, O_NONBLOCK); /* XXX: should output a warning page when coming close to t... | 8,225 |
1 | static void apply_independent_coupling_fixed(AACContext *ac, SingleChannelElement *target, ChannelElement *cce, int index) { int i, c, shift, round, tmp; const int gain = cce->coup.gain[index][0]; const int *src = cce->ch[0].ret; int *dest = target->ret; const int len = 1024 << (ac->oc[1].m4ac.sbr == 1); c = cce_scale_... | 8,227 |
1 | int kvm_arch_get_registers(CPUState *cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; struct kvm_regs regs; struct kvm_sregs sregs; uint32_t cr; int i, ret; ret = kvm_vcpu_ioctl(cs, KVM_GET_REGS, ®s); if (ret < 0) return ret; cr = regs.cr; for (i = 7; i >= 0; i--) { env->crf[i] = cr & 15; cr >>... | 8,228 |
1 | static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, MOVAtom atom) { int i; int width; int height; int display_matrix[3][3]; AVStream *st; MOVStreamContext *sc; int version; int flags; if (c->fc->nb_streams < 1) return 0; st = c->fc->streams[c->fc->nb_streams-1]; sc = st->priv_data; version = avio_r8(pb); flags = a... | 8,229 |
1 | int ff_mjpeg_find_marker(MJpegDecodeContext *s, const uint8_t **buf_ptr, const uint8_t *buf_end, const uint8_t **unescaped_buf_ptr, int *unescaped_buf_size) { int start_code; start_code = find_marker(buf_ptr, buf_end); av_fast_padded_malloc(&s->buffer, &s->buffer_size, buf_end - *buf_ptr); if (!s->buffer) return AVERRO... | 8,230 |
1 | static void rc4030_dma_tt_write(void *opaque, hwaddr addr, uint64_t data, unsigned int size) { rc4030State *s = opaque; /* write memory */ memcpy(memory_region_get_ram_ptr(&s->dma_tt) + addr, &data, size); /* update dma address space (only if frame field has been written) */ if (addr % sizeof(dma_pagetable_entry) == 0)... | 8,231 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.