label int64 0 1 | func1 stringlengths 23 97k | id int64 0 27.3k |
|---|---|---|
0 | static int encode_block(SVQ1Context *s, uint8_t *src, uint8_t *ref, uint8_t *decoded, int stride, int level, int threshold, int lambda, int intra){ int count, y, x, i, j, split, best_mean, best_score, best_count; int best_vector[6]; int block_sum[7]= {0, 0, 0, 0, 0, 0}; int w= 2<<((level+2)>>1); int h= 2<<((level+1)>>1... | 18,369 |
0 | int ff_v4l2_context_dequeue_frame(V4L2Context* ctx, AVFrame* frame) { V4L2Buffer* avbuf = NULL; /* if we are draining, we are no longer inputing data, therefore enable a * timeout so we can dequeue and flag the last valid buffer. * * blocks until: * 1. decoded frame available * 2. an input buffer is ready to be dequeue... | 18,370 |
0 | int ff_h264_decode_mb_cabac(H264Context *h) { MpegEncContext * const s = &h->s; int mb_xy; int mb_type, partition_count, cbp = 0; int dct8x8_allowed= h->pps.transform_8x8_mode; mb_xy = h->mb_xy = s->mb_x + s->mb_y*s->mb_stride; tprintf(s->avctx, "pic:%d mb:%d/%d\n", h->frame_num, s->mb_x, s->mb_y); if( h->slice_type_no... | 18,372 |
1 | static int parse_read_interval(const char *interval_spec, ReadInterval *interval) { int ret = 0; char *next, *p, *spec = av_strdup(interval_spec); if (!spec) return AVERROR(ENOMEM); if (!*spec) { av_log(NULL, AV_LOG_ERROR, "Invalid empty interval specification\n"); ret = AVERROR(EINVAL); goto end; } p = spec; next = st... | 18,373 |
1 | static uint32_t qvirtio_pci_get_guest_features(QVirtioDevice *d) { QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d; return qpci_io_readl(dev->pdev, dev->addr + VIRTIO_PCI_GUEST_FEATURES); } | 18,374 |
1 | bool virtio_scsi_handle_cmd_req_prepare(VirtIOSCSI *s, VirtIOSCSIReq *req) { VirtIOSCSICommon *vs = &s->parent_obj; SCSIDevice *d; int rc; rc = virtio_scsi_parse_req(req, sizeof(VirtIOSCSICmdReq) + vs->cdb_size, sizeof(VirtIOSCSICmdResp) + vs->sense_size); if (rc < 0) { if (rc == -ENOTSUP) { virtio_scsi_fail_cmd_req(re... | 18,375 |
1 | static int mxf_read_primer_pack(void *arg, AVIOContext *pb, int tag, int size, UID uid) { MXFContext *mxf = arg; int item_num = avio_rb32(pb); int item_len = avio_rb32(pb); if (item_len != 18) { av_log(mxf->fc, AV_LOG_ERROR, "unsupported primer pack item length\n"); return -1; } if (item_num > UINT_MAX / item_len) retu... | 18,376 |
1 | void qmp_transaction(BlockdevActionList *dev_list, Error **errp) { int ret = 0; BlockdevActionList *dev_entry = dev_list; BlkTransactionStates *states, *next; QSIMPLEQ_HEAD(snap_bdrv_states, BlkTransactionStates) snap_bdrv_states; QSIMPLEQ_INIT(&snap_bdrv_states); /* drain all i/o before any snapshots */ bdrv_drain_all... | 18,377 |
1 | static int genh_read_header(AVFormatContext *s) { unsigned start_offset, header_size, codec, coef_type, coef[2]; GENHDemuxContext *c = s->priv_data; av_unused unsigned coef_splitted[2]; int align, ch, ret; AVStream *st; avio_skip(s->pb, 4); st = avformat_new_stream(s, NULL); if (!st) return AVERROR(ENOMEM); st->codecpa... | 18,378 |
1 | static void virtio_scsi_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); dc->exit = virtio_scsi_device_exit; dc->props = virtio_scsi_properties; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); vdc->init = virtio_scsi_device_init; ... | 18,379 |
1 | static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty, Jpeg2000ResLevel *rlevel, int precno, int layno, uint8_t *expn, int numgbits) { int bandno, cblkno, ret, nb_code_blocks; if (!(ret = get_bits(s, 1))) { jpeg2000_flush(s); return 0; } else if (ret < 0) return ret; for (bandno = 0; ... | 18,380 |
1 | void v9fs_device_unrealize_common(V9fsState *s, Error **errp) { g_free(s->tag); g_free(s->ctx.fs_root); | 18,381 |
1 | void virtio_scsi_common_realize(DeviceState *dev, Error **errp, HandleOutput ctrl, HandleOutput evt, HandleOutput cmd) { VirtIODevice *vdev = VIRTIO_DEVICE(dev); VirtIOSCSICommon *s = VIRTIO_SCSI_COMMON(dev); int i; virtio_init(vdev, "virtio-scsi", VIRTIO_ID_SCSI, sizeof(VirtIOSCSIConfig)); if (s->conf.num_queues <= 0 ... | 18,382 |
0 | static int rpza_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { RpzaContext *s = avctx->priv_data; int ret; bytestream2_init(&s->gb, avpkt->data, avpkt->size); if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); return ret; } rpz... | 18,383 |
1 | static int decode_cell_data(Cell *cell, uint8_t *block, uint8_t *ref_block, int pitch, int h_zoom, int v_zoom, int mode, const vqEntry *delta[2], int swap_quads[2], const uint8_t **data_ptr, const uint8_t *last_ptr) { int x, y, line, num_lines; int rle_blocks = 0; uint8_t code, *dst, *ref; const vqEntry *delta_tab; uns... | 18,385 |
1 | static void superh_cpu_realizefn(DeviceState *dev, Error **errp) { SuperHCPU *cpu = SUPERH_CPU(dev); SuperHCPUClass *scc = SUPERH_CPU_GET_CLASS(dev); cpu_reset(CPU(cpu)); scc->parent_realize(dev, errp); } | 18,386 |
1 | static void http_log(char *fmt, ...) { va_list ap; va_start(ap, fmt); if (logfile) vfprintf(logfile, fmt, ap); va_end(ap); } | 18,387 |
1 | void HELPER(access_check_cp_reg)(CPUARMState *env, void *rip) { const ARMCPRegInfo *ri = rip; switch (ri->accessfn(env, ri)) { case CP_ACCESS_OK: return; case CP_ACCESS_TRAP: case CP_ACCESS_TRAP_UNCATEGORIZED: /* These cases will eventually need to generate different * syndrome information. */ break; default: g_assert_... | 18,388 |
0 | static void skip_block (uint8_t *current, uint8_t *previous, int pitch, int x, int y) { uint8_t *src; uint8_t *dst; int i; src = &previous[x + y*pitch]; dst = current; for (i=0; i < 16; i++) { memcpy (dst, src, 16); src += pitch; dst += pitch; } } | 18,389 |
1 | static int mlp_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size) { MLPParseContext *mp = s->priv_data; int sync_present; uint8_t parity_bits; int next; int i, p = 0; *poutbuf_size = 0; if (buf_size == 0) return 0; if (!mp->in_sync) { // N... | 18,391 |
1 | void ppc_translate_init(void) { int i; char* p; size_t cpu_reg_names_size; static int done_init = 0; if (done_init) return; cpu_env = tcg_global_reg_new_ptr(TCG_AREG0, "env"); p = cpu_reg_names; cpu_reg_names_size = sizeof(cpu_reg_names); for (i = 0; i < 8; i++) { snprintf(p, cpu_reg_names_size, "crf%d", i); cpu_crf[i]... | 18,392 |
1 | void qusb_pci_init_one(QPCIBus *pcibus, struct qhc *hc, uint32_t devfn, int bar) { hc->dev = qpci_device_find(pcibus, devfn); g_assert(hc->dev != NULL); qpci_device_enable(hc->dev); hc->base = qpci_iomap(hc->dev, bar, NULL); g_assert(hc->base != NULL); } | 18,393 |
1 | static int mov_write_hdlr_tag(AVIOContext *pb, MOVTrack *track) { const char *hdlr, *descr = NULL, *hdlr_type = NULL; int64_t pos = avio_tell(pb); if (!track) { /* no media --> data handler */ hdlr = (track->mode == MODE_MOV) ? "mhlr" : "\0\0\0\0"; if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) { hdlr_type = "vide";... | 18,394 |
1 | static coroutine_fn void nbd_co_client_start(void *opaque) { NBDClientNewData *data = opaque; NBDClient *client = data->client; NBDExport *exp = client->exp; if (exp) { nbd_export_get(exp); QTAILQ_INSERT_TAIL(&exp->clients, client, next); } qemu_co_mutex_init(&client->send_lock); if (nbd_negotiate(data)) { client_close... | 18,395 |
1 | static inline int vfp_exceptbits_from_host(int host_bits) { int target_bits = 0; if (host_bits & float_flag_invalid) target_bits |= 1; if (host_bits & float_flag_divbyzero) target_bits |= 2; if (host_bits & float_flag_overflow) target_bits |= 4; if (host_bits & float_flag_underflow) target_bits |= 8; if (host_bits & fl... | 18,396 |
1 | const char *memory_region_name(const MemoryRegion *mr) { return object_get_canonical_path_component(OBJECT(mr)); } | 18,397 |
1 | static int dnxhd_decode_macroblock(const DNXHDContext *ctx, RowContext *row, AVFrame *frame, int x, int y) { int shift1 = ctx->bit_depth == 10; int dct_linesize_luma = frame->linesize[0]; int dct_linesize_chroma = frame->linesize[1]; uint8_t *dest_y, *dest_u, *dest_v; int dct_y_offset, dct_x_offset; int qscale, i, act;... | 18,398 |
1 | static void wmv2_idct_col(short * b) { int s1,s2; int a0,a1,a2,a3,a4,a5,a6,a7; /*step 1, with extended precision*/ a1 = (W1*b[8*1]+W7*b[8*7] + 4)>>3; a7 = (W7*b[8*1]-W1*b[8*7] + 4)>>3; a5 = (W5*b[8*5]+W3*b[8*3] + 4)>>3; a3 = (W3*b[8*5]-W5*b[8*3] + 4)>>3; a2 = (W2*b[8*2]+W6*b[8*6] + 4)>>3; a6 = (W6*b[8*2]-W2*b[8*6] + 4)... | 18,399 |
1 | static void bonito_writel(void *opaque, hwaddr addr, uint64_t val, unsigned size) { PCIBonitoState *s = opaque; uint32_t saddr; int reset = 0; saddr = (addr - BONITO_REGBASE) >> 2; DPRINTF("bonito_writel "TARGET_FMT_plx" val %x saddr %x\n", addr, val, saddr); switch (saddr) { case BONITO_BONPONCFG: case BONITO_IODEVCFG... | 18,400 |
1 | static int init_resampler(AVCodecContext *input_codec_context, AVCodecContext *output_codec_context, SwrContext **resample_context) { /** * Only initialize the resampler if it is necessary, i.e., * if and only if the sample formats differ. */ if (input_codec_context->sample_fmt != output_codec_context->sample_fmt || in... | 18,401 |
1 | static int qemu_rdma_dest_init(RDMAContext *rdma, Error **errp) { int ret = -EINVAL, idx; struct rdma_cm_id *listen_id; char ip[40] = "unknown"; struct addrinfo *res; char port_str[16]; for (idx = 0; idx < RDMA_WRID_MAX; idx++) { rdma->wr_data[idx].control_len = 0; rdma->wr_data[idx].control_curr = NULL; } if (rdma->ho... | 18,403 |
1 | static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64]) { int cbp, code, i; uint32_t * const mb_type_ptr = &s->current_picture.mb_type[s->mb_x + s->mb_y*s->mb_stride]; if (s->pict_type == AV_PICTURE_TYPE_P) { if (s->use_skip_mb_code) { if (get_bits1(&s->gb)) { /* skip mb */ s->mb_intra = 0; for(i=0;i<6... | 18,404 |
1 | static int decode_tsw1(GetByteContext *gb, uint8_t *frame, int width, int height) { const uint8_t *frame_start = frame; const uint8_t *frame_end = frame + width * height; int mask = 0x10000, bitbuf = 0; int v, count, segments; unsigned offset; segments = bytestream2_get_le32(gb); offset = bytestream2_get_le32(gb); if (... | 18,406 |
1 | static int qpel_motion_search(MpegEncContext * s, int *mx_ptr, int *my_ptr, int dmin, int src_index, int ref_index, int size, int h) { MotionEstContext * const c= &s->me; const int mx = *mx_ptr; const int my = *my_ptr; const int penalty_factor= c->sub_penalty_factor; const int map_generation= c->map_generation; const i... | 18,407 |
1 | void migrate_fd_error(MigrationState *s) { trace_migrate_fd_error(); assert(s->to_dst_file == NULL); migrate_set_state(&s->state, MIGRATION_STATUS_SETUP, MIGRATION_STATUS_FAILED); notifier_list_notify(&migration_state_notifiers, s); } | 18,408 |
1 | static uint32_t rtl8139_TxStatus_read(RTL8139State *s, uint8_t addr, int size) { uint32_t reg = (addr - TxStatus0) / 4; uint32_t offset = addr & 0x3; uint32_t ret = 0; if (addr & (size - 1)) { DPRINTF("not implemented read for TxStatus addr=0x%x size=0x%x\n", addr, size); return ret; } switch (size) { case 1: /* fall t... | 18,410 |
1 | static int decode_gop_header(IVI45DecContext *ctx, AVCodecContext *avctx) { int result, i, p, tile_size, pic_size_indx, mb_size, blk_size, is_scalable; int quant_mat, blk_size_changed = 0; IVIBandDesc *band, *band1, *band2; IVIPicConfig pic_conf; ctx->gop_flags = get_bits(&ctx->gb, 8); ctx->gop_hdr_size = (ctx->gop_fla... | 18,414 |
1 | static void virtio_gpu_cleanup_mapping(struct virtio_gpu_simple_resource *res) { virtio_gpu_cleanup_mapping_iov(res->iov, res->iov_cnt); g_free(res->iov); res->iov = NULL; res->iov_cnt = 0; } | 18,415 |
0 | static int get_packet(URLContext *s, int for_header) { RTMPContext *rt = s->priv_data; int ret; uint8_t *p; const uint8_t *next; uint32_t data_size; uint32_t ts, cts, pts=0; if (rt->state == STATE_STOPPED) return AVERROR_EOF; for (;;) { RTMPPacket rpkt = { 0 }; if ((ret = ff_rtmp_packet_read(rt->stream, &rpkt, rt->chun... | 18,416 |
0 | static int pcm_encode_frame(AVCodecContext *avctx, unsigned char *frame, int buf_size, void *data) { int n, sample_size, v; const short *samples; unsigned char *dst; const uint8_t *srcu8; const int16_t *samples_int16_t; const int32_t *samples_int32_t; const int64_t *samples_int64_t; const uint16_t *samples_uint16_t; co... | 18,417 |
0 | static int exif_add_metadata(AVCodecContext *avctx, int count, int type, const char *name, const char *sep, GetByteContext *gb, int le, AVDictionary **metadata) { switch(type) { case 0: av_log(avctx, AV_LOG_WARNING, "Invalid TIFF tag type 0 found for %s with size %d\n", name, count); return 0; case TIFF_DOUBLE : return... | 18,418 |
0 | static int mtv_probe(AVProbeData *p) { if(p->buf_size < 3) return 0; /* Magic is 'AMV' */ if(*(p->buf) != 'A' || *(p->buf+1) != 'M' || *(p->buf+2) != 'V') return 0; return AVPROBE_SCORE_MAX; } | 18,420 |
0 | static int vmd_probe(AVProbeData *p) { if (p->buf_size < 2) return 0; /* check if the first 2 bytes of the file contain the appropriate size * of a VMD header chunk */ if (AV_RL16(&p->buf[0]) != VMD_HEADER_SIZE - 2) return 0; /* only return half certainty since this check is a bit sketchy */ return AVPROBE_SCORE_MAX / ... | 18,421 |
0 | voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size) { VocDecContext *voc = s->priv_data; AVCodecContext *dec = st->codec; ByteIOContext *pb = s->pb; VocType type; int size, tmp_codec; int sample_rate = 0; int channels = 1; while (!voc->remaining_size) { type = get_byte(pb); if (type == VOC_TYP... | 18,422 |
1 | static inline int mjpeg_decode_dc(MJpegDecodeContext *s, int dc_index) { int code; code = get_vlc2(&s->gb, s->vlcs[0][dc_index].table, 9, 2); if (code < 0) { av_log(s->avctx, AV_LOG_WARNING, "mjpeg_decode_dc: bad vlc: %d:%d (%p)\n", 0, dc_index, &s->vlcs[0][dc_index]); return 0xffff; } if (code) return get_xbits(&s->gb... | 18,423 |
1 | static void palmte_init(MachineState *machine) { const char *cpu_model = machine->cpu_model; const char *kernel_filename = machine->kernel_filename; const char *kernel_cmdline = machine->kernel_cmdline; const char *initrd_filename = machine->initrd_filename; MemoryRegion *address_space_mem = get_system_memory(); struct... | 18,424 |
1 | static void aio_signal_handler(int signum) { #if !defined(QEMU_IMG) && !defined(QEMU_NBD) CPUState *env = cpu_single_env; if (env) { /* stop the currently executing cpu because a timer occured */ cpu_interrupt(env, CPU_INTERRUPT_EXIT); #ifdef USE_KQEMU if (env->kqemu_enabled) { kqemu_cpu_interrupt(env); } #endif } #end... | 18,428 |
1 | static int mov_read_mfra(MOVContext *c, AVIOContext *f) { int64_t stream_size = avio_size(f); int64_t original_pos = avio_tell(f); int64_t seek_ret; int32_t mfra_size; int ret = -1; if ((seek_ret = avio_seek(f, stream_size - 4, SEEK_SET)) < 0) { ret = seek_ret; goto fail; } mfra_size = avio_rb32(f); if (mfra_size < 0 |... | 18,429 |
1 | static int qemu_save_device_state(QEMUFile *f) { SaveStateEntry *se; qemu_put_be32(f, QEMU_VM_FILE_MAGIC); qemu_put_be32(f, QEMU_VM_FILE_VERSION); cpu_synchronize_all_states(); QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { if (se->is_ram) { continue; } if ((!se->ops || !se->ops->save_state) && !se->vmsd) { contin... | 18,430 |
1 | void PREFIX_h264_chroma_mc8_altivec(uint8_t * dst, uint8_t * src, int stride, int h, int x, int y) { POWERPC_PERF_DECLARE(PREFIX_h264_chroma_mc8_num, 1); DECLARE_ALIGNED_16(signed int, ABCD[4]) = {((8 - x) * (8 - y)), (( x) * (8 - y)), ((8 - x) * ( y)), (( x) * ( y))}; register int i; vec_u8 fperm; const vec_s32 vABCD ... | 18,431 |
1 | static int ffserver_parse_config_stream(FFServerConfig *config, const char *cmd, const char **p, int line_num, FFServerStream **pstream) { char arg[1024], arg2[1024]; FFServerStream *stream; int val; av_assert0(pstream); stream = *pstream; if (!av_strcasecmp(cmd, "<Stream")) { char *q; FFServerStream *s; stream = av_ma... | 18,432 |
1 | static inline abi_long host_to_target_sockaddr(abi_ulong target_addr, struct sockaddr *addr, socklen_t len) { struct target_sockaddr *target_saddr; if (len == 0) { return 0; } target_saddr = lock_user(VERIFY_WRITE, target_addr, len, 0); if (!target_saddr) return -TARGET_EFAULT; memcpy(target_saddr, addr, len); if (len ... | 18,433 |
1 | 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; if (start_addr & ~TARGET_PAGE_MASK) { fprintf(stderr, "Only page-aligned memory slots supported\n"); abort(); } /* KVM does not suppo... | 18,434 |
1 | static void vfio_put_device(VFIOPCIDevice *vdev) { g_free(vdev->vbasedev.name); if (vdev->msix) { g_free(vdev->msix); vdev->msix = NULL; } vfio_put_base_device(&vdev->vbasedev); } | 18,435 |
1 | static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer, const char *model, const char *name, const char *ifname, const char *script, const char *downscript, const char *vhostfdname, int vnet_hdr, int fd, Error **errp) { Error *err = NULL; TAPState *s = net_tap_fd_init(peer, model, name, fd, vnet... | 18,436 |
1 | void qemu_iovec_concat_iov(QEMUIOVector *dst, struct iovec *src_iov, unsigned int src_cnt, size_t soffset, size_t sbytes) { int i; size_t done; assert(dst->nalloc != -1); for (i = 0, done = 0; done < sbytes && i < src_cnt; i++) { if (soffset < src_iov[i].iov_len) { size_t len = MIN(src_iov[i].iov_len - soffset, sbytes ... | 18,440 |
1 | void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict) { Error *errp = NULL; int paging = qdict_get_try_bool(qdict, "paging", 0); const char *file = qdict_get_str(qdict, "filename"); bool has_begin = qdict_haskey(qdict, "begin"); bool has_length = qdict_haskey(qdict, "length"); int64_t begin = 0; int64_t length =... | 18,441 |
1 | static int encode_picture_ls(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){ JpeglsContext * const s = avctx->priv_data; AVFrame *pict = data; AVFrame * const p= (AVFrame*)&s->picture; const int near = avctx->prediction_method; PutBitContext pb, pb2; GetBitContext gb; uint8_t *buf2, *zero, *cur, *... | 18,442 |
1 | void ff_er_add_slice(MpegEncContext *s, int startx, int starty, int endx, int endy, int status){ const int start_i= clip(startx + starty * s->mb_width , 0, s->mb_num-1); const int end_i = clip(endx + endy * s->mb_width , 0, s->mb_num); const int start_xy= s->mb_index2xy[start_i]; const int end_xy = s->mb_index2xy[end_i... | 18,443 |
0 | static int rtsp_parse_request(HTTPContext *c) { const char *p, *p1, *p2; char cmd[32]; char url[1024]; char protocol[32]; char line[1024]; int len; RTSPMessageHeader header1 = { 0 }, *header = &header1; c->buffer_ptr[0] = '\0'; p = c->buffer; get_word(cmd, sizeof(cmd), &p); get_word(url, sizeof(url), &p); get_word(prot... | 18,444 |
1 | bdrv_acct_done(BlockDriverState *bs, BlockAcctCookie *cookie) { assert(cookie->type < BDRV_MAX_IOTYPE); bs->stats.nr_bytes[cookie->type] += cookie->bytes; bs->stats.nr_ops[cookie->type]++; bs->stats.total_time_ns[cookie->type] += get_clock() - cookie->start_time_ns; } | 18,445 |
1 | static inline void idct4row(DCTELEM *row) { int c0, c1, c2, c3, a0, a1, a2, a3; //const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; a0 = row[0]; a1 = row[1]; a2 = row[2]; a3 = row[3]; c0 = (a0 + a2)*R3 + (1 << (R_SHIFT - 1)); c2 = (a0 - a2)*R3 + (1 << (R_SHIFT - 1)); c1 = a1 * R1 + a3 * R2; c3 = a1 * R2 - a3 * R1; row[0]=... | 18,446 |
1 | static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_output) { char buf[256]; int flags = (is_output ? ic->oformat->flags : ic->iformat->flags); AVStream *st = ic->streams[i]; int g = av_gcd(st->time_base.num, st->time_base.den); AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NU... | 18,448 |
1 | int rom_load_all(void) { target_phys_addr_t addr = 0; int memtype; Rom *rom; QTAILQ_FOREACH(rom, &roms, next) { if (addr < rom->min) addr = rom->min; if (rom->max) { /* load address range */ if (rom->align) { addr += (rom->align-1); addr &= ~(rom->align-1); } if (addr + rom->romsize > rom->max) { fprintf(stderr, "rom: ... | 18,449 |
1 | static uint32_t vmsvga_value_read(void *opaque, uint32_t address) { uint32_t caps; struct vmsvga_state_s *s = opaque; DisplaySurface *surface = qemu_console_surface(s->vga.con); uint32_t ret; switch (s->index) { case SVGA_REG_ID: ret = s->svgaid; break; case SVGA_REG_ENABLE: ret = s->enable; break; case SVGA_REG_WIDTH:... | 18,450 |
1 | static uint32_t pxa2xx_gpio_read(void *opaque, target_phys_addr_t offset) { struct pxa2xx_gpio_info_s *s = (struct pxa2xx_gpio_info_s *) opaque; uint32_t ret; int bank; offset -= s->base; if (offset >= 0x200) return 0; bank = pxa2xx_gpio_regs[offset].bank; switch (pxa2xx_gpio_regs[offset].reg) { case GPDR: /* GPIO Pin-... | 18,452 |
1 | void rgb24tobgr32(const uint8_t *src, uint8_t *dst, unsigned int src_size) { unsigned i; for(i=0; 3*i<src_size; i++) { dst[4*i + 0] = src[3*i + 2]; dst[4*i + 1] = src[3*i + 1]; dst[4*i + 2] = src[3*i + 0]; dst[4*i + 3] = 0; } } | 18,453 |
1 | int qcrypto_init(Error **errp) { #ifdef CONFIG_GNUTLS int ret; ret = gnutls_global_init(); if (ret < 0) { error_setg(errp, "Unable to initialize GNUTLS library: %s", gnutls_strerror(ret)); return -1; } #ifdef DEBUG_GNUTLS gnutls_global_set_log_level(10); gnutls_global_set_log_function(qcrypto_gnutls_log); #endif #endif... | 18,454 |
1 | libAVFilter_QueryVendorInfo(libAVFilter *this, wchar_t **info) { dshowdebug("libAVFilter_QueryVendorInfo(%p)\n", this); if (!info) return E_POINTER; *info = wcsdup(L"libAV"); return S_OK; } | 18,455 |
1 | static int compute_mb_distortion(CinepakEncContext *s, AVPicture *a, AVPicture *b) { int x, y, p, d, ret = 0; for(y = 0; y < MB_SIZE; y++) { for(x = 0; x < MB_SIZE; x++) { d = a->data[0][x + y*a->linesize[0]] - b->data[0][x + y*b->linesize[0]]; ret += d*d; } } if(s->pix_fmt == AV_PIX_FMT_YUV420P) { for(p = 1; p <= 2; p... | 18,456 |
1 | static VirtIOSerialBus *virtser_bus_new(DeviceState *dev) { VirtIOSerialBus *bus; bus = FROM_QBUS(VirtIOSerialBus, qbus_create(&virtser_bus_info, dev, NULL)); bus->qbus.allow_hotplug = 1; return bus; } | 18,458 |
1 | static int vp8_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata, int jobnr, int threadnr) { VP8Context *s = avctx->priv_data; VP8ThreadData *td = &s->thread_data[jobnr]; VP8ThreadData *next_td = NULL, *prev_td = NULL; VP8Frame *curframe = s->curframe; int mb_y, num_jobs = s->num_jobs; td->thread_nr = threadnr; f... | 18,459 |
1 | void rgb24tobgr32(const uint8_t *src, uint8_t *dst, long src_size) { long i; for(i=0; 3*i<src_size; i++) { #ifdef WORDS_BIGENDIAN /* RGB24 (= R,G,B) -> BGR32 (= A,R,G,B) */ dst[4*i + 0] = 0; dst[4*i + 1] = src[3*i + 0]; dst[4*i + 2] = src[3*i + 1]; dst[4*i + 3] = src[3*i + 2]; #else dst[4*i + 0] = src[3*i + 2]; dst[4*i... | 18,460 |
1 | static int ea_read_packet(AVFormatContext *s, AVPacket *pkt) { EaDemuxContext *ea = s->priv_data; ByteIOContext *pb = s->pb; int ret = 0; int packet_read = 0; unsigned int chunk_type, chunk_size; int key = 0; int av_uninit(num_samples); while (!packet_read) { chunk_type = get_le32(pb); chunk_size = (ea->big_endian ? ge... | 18,461 |
0 | static void decode_interframe_v4a(AVCodecContext *avctx, uint8_t *src, uint32_t size) { Hnm4VideoContext *hnm = avctx->priv_data; GetByteContext gb; uint32_t writeoffset = 0, offset; uint8_t tag, count, previous, delta; bytestream2_init(&gb, src, size); while (bytestream2_tell(&gb) < size) { count = bytestream2_peek_by... | 18,463 |
0 | static void roqvideo_decode_frame(RoqContext *ri) { unsigned int chunk_id = 0, chunk_arg = 0; unsigned long chunk_size = 0; int i, j, k, nv1, nv2, vqflg = 0, vqflg_pos = -1; int vqid, bpos, xpos, ypos, xp, yp, x, y, mx, my; int frame_stats[2][4] = {{0},{0}}; roq_qcell *qcell; const unsigned char *buf = ri->buf; const u... | 18,465 |
0 | static void build_udp_url(char *buf, int buf_size, const char *hostname, int port, int local_port, int ttl) { snprintf(buf, buf_size, "udp://%s:%d", hostname, port); if (local_port >= 0) url_add_option(buf, buf_size, "localport=%d", local_port); if (ttl >= 0) url_add_option(buf, buf_size, "ttl=%d", ttl); } | 18,466 |
0 | static av_cold int wavpack_encode_init(AVCodecContext *avctx) { WavPackEncodeContext *s = avctx->priv_data; s->avctx = avctx; if (!avctx->frame_size) { int block_samples; if (!(avctx->sample_rate & 1)) block_samples = avctx->sample_rate / 2; else block_samples = avctx->sample_rate; while (block_samples * avctx->channel... | 18,467 |
0 | static int sub2video_prepare(InputStream *ist) { AVFormatContext *avf = input_files[ist->file_index]->ctx; int i, w, h; /* Compute the size of the canvas for the subtitles stream. If the subtitles codec has set a size, use it. Otherwise use the maximum dimensions of the video streams in the same file. */ w = ist->dec_c... | 18,468 |
1 | static int arm946_prbs_read(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t *value) { if (ri->crm > 8) { return EXCP_UDEF; } *value = env->cp15.c6_region[ri->crm]; return 0; } | 18,469 |
1 | static int compat_read(AVFilterContext *ctx, AVFilterBufferRef **pbuf, int nb_samples) { AVFilterBufferRef *buf; AVFrame *frame; int ret; if (!pbuf) return ff_poll_frame(ctx->inputs[0]); frame = av_frame_alloc(); if (!frame) return AVERROR(ENOMEM); if (!nb_samples) ret = av_buffersink_get_frame(ctx, frame); else ret = ... | 18,470 |
1 | int cpu_ppc_register (CPUPPCState *env, ppc_def_t *def) { env->msr_mask = def->msr_mask; env->mmu_model = def->mmu_model; env->excp_model = def->excp_model; env->bus_model = def->bus_model; env->bfd_mach = def->bfd_mach; if (create_ppc_opcodes(env, def) < 0) return -1; init_ppc_proc(env, def); #if defined(PPC_DUMP_CPU)... | 18,471 |
1 | static uint64_t unin_data_read(void *opaque, hwaddr addr, unsigned len) { UNINState *s = opaque; PCIHostState *phb = PCI_HOST_BRIDGE(s); uint32_t val; val = pci_data_read(phb->bus, unin_get_config_reg(phb->config_reg, addr), len); UNIN_DPRINTF("read addr %" TARGET_FMT_plx " len %d val %x\n", addr, len, val); return val... | 18,473 |
1 | static void pc_fw_cfg_guest_info(PcGuestInfo *guest_info) { PcRomPciInfo *info; if (!guest_info->has_pci_info || !guest_info->fw_cfg) { return; } info = g_malloc(sizeof *info); info->w32_min = cpu_to_le64(guest_info->pci_info.w32.begin); info->w32_max = cpu_to_le64(guest_info->pci_info.w32.end); info->w64_min = cpu_to_... | 18,475 |
1 | static void set_sel_time(IPMIBmcSim *ibs, uint8_t *cmd, unsigned int cmd_len, uint8_t *rsp, unsigned int *rsp_len, unsigned int max_rsp_len) { uint32_t val; struct ipmi_time now; IPMI_CHECK_CMD_LEN(6); val = cmd[2] | (cmd[3] << 8) | (cmd[4] << 16) | (cmd[5] << 24); ipmi_gettime(&now); ibs->sel.time_offset = now.tv_sec ... | 18,476 |
1 | static inline void vring_used_write(VirtQueue *vq, VRingUsedElem *uelem, int i) { VRingMemoryRegionCaches *caches = atomic_rcu_read(&vq->vring.caches); hwaddr pa = offsetof(VRingUsed, ring[i]); virtio_tswap32s(vq->vdev, &uelem->id); virtio_tswap32s(vq->vdev, &uelem->len); address_space_write_cached(&caches->used, pa, u... | 18,478 |
1 | static void integratorcm_init(int memsz, uint32_t flash_offset) { int iomemtype; integratorcm_state *s; s = (integratorcm_state *)qemu_mallocz(sizeof(integratorcm_state)); s->cm_osc = 0x01000048; /* ??? What should the high bits of this value be? */ s->cm_auxosc = 0x0007feff; s->cm_sdram = 0x00011122; if (memsz >= 256)... | 18,479 |
1 | static int mlib_YUV2ARGB420_32(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[]){ if(c->srcFormat == PIX_FMT_YUV422P){ srcStride[1] *= 2; srcStride[2] *= 2; } assert(srcStride[1] == srcStride[2]); mlib_VideoColorYUV2ARGB420(dst[0]+srcSliceY*dstStride[0], src[... | 18,480 |
1 | int vp78_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt, int is_vp7) { VP8Context *s = avctx->priv_data; int ret, i, referenced, num_jobs; enum AVDiscard skip_thresh; VP8Frame *av_uninit(curframe), *prev_frame; if (is_vp7) ret = vp7_decode_frame_header(s, avpkt->data, avpkt->size); else... | 18,482 |
1 | static void execute_async(DWORD WINAPI (*func)(LPVOID), LPVOID opaque, Error **errp) { Error *local_err = NULL; if (error_is_set(errp)) { return; } HANDLE thread = CreateThread(NULL, 0, func, opaque, 0, NULL); if (!thread) { error_set(&local_err, QERR_QGA_COMMAND_FAILED, "failed to dispatch asynchronous command"); erro... | 18,483 |
1 | static void spr_read_tbu(DisasContext *ctx, int gprn, int sprn) { if (ctx->tb->cflags & CF_USE_ICOUNT) { gen_io_start(); } gen_helper_load_tbu(cpu_gpr[gprn], cpu_env); if (ctx->tb->cflags & CF_USE_ICOUNT) { gen_io_end(); gen_stop_exception(ctx); } } | 18,484 |
1 | static void vector_fmul_window_mips(float *dst, const float *src0, const float *src1, const float *win, int len) { int i, j; /* * variables used in inline assembler */ float * dst_i, * dst_j, * dst_i2, * dst_j2; float temp, temp1, temp2, temp3, temp4, temp5, temp6, temp7; dst += len; win += len; src0 += len; for (i = -... | 18,485 |
1 | static CodeBook unpack_codebook(GetBitContext* gb, unsigned depth, unsigned size) { unsigned i, j; CodeBook cb = { 0 }; if (!can_safely_read(gb, size * 34)) return cb; if (size >= INT_MAX / sizeof(MacroBlock)) return cb; cb.blocks = av_malloc(size ? size * sizeof(MacroBlock) : 1); if (!cb.blocks) return cb; cb.depth = ... | 18,486 |
1 | static inline void RENAME(hScale)(int16_t *dst, int dstW, const uint8_t *src, int srcW, int xInc, const int16_t *filter, const int16_t *filterPos, int filterSize) { #if COMPILE_TEMPLATE_MMX assert(filterSize % 4 == 0 && filterSize>0); if (filterSize==4) { // Always true for upscaling, sometimes for down, too. x86_reg c... | 18,487 |
1 | YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48be, PIX_FMT_RGB48BE) YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48le, PIX_FMT_RGB48LE) YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48be, PIX_FMT_BGR48BE) YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48le, PIX_FMT_BGR48LE) static av_always_inline void yuv2rgb_write(uint8_t *_dest, int i, int Y1, int Y2, in... | 18,489 |
1 | static void musb_rx_packet_complete(USBPacket *packey, void *opaque) { /* Unfortunately we can't use packey->devep because that's the remote * endpoint number and may be different than our local. */ MUSBEndPoint *ep = (MUSBEndPoint *) opaque; int epnum = ep->epnum; MUSBState *s = ep->musb; ep->fifostart[1] = 0; ep->fif... | 18,490 |
1 | static int process_requests(int sock) { int flags; int size = 0; int retval = 0; uint64_t offset; ProxyHeader header; int mode, uid, gid; V9fsString name, value; struct timespec spec[2]; V9fsString oldpath, path; struct iovec in_iovec, out_iovec; in_iovec.iov_base = g_malloc(PROXY_MAX_IO_SZ + PROXY_HDR_SZ); in_iovec.io... | 18,491 |
1 | static av_cold int pcx_init(AVCodecContext *avctx) { PCXContext *s = avctx->priv_data; avcodec_get_frame_defaults(&s->picture); avctx->coded_frame= &s->picture; return 0; } | 18,492 |
1 | static void find_compressor(char * compressor_name, int len, MOVTrack *track) { AVDictionaryEntry *encoder; int xdcam_res = (track->par->width == 1280 && track->par->height == 720) || (track->par->width == 1440 && track->par->height == 1080) || (track->par->width == 1920 && track->par->height == 1080); if (track->mode ... | 18,494 |
1 | const char *print_wrid(int wrid) { if (wrid >= RDMA_WRID_RECV_CONTROL) { return wrid_desc[RDMA_WRID_RECV_CONTROL]; } return wrid_desc[wrid]; } | 18,495 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.