label int64 0 1 | func1 stringlengths 23 97k | id int64 0 27.3k |
|---|---|---|
0 | static void ppc_cpu_unrealizefn(DeviceState *dev, Error **errp) { PowerPCCPU *cpu = POWERPC_CPU(dev); CPUPPCState *env = &cpu->env; int i; for (i = 0; i < PPC_CPU_OPCODES_LEN; i++) { if (env->opcodes[i] != &invalid_handler) { g_free(env->opcodes[i]); } } } | 15,194 |
0 | static void xen_exit_notifier(Notifier *n, void *data) { XenIOState *state = container_of(n, XenIOState, exit); xc_evtchn_close(state->xce_handle); xs_daemon_close(state->xenstore); } | 15,195 |
0 | static void avc_loopfilter_cb_or_cr_inter_edge_ver_msa(uint8_t *data, uint8_t bs0, uint8_t bs1, uint8_t bs2, uint8_t bs3, uint8_t tc0, uint8_t tc1, uint8_t tc2, uint8_t tc3, uint8_t alpha_in, uint8_t beta_in, uint32_t img_width) { uint8_t *src; uint16_t out0, out1, out2, out3; v16u8 alpha, beta; v16u8 p0_asub_q0, p1_as... | 15,196 |
0 | static int mov_write_header(AVFormatContext *s) { AVIOContext *pb = s->pb; MOVMuxContext *mov = s->priv_data; AVDictionaryEntry *t, *global_tcr = av_dict_get(s->metadata, "timecode", NULL, 0); int i, ret, hint_track = 0, tmcd_track = 0; mov->fc = s; /* Default mode == MP4 */ mov->mode = MODE_MP4; if (s->oformat) { if (... | 15,197 |
1 | static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame) { ALSSpecificConfig *sconf = &ctx->sconf; AVCodecContext *avctx = ctx->avctx; GetBitContext *gb = &ctx->gb; unsigned int div_blocks[32]; ///< block sizes. unsigned int c; unsigned int js_blocks[2]; uint32_t bs_info = 0; int ret; // skip the size of t... | 15,199 |
1 | int swr_resample(AVResampleContext *c, short *dst, const short *src, int *consumed, int src_size, int dst_size, int update_ctx){ int dst_index, i; int index= c->index; int frac= c->frac; int dst_incr_frac= c->dst_incr % c->src_incr; int dst_incr= c->dst_incr / c->src_incr; int compensation_distance= c->compensation_dis... | 15,200 |
1 | static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp) { STM32F205State *s = STM32F205_SOC(dev_soc); DeviceState *syscfgdev, *usartdev, *timerdev; SysBusDevice *syscfgbusdev, *usartbusdev, *timerbusdev; qemu_irq *pic; Error *err = NULL; int i; MemoryRegion *system_memory = get_system_memory(); MemoryRegi... | 15,202 |
1 | static int cmp_int(const void *p1, const void *p2) { int left = *(const int *)p1; int right = *(const int *)p2; return ((left > right) - (left < right)); } | 15,203 |
1 | static int parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size) { const CodecMime *mime = ff_id3v2_mime_tags; enum CodecID id = CODEC_ID_NONE; uint8_t mimetype[64], *desc = NULL, *data = NULL; AVIOContext *pb = NULL; AVStream *st; int type, width, height; int len, ret = 0; st = avformat_new_stream(s, NULL); if... | 15,205 |
1 | void aio_context_set_poll_params(AioContext *ctx, int64_t max_ns, Error **errp) { error_setg(errp, "AioContext polling is not implemented on Windows"); } | 15,207 |
1 | static void host_memory_backend_set_prealloc(Object *obj, bool value, Error **errp) { Error *local_err = NULL; HostMemoryBackend *backend = MEMORY_BACKEND(obj); if (backend->force_prealloc) { if (value) { error_setg(errp, "remove -mem-prealloc to use the prealloc property"); return; } } if (!memory_region_size(&backend... | 15,208 |
1 | void ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt, int (*compare)(AVFormatContext *, AVPacket *, AVPacket *)) { AVPacketList **next_point, *this_pktl; this_pktl = av_mallocz(sizeof(AVPacketList)); this_pktl->pkt= *pkt; pkt->destruct= NULL; // do not free original but only the copy av_dup_packet(&this_pktl... | 15,210 |
1 | static void read_partition(uint8_t *p, struct partition_record *r) { r->bootable = p[0]; r->start_head = p[1]; r->start_cylinder = p[3] | ((p[2] << 2) & 0x0300); r->start_sector = p[2] & 0x3f; r->system = p[4]; r->end_head = p[5]; r->end_cylinder = p[7] | ((p[6] << 2) & 0x300); r->end_sector = p[6] & 0x3f; r->start_sec... | 15,211 |
1 | static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { AVFrame *frame = data; DxaDecContext * const c = avctx->priv_data; uint8_t *outptr, *srcptr, *tmpptr; unsigned long dsize; int i, j, compr, ret; int stride; int pc = 0; GetByteContext gb; bytestream2_init(&gb, avpkt->data, avp... | 15,212 |
1 | static void virtio_gpu_resource_destroy(VirtIOGPU *g, struct virtio_gpu_simple_resource *res) { pixman_image_unref(res->image); QTAILQ_REMOVE(&g->reslist, res, next); g->hostmem -= res->hostmem; g_free(res); } | 15,213 |
1 | void virtio_save(VirtIODevice *vdev, QEMUFile *f) { BusState *qbus = qdev_get_parent_bus(DEVICE(vdev)); VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus); VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(vdev); uint32_t guest_features_lo = (vdev->guest_features & 0xffffffff); int i; if (k->save_config) { k->save_config(qb... | 15,214 |
1 | static void virtio_blk_dma_restart_cb(void *opaque, int running, RunState state) { VirtIOBlock *s = opaque; if (!running) return; if (!s->bh) { s->bh = qemu_bh_new(virtio_blk_dma_restart_bh, s); qemu_bh_schedule(s->bh); } } | 15,215 |
1 | static char *json_escape_str(const char *s) { static const char json_escape[] = {'"', '\\', '\b', '\f', '\n', '\r', '\t', 0}; static const char json_subst[] = {'"', '\\', 'b', 'f', 'n', 'r', 't', 0}; char *ret, *p; int i, len = 0; // compute the length of the escaped string for (i = 0; s[i]; i++) { if (strchr(json_esca... | 15,216 |
0 | static int gif_image_write_header(ByteIOContext *pb, int width, int height, uint32_t *palette) { int i; unsigned int v; put_tag(pb, "GIF"); put_tag(pb, "89a"); put_le16(pb, width); put_le16(pb, height); put_byte(pb, 0xf7); /* flags: global clut, 256 entries */ put_byte(pb, 0x1f); /* background color index */ put_byte(p... | 15,218 |
0 | static int rscc_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { RsccContext *ctx = avctx->priv_data; GetByteContext *gbc = &ctx->gbc; GetByteContext tiles_gbc; AVFrame *frame = data; const uint8_t *pixels, *raw; uint8_t *inflated_tiles = NULL; int tiles_nb, packed_size, pixel_size = 0... | 15,220 |
0 | static int parse_frame_header(DCACoreDecoder *s) { DCACoreFrameHeader h = { 0 }; int err = avpriv_dca_parse_core_frame_header(&s->gb, &h); if (err < 0) { switch (err) { case DCA_PARSE_ERROR_DEFICIT_SAMPLES: av_log(s->avctx, AV_LOG_ERROR, "Deficit samples are not supported\n"); return h.normal_frame ? AVERROR_INVALIDDAT... | 15,221 |
0 | static int insert_trim(OutputStream *ost, AVFilterContext **last_filter, int *pad_idx) { OutputFile *of = output_files[ost->file_index]; AVFilterGraph *graph = (*last_filter)->graph; AVFilterContext *ctx; const AVFilter *trim; const char *name = ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO ? "trim" : "atrim"; char ... | 15,223 |
0 | static int add_doubles_metadata(const uint8_t **buf, int count, const char *name, const char *sep, TiffContext *s) { char *ap; int i; double *dp = av_malloc(count * sizeof(double)); if (!dp) return AVERROR(ENOMEM); for (i = 0; i < count; i++) dp[i] = tget_double(buf, s->le); ap = doubles2str(dp, count, sep); av_freep(&... | 15,224 |
1 | static inline int onenand_load_spare(OneNANDState *s, int sec, int secn, void *dest) { uint8_t buf[512]; if (s->blk_cur) { if (blk_read(s->blk_cur, s->secs_cur + (sec >> 5), buf, 1) < 0) { return 1; } memcpy(dest, buf + ((sec & 31) << 4), secn << 4); } else if (sec + secn > s->secs_cur) { return 1; } else { memcpy(dest... | 15,228 |
1 | X264_init(AVCodecContext *avctx) { X264Context *x4 = avctx->priv_data; x264_param_default(&x4->params); x4->params.pf_log = X264_log; x4->params.p_log_private = avctx; x4->params.i_keyint_max = avctx->gop_size; x4->params.rc.i_bitrate = avctx->bit_rate / 1000; x4->params.rc.i_vbv_buffer_size = avctx->rc_buffer_size / 1... | 15,229 |
1 | int configure_filtergraph(FilterGraph *fg) { AVFilterInOut *inputs, *outputs, *cur; int ret, i, simple = !fg->graph_desc; const char *graph_desc = simple ? fg->outputs[0]->ost->avfilter : fg->graph_desc; avfilter_graph_free(&fg->graph); if (!(fg->graph = avfilter_graph_alloc())) return AVERROR(ENOMEM); if (simple) { Ou... | 15,230 |
1 | inline static void RENAME(hcscale)(uint16_t *dst, long dstWidth, uint8_t *src1, uint8_t *src2, int srcW, int xInc, int flags, int canMMX2BeUsed, int16_t *hChrFilter, int16_t *hChrFilterPos, int hChrFilterSize, void *funnyUVCode, int srcFormat, uint8_t *formatConvBuffer, int16_t *mmx2Filter, int32_t *mmx2FilterPos) { if... | 15,231 |
1 | static int mp_user_setxattr(FsContext *ctx, const char *path, const char *name, void *value, size_t size, int flags) { char *buffer; int ret; if (strncmp(name, "user.virtfs.", 12) == 0) { /* * Don't allow fetch of user.virtfs namesapce * in case of mapped security */ errno = EACCES; return -1; } buffer = rpath(ctx, pat... | 15,232 |
1 | static void gen_tlbiva(DisasContext *ctx) { #if defined(CONFIG_USER_ONLY) gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); #else TCGv t0; if (unlikely(ctx->pr)) { gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); return; } t0 = tcg_temp_new(); gen_addr_reg_index(ctx, t0); gen_helper_tlbiva(cpu_env, cpu_gpr[rB(ctx->opcod... | 15,233 |
0 | static void hdcd_reset(hdcd_state_t *state, unsigned rate) { int i; state->window = 0; state->readahead = 32; state->arg = 0; state->control = 0; state->running_gain = 0; state->sustain = 0; state->sustain_reset = rate * 10; state->code_counterA = 0; state->code_counterA_almost = 0; state->code_counterB = 0; state->cod... | 15,234 |
0 | static int filter_frame(AVFilterLink *inlink, AVFrame *insamplesref) { AResampleContext *aresample = inlink->dst->priv; const int n_in = insamplesref->nb_samples; int64_t delay; int n_out = n_in * aresample->ratio + 32; AVFilterLink *const outlink = inlink->dst->outputs[0]; AVFrame *outsamplesref; int ret; delay = swr_... | 15,235 |
0 | int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt) { MOVMuxContext *mov = s->priv_data; AVIOContext *pb = s->pb; MOVTrack *trk = &mov->tracks[pkt->stream_index]; AVCodecContext *enc = trk->enc; unsigned int samples_in_chunk = 0; int size = pkt->size, ret = 0; uint8_t *reformatted_data = NULL; if (trk->entry) { ... | 15,236 |
0 | static int decode_cabac_mb_chroma_pre_mode( H264Context *h) { const int mba_xy = h->left_mb_xy[0]; const int mbb_xy = h->top_mb_xy; int ctx = 0; /* No need to test for IS_INTRA4x4 and IS_INTRA16x16, as we set chroma_pred_mode_table to 0 */ if( h->slice_table[mba_xy] == h->slice_num && h->chroma_pred_mode_table[mba_xy] ... | 15,237 |
0 | static av_cold int psy_3gpp_init(FFPsyContext *ctx) { AacPsyContext *pctx; float bark; int i, j, g, start; float prev, minscale, minath; ctx->model_priv_data = av_mallocz(sizeof(AacPsyContext)); pctx = (AacPsyContext*) ctx->model_priv_data; minath = ath(3410, ATH_ADD); for (j = 0; j < 2; j++) { AacPsyCoeffs *coeffs = &... | 15,238 |
1 | static void test_tco_second_timeout_reset(void) { TestData td; const uint16_t ticks = TCO_SECS_TO_TICKS(16); QDict *ad; td.args = "-watchdog-action reset"; td.noreboot = false; test_init(&td); stop_tco(&td); clear_tco_status(&td); reset_on_second_timeout(true); set_tco_timeout(&td, TCO_SECS_TO_TICKS(16)); load_tco(&td)... | 15,240 |
1 | static void e1000e_macreg_write(e1000e_device *d, uint32_t reg, uint32_t val) { qpci_io_writel(d->pci_dev, d->mac_regs + reg, val); } | 15,241 |
1 | static void fdctrl_handle_drive_specification_command(FDCtrl *fdctrl, int direction) { FDrive *cur_drv = get_cur_drv(fdctrl); if (fdctrl->fifo[fdctrl->data_pos - 1] & 0x80) { /* Command parameters done */ if (fdctrl->fifo[fdctrl->data_pos - 1] & 0x40) { fdctrl->fifo[0] = fdctrl->fifo[1]; fdctrl->fifo[2] = 0; fdctrl->fi... | 15,242 |
1 | uint64_t helper_addqv(CPUAlphaState *env, uint64_t op1, uint64_t op2) { uint64_t tmp = op1; op1 += op2; if (unlikely((tmp ^ op2 ^ (-1ULL)) & (tmp ^ op1) & (1ULL << 63))) { arith_excp(env, GETPC(), EXC_M_IOV, 0); } return op1; } | 15,243 |
1 | pvscsi_on_cmd_setup_msg_ring(PVSCSIState *s) { PVSCSICmdDescSetupMsgRing *rc = (PVSCSICmdDescSetupMsgRing *) s->curr_cmd_data; trace_pvscsi_on_cmd_arrived("PVSCSI_CMD_SETUP_MSG_RING"); if (!s->use_msg) { return PVSCSI_COMMAND_PROCESSING_FAILED; } if (s->rings_info_valid) { pvscsi_ring_init_msg(&s->rings, rc); s->msg_ri... | 15,244 |
1 | dispatcher_wait(Dispatcher *dispr, uint32_t timeout) { struct timeval tv; tv.tv_sec = timeout / 1000000; tv.tv_usec = timeout % 1000000; fd_set fdset = dispr->fdset; /* wait until some of sockets become readable. */ int rc = select(dispr->max_sock + 1, &fdset, 0, 0, &tv); if (rc == -1) { vubr_die("select"); } /* Timeou... | 15,246 |
1 | int bdrv_check(BlockDriverState *bs, BdrvCheckResult *res) { if (bs->drv->bdrv_check == NULL) { return -ENOTSUP; } memset(res, 0, sizeof(*res)); res->corruptions = bs->drv->bdrv_check(bs); return res->corruptions < 0 ? res->corruptions : 0; } | 15,247 |
1 | static int nsv_parse_NSVf_header(AVFormatContext *s) { NSVContext *nsv = s->priv_data; AVIOContext *pb = s->pb; unsigned int av_unused file_size; unsigned int size; int64_t duration; int strings_size; int table_entries; int table_entries_used; av_dlog(s, "%s()\n", __FUNCTION__); nsv->state = NSV_UNSYNC; /* in case we f... | 15,248 |
0 | static int flac_decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) { FLACContext *s = avctx->priv_data; int tmp = 0, i, j = 0, input_buf_size = 0; int16_t *samples_16 = data; int32_t *samples_32 = data; int alloc_data_size= *data_size; *data_size=0; if (s->max_framesize ==... | 15,250 |
0 | static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { CFHDContext *s = avctx->priv_data; GetByteContext gb; ThreadFrame frame = { .f = data }; AVFrame *pic = data; int ret = 0, i, j, planes, plane, got_buffer = 0; int16_t *coeff_data; s->coded_format = AV_PIX_FMT_YUV422P10; init_f... | 15,251 |
0 | static void vc1_inv_trans_8x8_altivec(DCTELEM block[64]) { vector signed short src0, src1, src2, src3, src4, src5, src6, src7; vector signed int s0, s1, s2, s3, s4, s5, s6, s7; vector signed int s8, s9, sA, sB, sC, sD, sE, sF; vector signed int t0, t1, t2, t3, t4, t5, t6, t7; const vector signed int vec_64 = vec_sl(vec... | 15,253 |
1 | static int decode_tilehdr(WmallDecodeCtx *s) { uint16_t num_samples[WMALL_MAX_CHANNELS] = { 0 }; /* sum of samples for all currently known subframes of a channel */ uint8_t contains_subframe[WMALL_MAX_CHANNELS]; /* flag indicating if a channel contains the current subframe */ int channels_for_cur_subframe = s->num_chan... | 15,254 |
1 | uart_write(void *opaque, hwaddr addr, uint64_t val64, unsigned int size) { XilinxUARTLite *s = opaque; uint32_t value = val64; unsigned char ch = value; addr >>= 2; switch (addr) { case R_STATUS: hw_error("write to UART STATUS?\n"); break; case R_CTRL: if (value & CONTROL_RST_RX) { s->rx_fifo_pos = 0; s->rx_fifo_len = ... | 15,255 |
1 | static CharDriverState *net_vhost_parse_chardev(const NetdevVhostUserOptions *opts) { CharDriverState *chr = qemu_chr_find(opts->chardev); VhostUserChardevProps props; if (chr == NULL) { error_report("chardev \"%s\" not found", opts->chardev); return NULL; } /* inspect chardev opts */ memset(&props, 0, sizeof(props)); ... | 15,256 |
1 | static int mp3_read_packet(AVFormatContext *s, AVPacket *pkt) { int ret, size; // AVStream *st = s->streams[0]; size= MP3_PACKET_SIZE; ret= av_get_packet(s->pb, pkt, size); pkt->stream_index = 0; if (ret <= 0) { if(ret<0) return ret; return AVERROR_EOF; } if (ret > ID3v1_TAG_SIZE && memcmp(&pkt->data[ret - ID3v1_TAG_SI... | 15,257 |
1 | static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; AVFrame *const p = data; int compressed, xmin, ymin, xmax, ymax; unsigned int w, h, bits_per_pixel, bytes_per_line, nplanes, stride, y, x, bytes_per_scanline; u... | 15,259 |
0 | static int mkv_write_trailer(AVFormatContext *s) { MatroskaMuxContext *mkv = s->priv_data; AVIOContext *pb = s->pb; int64_t currentpos, cuespos; int ret; // check if we have an audio packet cached if (mkv->cur_audio_pkt.size > 0) { ret = mkv_write_packet_internal(s, &mkv->cur_audio_pkt); mkv->cur_audio_pkt.size = 0; if... | 15,261 |
1 | int is_adx(const unsigned char *buf,size_t bufsize) { int offset; if (buf[0]!=0x80) return 0; offset = (read_long(buf)^0x80000000)+4; if (bufsize<offset || memcmp(buf+offset-6,"(c)CRI",6)) return 0; return offset; } | 15,263 |
1 | rfc3986_parse_port(URI *uri, const char **str) { const char *cur = *str; if (ISA_DIGIT(cur)) { if (uri != NULL) uri->port = 0; while (ISA_DIGIT(cur)) { if (uri != NULL) uri->port = uri->port * 10 + (*cur - '0'); cur++; } *str = cur; return(0); } return(1); } | 15,265 |
1 | static void encode_422_bitstream(HYuvContext *s, int count){ int i; count/=2; if(s->flags&CODEC_FLAG_PASS1){ for(i=0; i<count; i++){ s->stats[0][ s->temp[0][2*i ] ]++; s->stats[1][ s->temp[1][ i ] ]++; s->stats[0][ s->temp[0][2*i+1] ]++; s->stats[2][ s->temp[2][ i ] ]++; } }else if(s->context){ for(i=0; i<count; i++){ ... | 15,266 |
1 | static int usb_net_handle_dataout(USBNetState *s, USBPacket *p) { int ret = p->len; int sz = sizeof(s->out_buf) - s->out_ptr; struct rndis_packet_msg_type *msg = (struct rndis_packet_msg_type *) s->out_buf; uint32_t len; #ifdef TRAFFIC_DEBUG fprintf(stderr, "usbnet: data out len %u\n", p->len); { int i; fprintf(stderr,... | 15,267 |
1 | static DisasJumpType translate_one(DisasContext *ctx, uint32_t insn) { int32_t disp21, disp16, disp12 __attribute__((unused)); uint16_t fn11; uint8_t opc, ra, rb, rc, fpfn, fn7, lit; bool islit, real_islit; TCGv va, vb, vc, tmp, tmp2; TCGv_i32 t32; DisasJumpType ret; /* Decode all instruction fields */ opc = extract32(... | 15,268 |
1 | static target_ulong h_protect(PowerPCCPU *cpu, sPAPREnvironment *spapr, target_ulong opcode, target_ulong *args) { CPUPPCState *env = &cpu->env; target_ulong flags = args[0]; target_ulong pte_index = args[1]; target_ulong avpn = args[2]; hwaddr hpte; target_ulong v, r, rb; if ((pte_index * HASH_PTE_SIZE_64) & ~env->hta... | 15,269 |
1 | void do_op_602_mfrom (void) { if (likely(T0 < 602)) { #ifdef USE_MFROM_ROM_TABLE #include "mfrom_table.c" T0 = mfrom_ROM_table[T0]; #else double d; /* Extremly decomposed: * -T0 / 256 * T0 = 256 * log10(10 + 1.0) + 0.5 */ d = T0; d = float64_div(d, 256, &env->fp_status); d = float64_chs(d); d = exp10(d); // XXX: use fl... | 15,270 |
1 | static int mpc8_decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MPCContext *c = avctx->priv_data; GetBitContext gb2, *gb = &gb2; int i, j, k, ch, cnt, res, t; Band *bands = c->bands; int off, out_size; int maxband, keyfram... | 15,271 |
1 | static void backup_set_speed(BlockJob *job, int64_t speed, Error **errp) { BackupBlockJob *s = container_of(job, BackupBlockJob, common); if (speed < 0) { error_setg(errp, QERR_INVALID_PARAMETER, "speed"); return; } ratelimit_set_speed(&s->limit, speed / BDRV_SECTOR_SIZE, SLICE_TIME); } | 15,272 |
1 | static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev, struct XenDevOps *ops) { struct XenDevice *xendev; char *dom0; xendev = xen_be_find_xendev(type, dom, dev); if (xendev) { return xendev; } /* init new xendev */ xendev = g_malloc0(ops->size); xendev->type = type; xendev->dom = dom; xendev->d... | 15,273 |
1 | int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) { AVFrame *extended_frame = NULL; AVFrame *padded_frame = NULL; int ret; AVPacket user_pkt = *avpkt; int needs_realloc = !user_pkt.data; *got_packet_ptr = 0; if (!(avctx->codec->capabilities ... | 15,274 |
1 | static int iff_read_packet(AVFormatContext *s, AVPacket *pkt) { IffDemuxContext *iff = s->priv_data; AVIOContext *pb = s->pb; AVStream *st = s->streams[0]; int ret; int64_t pos = avio_tell(pb); if (pos >= iff->body_end) return AVERROR_EOF; if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { if (st->codec->codec_tag == I... | 15,275 |
1 | static void virtio_blk_save_device(VirtIODevice *vdev, QEMUFile *f) { VirtIOBlock *s = VIRTIO_BLK(vdev); VirtIOBlockReq *req = s->rq; while (req) { qemu_put_sbyte(f, 1); qemu_put_buffer(f, (unsigned char *)req->elem, sizeof(VirtQueueElement)); req = req->next; } qemu_put_sbyte(f, 0); } | 15,276 |
1 | static inline void RENAME(yuv2packedX)(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize, int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, uint8_t *dest, long dstW, long dstY) { #ifdef HAVE_MMX long dummy=0; if(c->flags & SWS_ACCURATE_RND){ switch(c->dstFormat){ case PIX_FMT_RGB32: YSCALEYU... | 15,277 |
1 | static void virtio_net_save(QEMUFile *f, void *opaque) { VirtIONet *n = opaque; virtio_save(&n->vdev, f); qemu_put_buffer(f, n->mac, ETH_ALEN); qemu_put_be32(f, n->tx_timer_active); qemu_put_be32(f, n->mergeable_rx_bufs); qemu_put_be16(f, n->status); qemu_put_byte(f, n->promisc); qemu_put_byte(f, n->allmulti); qemu_put... | 15,278 |
1 | static int set_palette(AVFrame * frame, const uint8_t * palette_buffer, int buf_size) { uint32_t * palette = (uint32_t *)frame->data[1]; int a; if (buf_size < 256*3) return AVERROR_INVALIDDATA; for(a = 0; a < 256; a++){ palette[a] = AV_RB24(&palette_buffer[a * 3]) * 4; } frame->palette_has_changed = 1; return 256*3; } | 15,280 |
1 | static int build_def_list(Picture *def, Picture **in, int len, int is_long, int sel) { int i[2] = { 0 }; int index = 0; while (i[0] < len || i[1] < len) { while (i[0] < len && !(in[i[0]] && (in[i[0]]->reference & sel))) i[0]++; while (i[1] < len && !(in[i[1]] && (in[i[1]]->reference & (sel ^ 3)))) i[1]++; if (i[0] < le... | 15,281 |
1 | static void vnc_init_timer(VncDisplay *vd) { vd->timer_interval = VNC_REFRESH_INTERVAL_BASE; if (vd->timer == NULL && !QTAILQ_EMPTY(&vd->clients)) { vd->timer = qemu_new_timer_ms(rt_clock, vnc_refresh, vd); vnc_dpy_resize(dcl, vd->ds); vnc_refresh(vd); } } | 15,282 |
0 | static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) { int n, i, ch, st, pkt_size, ret; const int16_t *samples; int16_t **samples_p; uint8_t *dst; ADPCMEncodeContext *c = avctx->priv_data; uint8_t *buf; samples = (const int16_t *)frame->data[0]; samples_p = (i... | 15,283 |
1 | static inline void gen_intermediate_code_internal(OpenRISCCPU *cpu, TranslationBlock *tb, int search_pc) { struct DisasContext ctx, *dc = &ctx; uint16_t *gen_opc_end; uint32_t pc_start; int j, k; uint32_t next_page_start; int num_insns; int max_insns; qemu_log_try_set_file(stderr); pc_start = tb->pc; dc->tb = tb; gen_o... | 15,284 |
1 | static int ism_write_header(AVFormatContext *s) { SmoothStreamingContext *c = s->priv_data; int ret = 0, i; AVOutputFormat *oformat; mkdir(s->filename, 0777); oformat = av_guess_format("ismv", NULL, NULL); if (!oformat) { ret = AVERROR_MUXER_NOT_FOUND; goto fail; } c->streams = av_mallocz(sizeof(*c->streams) * s->nb_st... | 15,285 |
1 | static void gradfun_filter_line_mmxext(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers) { intptr_t x; if (width & 3) { x = width & ~3; ff_gradfun_filter_line_c(dst + x, src + x, dc + x / 2, width - x, thresh, dithers); width = x; } x = -width; __asm__ volatile( "movd %4, %%mm5 \... | 15,286 |
1 | static void bdrv_mirror_top_refresh_filename(BlockDriverState *bs, QDict *opts) { bdrv_refresh_filename(bs->backing->bs); pstrcpy(bs->exact_filename, sizeof(bs->exact_filename), bs->backing->bs->filename); | 15,287 |
1 | static CharDriverState *qemu_chr_open_file_out(QemuOpts *opts) { int fd_out; TFR(fd_out = open(qemu_opt_get(opts, "path"), O_WRONLY | O_TRUNC | O_CREAT | O_BINARY, 0666)); if (fd_out < 0) return NULL; return qemu_chr_open_fd(-1, fd_out); } | 15,289 |
1 | static SchroBuffer *find_next_parse_unit(SchroParseUnitContext *parse_ctx) { SchroBuffer *enc_buf = NULL; int next_pu_offset = 0; unsigned char *in_buf; if (parse_ctx->buf_size < 13 || parse_ctx->buf[0] != 'B' || parse_ctx->buf[1] != 'B' || parse_ctx->buf[2] != 'C' || parse_ctx->buf[3] != 'D') return NULL; next_pu_offs... | 15,291 |
1 | static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int predictor, int point_transform){ int i, mb_x, mb_y; uint16_t buffer[2048][4]; int left[3], top[3], topleft[3]; const int linesize= s->linesize[0]; const int mask= (1<<s->bits)-1; for(i=0; i<3; i++){ buffer[0][i]= 1 << (s->bits + point_transform - 1); } for(mb_... | 15,292 |
0 | static int dnxhd_10bit_dct_quantize(MpegEncContext *ctx, DCTELEM *block, int n, int qscale, int *overflow) { const uint8_t *scantable= ctx->intra_scantable.scantable; const int *qmat = ctx->q_intra_matrix[qscale]; int last_non_zero = 0; ctx->dsp.fdct(block); // Divide by 4 with rounding, to compensate scaling of DCT co... | 15,293 |
0 | static int estimate_motion_b(MpegEncContext *s, int mb_x, int mb_y, int16_t (*mv_table)[2], int ref_index, int f_code) { MotionEstContext * const c= &s->me; int mx = 0, my = 0, dmin = 0; int P[10][2]; const int shift= 1+s->quarter_sample; const int mot_stride = s->mb_stride; const int mot_xy = mb_y*mot_stride + mb_x; u... | 15,294 |
0 | static av_cold int XAVS_close(AVCodecContext *avctx) { XavsContext *x4 = avctx->priv_data; av_freep(&avctx->extradata); av_free(x4->sei); av_freep(&x4->pts_buffer); if (x4->enc) xavs_encoder_close(x4->enc); av_frame_free(&avctx->coded_frame); return 0; } | 15,295 |
1 | int vhdx_parse_log(BlockDriverState *bs, BDRVVHDXState *s, bool *flushed) { int ret = 0; VHDXHeader *hdr; VHDXLogSequence logs = { 0 }; hdr = s->headers[s->curr_header]; *flushed = false; /* s->log.hdr is freed in vhdx_close() */ if (s->log.hdr == NULL) { s->log.hdr = qemu_blockalign(bs, sizeof(VHDXLogEntryHeader)); } ... | 15,297 |
1 | QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgorithm alg, QCryptoCipherMode mode, const uint8_t *key, size_t nkey, Error **errp) { QCryptoCipher *cipher; QCryptoCipherNettle *ctx; uint8_t *rfbkey; switch (mode) { case QCRYPTO_CIPHER_MODE_ECB: case QCRYPTO_CIPHER_MODE_CBC: case QCRYPTO_CIPHER_MODE_XTS: case QCRYPTO_... | 15,298 |
1 | static int mov_write_minf_tag(AVIOContext *pb, MOVTrack *track) { int64_t pos = avio_tell(pb); avio_wb32(pb, 0); /* size */ ffio_wfourcc(pb, "minf"); if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) mov_write_vmhd_tag(pb); else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) mov_write_smhd_tag(pb); else if (track->e... | 15,299 |
1 | static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q) { const AVPixFmtDescriptor *desc; mfxSession session = NULL; int iopattern = 0; mfxVideoParam param = { { 0 } }; int frame_width = avctx->coded_width; int frame_height = avctx->coded_height; int ret; desc = av_pix_fmt_desc_get(avctx->sw_pix_fmt); if (!des... | 15,300 |
1 | static void ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst, int stride, const uint8_t *table) { int i; int j; int out = 0; int c; int t; /* first line contain absolute values, other lines contain deltas */ while (out < width){ c = ir2_get_code(&ctx->gb); if(c > 0x80) { /* we have a run */ c -= 0x... | 15,302 |
1 | int kvm_arm_sync_mpstate_to_kvm(ARMCPU *cpu) { if (cap_has_mp_state) { struct kvm_mp_state mp_state = { .mp_state = cpu->powered_off ? KVM_MP_STATE_STOPPED : KVM_MP_STATE_RUNNABLE }; int ret = kvm_vcpu_ioctl(CPU(cpu), KVM_SET_MP_STATE, &mp_state); if (ret) { fprintf(stderr, "%s: failed to set MP_STATE %d/%s\n", __func_... | 15,303 |
1 | void virtio_queue_aio_set_host_notifier_handler(VirtQueue *vq, AioContext *ctx, bool assign, bool set_handler) { if (assign && set_handler) { aio_set_event_notifier(ctx, &vq->host_notifier, true, virtio_queue_host_notifier_read); } else { aio_set_event_notifier(ctx, &vq->host_notifier, true, NULL); } if (!assign) { /* ... | 15,304 |
1 | av_cold int swr_init(struct SwrContext *s){ int ret; char l1[1024], l2[1024]; clear_context(s); if(s-> in_sample_fmt >= AV_SAMPLE_FMT_NB){ av_log(s, AV_LOG_ERROR, "Requested input sample format %d is invalid\n", s->in_sample_fmt); return AVERROR(EINVAL); } if(s->out_sample_fmt >= AV_SAMPLE_FMT_NB){ av_log(s, AV_LOG_ERR... | 15,305 |
1 | static av_always_inline void vc1_apply_p_v_loop_filter(VC1Context *v, int block_num) { MpegEncContext *s = &v->s; int mb_cbp = v->cbp[s->mb_x - s->mb_stride], block_cbp = mb_cbp >> (block_num * 4), bottom_cbp, mb_is_intra = v->is_intra[s->mb_x - s->mb_stride], block_is_intra = mb_is_intra >> (block_num * 4), bottom_is_... | 15,306 |
0 | int main(void) { int x = 0; int i, j; AVLFG state; av_lfg_init(&state, 0xdeadbeef); for (j = 0; j < 10000; j++) { START_TIMER for (i = 0; i < 624; i++) { //av_log(NULL, AV_LOG_ERROR, "%X\n", av_lfg_get(&state)); x += av_lfg_get(&state); } STOP_TIMER("624 calls of av_lfg_get"); } av_log(NULL, AV_LOG_ERROR, "final value:... | 15,307 |
0 | enum CodecID codec_get_id(const CodecTag *tags, unsigned int tag) { while (tags->id != 0) { if( toupper((tag >> 0)&0xFF) == toupper((tags->tag >> 0)&0xFF) && toupper((tag >> 8)&0xFF) == toupper((tags->tag >> 8)&0xFF) && toupper((tag >>16)&0xFF) == toupper((tags->tag >>16)&0xFF) && toupper((tag >>24)&0xFF) == toupper((t... | 15,308 |
0 | static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, const int16_t *_block, ptrdiff_t stride) { int i; pixel *pix = (pixel*)_pix; const dctcoef *block = (const dctcoef*)_block; stride >>= sizeof(pixel)-1; pix -= stride; for(i=0; i<4; i++){ pixel v = pix[0]; pix[1*stride]= v += block[0]; pix[2*stride]= v += block[4]; ... | 15,309 |
1 | static void pci_bridge_cleanup_alias(MemoryRegion *alias, MemoryRegion *parent_space) { memory_region_del_subregion(parent_space, alias); memory_region_destroy(alias); } | 15,310 |
1 | static int get_buffer_internal(AVCodecContext *avctx, AVFrame *frame, int flags) { const AVHWAccel *hwaccel = avctx->hwaccel; int override_dimensions = 1; int ret; if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) { if ((ret = av_image_check_size2(avctx->width, avctx->height, avctx->max_pixels, AV_PIX_FMT_NONE, 0, avctx)) <... | 15,313 |
1 | void pcie_host_mmcfg_init(PCIExpressHost *e, uint32_t size) { assert(!(size & (size - 1))); /* power of 2 */ assert(size >= PCIE_MMCFG_SIZE_MIN); assert(size <= PCIE_MMCFG_SIZE_MAX); e->size = size; memory_region_init_io(&e->mmio, OBJECT(e), &pcie_mmcfg_ops, e, "pcie-mmcfg", e->size); } | 15,314 |
1 | static void update_sse_status(CPUX86State *env) { int rnd_type; /* set rounding mode */ switch (env->mxcsr & SSE_RC_MASK) { default: case SSE_RC_NEAR: rnd_type = float_round_nearest_even; break; case SSE_RC_DOWN: rnd_type = float_round_down; break; case SSE_RC_UP: rnd_type = float_round_up; break; case SSE_RC_CHOP: rnd... | 15,315 |
1 | static int adts_aac_probe(AVProbeData *p) { int max_frames = 0, first_frames = 0; int fsize, frames; uint8_t *buf0 = p->buf; uint8_t *buf2; uint8_t *buf; uint8_t *end = buf0 + p->buf_size - 7; buf = buf0; for(; buf < end; buf= buf2+1) { buf2 = buf; for(frames = 0; buf2 < end; frames++) { uint32_t header = AV_RB16(buf2)... | 15,316 |
1 | static int qio_channel_websock_handshake_read(QIOChannelWebsock *ioc, Error **errp) { char *handshake_end; ssize_t ret; /* Typical HTTP headers from novnc are 512 bytes, so limiting * total header size to 4096 is easily enough. */ size_t want = 4096 - ioc->encinput.offset; buffer_reserve(&ioc->encinput, want); ret = qi... | 15,317 |
1 | static int decode_init_mp3on4(AVCodecContext * avctx) { MP3On4DecodeContext *s = avctx->priv_data; MPEG4AudioConfig cfg; int i; if ((avctx->extradata_size < 2) || (avctx->extradata == NULL)) { av_log(avctx, AV_LOG_ERROR, "Codec extradata missing or too short.\n"); return -1; } avpriv_mpeg4audio_get_config(&cfg, avctx->... | 15,318 |
0 | void avdevice_register_all(void) { static int inited; if (inited) return; inited = 1; /* devices */ REGISTER_MUXDEMUX (AUDIO_BEOS, audio_beos); REGISTER_DEMUXER (BKTR, bktr); REGISTER_DEMUXER (DV1394, dv1394); REGISTER_MUXDEMUX (OSS, oss); REGISTER_DEMUXER (V4L2, v4l2); REGISTER_DEMUXER (V4L, v4l); REGISTER_DEMUXER (X1... | 15,320 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.