project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
FFmpeg | 77693c541a541661357a0edd5bbaae69c64b2039 | 0 | static int xan_decode_frame_type1(AVCodecContext *avctx)
{
XanContext *s = avctx->priv_data;
uint8_t *ybuf, *src = s->scratch_buffer;
int cur, last;
int i, j;
int ret;
if ((ret = xan_decode_chroma(avctx, bytestream2_get_le32(&s->gb))) != 0)
return ret;
bytestream2_seek(&... | 10,577 |
qemu | 7df953bd456da45f761064974820ab5c3fd7b2aa | 0 | static void vtd_context_device_invalidate(IntelIOMMUState *s,
uint16_t source_id,
uint16_t func_mask)
{
uint16_t mask;
VTDAddressSpace **pvtd_as;
VTDAddressSpace *vtd_as;
uint16_t devfn;
uint16_t devfn_it;
... | 10,578 |
qemu | 2914a1de992118286f5280eddf4f4e6060a8e00b | 0 | static int raw_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
BDRVRawState *s = bs->opaque;
int access_flags;
DWORD overlapped;
QemuOpts *opts;
Error *local_err = NULL;
const char *filename;
int ret;
s->type = FTYPE_FILE;
opts... | 10,580 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static struct omap_watchdog_timer_s *omap_wd_timer_init(MemoryRegion *memory,
target_phys_addr_t base,
qemu_irq irq, omap_clk clk)
{
struct omap_watchdog_timer_s *s = (struct omap_watchdog_timer_s *)
g_malloc0(sizeof(struct omap_watchdog_timer_s));
s->timer.ir... | 10,581 |
qemu | 3d948cdf3760b52238038626a7ffa7d30913060b | 0 | void qmp_block_job_cancel(const char *device,
bool has_force, bool force, Error **errp)
{
BlockJob *job = find_block_job(device);
if (!has_force) {
force = false;
}
if (!job) {
error_set(errp, QERR_BLOCK_JOB_NOT_ACTIVE, device);
return;
... | 10,582 |
qemu | 007ac6faed12abdd4113e2460ba4464aacb7f4dd | 0 | static void gen_flt3_ldst (DisasContext *ctx, uint32_t opc,
int fd, int fs, int base, int index)
{
const char *opn = "extended float load/store";
int store = 0;
TCGv t0 = tcg_temp_new();
if (base == 0) {
gen_load_gpr(t0, index);
} else if (index == 0) {
... | 10,584 |
qemu | a2db2a1edd06a50b8a862c654cf993368cf9f1d9 | 0 | static ioreq_t *cpu_get_ioreq(XenIOState *state)
{
int i;
evtchn_port_t port;
port = xc_evtchn_pending(state->xce_handle);
if (port == state->bufioreq_local_port) {
timer_mod(state->buffered_io_timer,
BUFFER_IO_MAX_DELAY + qemu_clock_get_ms(QEMU_CLOCK_REALTIME));
... | 10,585 |
qemu | 4fc9af53d88c0a2a810704a06cb39a7182982e4e | 0 | BlockDriverAIOCB *bdrv_aio_read(BlockDriverState *bs, int64_t sector_num,
uint8_t *buf, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
{
BlockDriver *drv = bs->drv;
BlockDriverAIOCB *ret;
if (!drv)
return NULL;
... | 10,586 |
qemu | bd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884 | 0 | static void tcp_chr_tls_init(Chardev *chr)
{
SocketChardev *s = SOCKET_CHARDEV(chr);
QIOChannelTLS *tioc;
Error *err = NULL;
gchar *name;
if (s->is_listen) {
tioc = qio_channel_tls_new_server(
s->ioc, s->tls_creds,
NULL, /* XXX Use an ACL */
&e... | 10,587 |
FFmpeg | 158b39126d59f07069e0da07e0658111967c6179 | 0 | static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
int *need_next_header, int *new_frame_start)
{
GetBitContext bits;
int size, rdb, ch, sr;
union {
uint64_t u64;
uint8_t u8[8];
} tmp;
tmp.u64 = be2me_64(state);
init_get_bits(&bits, tmp.u8+8-AA... | 10,588 |
qemu | 2d40564aaab3a99fe6ce00fc0fc893c02e9443ec | 1 | static int local_post_create_passthrough(FsContext *fs_ctx, const char *path,
FsCred *credp)
{
char buffer[PATH_MAX];
if (chmod(rpath(fs_ctx, path, buffer), credp->fc_mode & 07777) < 0) {
return -1;
}
if (lchown(rpath(fs_ctx, path, buffer), credp... | 10,589 |
qemu | 9586fefefe383a9aa25ad99bde9a6b240309ca33 | 1 | void vga_reset(void *opaque)
{
VGAState *s = (VGAState *) opaque;
s->lfb_addr = 0;
s->lfb_end = 0;
s->map_addr = 0;
s->map_end = 0;
s->lfb_vram_mapped = 0;
s->bios_offset = 0;
s->bios_size = 0;
s->sr_index = 0;
memset(s->sr, '\0', sizeof(s->sr));
s->gr_index = 0... | 10,591 |
FFmpeg | fed92adbb3fc6cbf735e3df9a2f7d0a2917fcfbd | 1 | void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y,
uint8_t *segment, uint8_t *ref, int layout, int is_vp7)
{
VP56RangeCoder *c = &s->c;
static const char *vp7_feature_name[] = { "q-index",
"lf-delta",
... | 10,593 |
FFmpeg | 1dc19729e92a96620000e09eba8e58cb458c9486 | 1 | static void asfrtp_close_context(PayloadContext *asf)
{
ffio_free_dyn_buf(&asf->pktbuf);
av_freep(&asf->buf);
av_free(asf);
}
| 10,595 |
FFmpeg | f16a6f667c993a158643b52815ec42961508b0a9 | 1 | static av_cold int dilate_init(AVFilterContext *ctx, const char *args)
{
OCVContext *ocv = ctx->priv;
DilateContext *dilate = ocv->priv;
char default_kernel_str[] = "3x3+0x0/rect";
char *kernel_str;
const char *buf = args;
int ret;
dilate->nb_iterations = 1;
if (args)
... | 10,597 |
qemu | 3ff2f67a7c24183fcbcfe1332e5223ac6f96438c | 1 | BlockDriverState *bdrv_new(void)
{
BlockDriverState *bs;
int i;
bs = g_new0(BlockDriverState, 1);
QLIST_INIT(&bs->dirty_bitmaps);
for (i = 0; i < BLOCK_OP_TYPE_MAX; i++) {
QLIST_INIT(&bs->op_blockers[i]);
}
notifier_with_return_list_init(&bs->before_write_notifiers);
bs->refcnt =... | 10,598 |
FFmpeg | 2da0d70d5eebe42f9fcd27ee554419ebe2a5da06 | 1 | static inline void RENAME(bgr32ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, int width)
{
int i;
assert(src1 == src2);
for(i=0; i<width; i++)
{
const int a= ((uint32_t*)src1)[2*i+0];
const int e= ((uint32_t*)src1)[2*i+1];
const int l= (a&0xFF00FF) + (e&0xFF00FF);
const in... | 10,600 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static int qemu_rdma_init_ram_blocks(RDMAContext *rdma)
{
RDMALocalBlocks *local = &rdma->local_ram_blocks;
assert(rdma->blockmap == NULL);
rdma->blockmap = g_hash_table_new(g_direct_hash, g_direct_equal);
memset(local, 0, sizeof *local);
qemu_ram_foreach_block(qemu_rdma_init_one_block, rdma... | 10,601 |
qemu | c3e10c7b4377c1cbc0a4fbc12312c2cf41c0cda7 | 1 | static always_inline void gen_op_subfeo (void)
{
gen_op_move_T2_T0();
gen_op_subfe();
gen_op_check_subfo();
}
| 10,602 |
qemu | d5208c45be38ab858db6ec5a5097aa1c1a8ebbc9 | 1 | void commit_start(BlockDriverState *bs, BlockDriverState *base,
BlockDriverState *top, int64_t speed,
BlockdevOnError on_error, BlockDriverCompletionFunc *cb,
void *opaque, Error **errp)
{
CommitBlockJob *s;
BlockReopenQueue *reopen_queue = NULL;
... | 10,603 |
qemu | 92b540dac9fc3a572c7342edd0b073000f5a6abf | 1 | static void check_guest_output(const testdef_t *test, int fd)
{
bool output_ok = false;
int i, nbr, pos = 0;
char ch;
/* Poll serial output... Wait at most 60 seconds */
for (i = 0; i < 6000; ++i) {
while ((nbr = read(fd, &ch, 1)) == 1) {
if (ch == test->expect[pos]) {
... | 10,604 |
FFmpeg | 266649a52fe258c09bbe5d2e222431c6a864af3f | 1 | static void do_subtitle_out(AVFormatContext *s,
AVOutputStream *ost,
AVInputStream *ist,
AVSubtitle *sub,
int64_t pts)
{
static uint8_t *subtitle_out = NULL;
int subtitle_out_max_size = 65536;
... | 10,605 |
qemu | b60fae32ff33cbaab76d14cc5f55b979cf58516d | 1 | static int handle_sw_breakpoint(S390CPU *cpu, struct kvm_run *run)
{
CPUS390XState *env = &cpu->env;
unsigned long pc;
cpu_synchronize_state(CPU(cpu));
pc = env->psw.addr - 4;
if (kvm_find_sw_breakpoint(CPU(cpu), pc)) {
env->psw.addr = pc;
return EXCP_DEBUG;
}
... | 10,607 |
qemu | 6b37a23df98faa26391a93373930bfb15b943e00 | 1 | static void vhost_dev_sync_region(struct vhost_dev *dev,
MemoryRegionSection *section,
uint64_t mfirst, uint64_t mlast,
uint64_t rfirst, uint64_t rlast)
{
uint64_t start = MAX(mfirst, rfirst);
uint64_t en... | 10,610 |
qemu | 6bdcc018a6ed760b9dfe43539124e420aed83092 | 1 | int nbd_client_co_pdiscard(BlockDriverState *bs, int64_t offset, int count)
{
NBDClientSession *client = nbd_get_client_session(bs);
NBDRequest request = {
.type = NBD_CMD_TRIM,
.from = offset,
.len = count,
};
NBDReply reply;
ssize_t ret;
if (!(client->nbdfla... | 10,612 |
qemu | 6882c8fa78dcc4882640d3e11232d995fda7d5c4 | 1 | int qcow2_check_refcounts(BlockDriverState *bs)
{
BDRVQcowState *s = bs->opaque;
int64_t size;
int nb_clusters, refcount1, refcount2, i;
QCowSnapshot *sn;
uint16_t *refcount_table;
int ret, errors = 0;
size = bdrv_getlength(bs->file);
nb_clusters = size_to_clusters(s, size);
... | 10,613 |
FFmpeg | c46400ddecab3a47e8f1aec9a405bbe2a321b06a | 1 | static int caf_write_trailer(AVFormatContext *s)
{
AVIOContext *pb = s->pb;
AVCodecContext *enc = s->streams[0]->codec;
if (pb->seekable) {
CAFContext *caf = s->priv_data;
int64_t file_size = avio_tell(pb);
avio_seek(pb, caf->data, SEEK_SET);
avio_wb64(pb, file_si... | 10,614 |
qemu | 12de9a396acbc95e25c5d60ed097cc55777eaaed | 1 | static void init_proc_970GX (CPUPPCState *env)
{
gen_spr_ne_601(env);
gen_spr_7xx(env);
/* Time base */
gen_tbl(env);
/* Hardware implementation registers */
/* XXX : not implemented */
spr_register(env, SPR_HID0, "HID0",
SPR_NOACCESS, SPR_NOACCESS,
... | 10,615 |
FFmpeg | 16a0d75c769a7df6f457b2200dbc9a7cc73798c6 | 1 | static int find_marker(const uint8_t **pbuf_ptr, const uint8_t *buf_end)
{
const uint8_t *buf_ptr;
unsigned int v, v2;
int val;
int skipped = 0;
buf_ptr = *pbuf_ptr;
while (buf_ptr < buf_end) {
v = *buf_ptr++;
v2 = *buf_ptr;
if ((v == 0xff) && (v2 >= 0xc0) &&... | 10,616 |
FFmpeg | 4a71da0f3ab7f5542decd11c81994f849d5b2c78 | 1 | static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
AVPacket *avpkt) {
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
AVSContext *h = avctx->priv_data;
MpegEncContext *s = &h->s;
int input_size;
const uint8_t *buf_end... | 10,617 |
qemu | 05fcfada5e45b900c32ca6bccf0ce52cb5422509 | 1 | static int get_pci_config_device(QEMUFile *f, void *pv, size_t size)
{
PCIDevice *s = container_of(pv, PCIDevice, config);
uint8_t config[size];
int i;
qemu_get_buffer(f, config, size);
for (i = 0; i < size; ++i)
if ((config[i] ^ s->config[i]) & s->cmask[i] & ~s->wmask[i])
... | 10,618 |
FFmpeg | 6a744d261930f8101132bc6d207b6eac41d9cf18 | 0 | static void update_md5_sum(FlacEncodeContext *s, const int16_t *samples)
{
#if HAVE_BIGENDIAN
int i;
for (i = 0; i < s->frame.blocksize * s->channels; i++) {
int16_t smp = av_le2ne16(samples[i]);
av_md5_update(s->md5ctx, (uint8_t *)&smp, 2);
}
#else
av_md5_update(s->md5ctx, (con... | 10,619 |
FFmpeg | b91e0e59874d28f35a28acb4f886ab1e7d80cacb | 0 | static int cuvid_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
{
CuvidContext *ctx = avctx->priv_data;
AVHWDeviceContext *device_ctx = (AVHWDeviceContext*)ctx->hwdevice->data;
AVCUDADeviceContext *device_hwctx = device_ctx->hwctx;
CUcontext dummy, cuda_ctx = devic... | 10,621 |
FFmpeg | d6737539e77e78fca9a04914d51996cfd1ccc55c | 0 | static void intra_predict_mad_cow_dc_0lt_8x8_msa(uint8_t *src, int32_t stride)
{
uint8_t lp_cnt;
uint32_t src0, src1, src2 = 0, src3;
uint32_t out0, out1, out2, out3;
v16u8 src_top;
v8u16 add;
v4u32 sum;
src_top = LD_UB(src - stride);
add = __msa_hadd_u_h(src_top, src_top);
... | 10,623 |
FFmpeg | 05340be97bc395ca0b544c6d856469894ecbf5eb | 0 | static int img_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
{
VideoDemuxData *s1 = s->priv_data;
if (timestamp < 0 || timestamp > s1->img_last - s1->img_first)
return -1;
s1->img_number = timestamp + s1->img_first;
return 0;
}
| 10,624 |
FFmpeg | 5d9e4eaa6d991718b24c7ce24318ee91419f593a | 0 | static int read_filter_params(MLPDecodeContext *m, GetBitContext *gbp,
unsigned int channel, unsigned int filter)
{
FilterParams *fp = &m->channel_params[channel].filter_params[filter];
const int max_order = filter ? MAX_IIR_ORDER : MAX_FIR_ORDER;
const char fchar = filter... | 10,625 |
FFmpeg | ac8c72f8f1f758ae7606db42eac83d04418aec48 | 0 | static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
MOVStreamContext *sc;
int size;
int32_t yaw, pitch, roll;
size_t l = 0, t = 0, r = 0, b = 0;
size_t padding = 0;
uint32_t tag;
enum AVSphericalProjection projection;
if (c->fc->nb_strea... | 10,626 |
FFmpeg | 392f227393f479ab9a461aba68ae4c6b6da685a4 | 0 | struct tm *brktimegm(time_t secs, struct tm *tm)
{
int days, y, ny, m;
int md[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
days = secs / 86400;
secs %= 86400;
tm->tm_hour = secs / 3600;
tm->tm_min = (secs % 3600) / 60;
tm->tm_sec = secs % 60;
/* oh well, may be s... | 10,627 |
FFmpeg | 71199ee9077da7d92a8728e2a694fb1ab31488a7 | 0 | 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, *... | 10,628 |
FFmpeg | 4ee247a2bdf2fbe81026a428d4affc46c81f28db | 0 | static int get_audio_flags(AVCodecContext *enc){
int flags = (enc->bits_per_coded_sample == 16) ? FLV_SAMPLESSIZE_16BIT : FLV_SAMPLESSIZE_8BIT;
if (enc->codec_id == CODEC_ID_AAC) // specs force these parameters
return FLV_CODECID_AAC | FLV_SAMPLERATE_44100HZ | FLV_SAMPLESSIZE_16BIT | FLV_STEREO;
... | 10,629 |
FFmpeg | dfc6e30cd4b9d1817b78579c11fc6881e40b9733 | 0 | static int init_output_stream_encode(OutputStream *ost)
{
InputStream *ist = get_input_stream(ost);
AVCodecContext *enc_ctx = ost->enc_ctx;
AVCodecContext *dec_ctx = NULL;
AVFormatContext *oc = output_files[ost->file_index]->ctx;
int j, ret;
set_encoder_id(output_files[ost->file_index],... | 10,630 |
FFmpeg | b52ae27edf392e5a0df95054d394d850b8e57d35 | 0 | int avio_put_str16le(AVIOContext *s, const char *str)
{
const uint8_t *q = str;
int ret = 0;
while (*q) {
uint32_t ch;
uint16_t tmp;
GET_UTF8(ch, *q++, break;)
PUT_UTF16(ch, tmp, avio_wl16(s, tmp); ret += 2;)
}
avio_wl16(s, 0);
ret += 2;
return... | 10,631 |
FFmpeg | 68f593b48433842f3407586679fe07f3e5199ab9 | 0 | void init_get_bits(GetBitContext *s,
UINT8 *buffer, int buffer_size)
{
s->buffer= buffer;
s->size= buffer_size;
s->buffer_end= buffer + buffer_size;
#ifdef ALT_BITSTREAM_READER
s->index=0;
#elif defined LIBMPEG2_BITSTREAM_READER
s->buffer_ptr = buffer;
s->bit_count =... | 10,632 |
FFmpeg | c89658008705d949c319df3fa6f400c481ad73e1 | 0 | static int sdp_parse_rtpmap(AVCodecContext *codec, RTSPStream *rtsp_st, int payload_type, const char *p)
{
char buf[256];
int i;
AVCodec *c;
const char *c_name;
/* Loop into AVRtpDynamicPayloadTypes[] and AVRtpPayloadTypes[] and
see if we can handle this kind of payload */
get_w... | 10,633 |
qemu | 7e0e736ecdfeac6d3517513d3a702304e4f6cf59 | 1 | static void virtio_net_device_realize(DeviceState *dev, Error **errp)
{
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
VirtIONet *n = VIRTIO_NET(dev);
NetClientState *nc;
int i;
virtio_init(vdev, "virtio-net", VIRTIO_ID_NET, n->config_size);
n->max_queues = MAX(n->nic_conf.peers.queues, 1);... | 10,634 |
FFmpeg | 14bac7e00d72eac687612d9b125e585011a56d4f | 1 | static int avi_read_seek(AVFormatContext *s, int stream_index,
int64_t timestamp, int flags)
{
AVIContext *avi = s->priv_data;
AVStream *st;
int i, index;
int64_t pos, pos_min;
AVIStream *ast;
/* Does not matter which stream is requested dv in avi has the
... | 10,635 |
FFmpeg | 97437bd17a8c5d4135b2f3b1b299bd7bb72ce02c | 1 | void ff_aac_coder_init_mips(AACEncContext *c) {
#if HAVE_INLINE_ASM
AACCoefficientsEncoder *e = c->coder;
int option = c->options.aac_coder;
if (option == 2) {
e->quantize_and_encode_band = quantize_and_encode_band_mips;
e->encode_window_bands_info = codebook_trellis_rate;
#if HAVE_... | 10,636 |
qemu | 797d780b1375b1af1d7713685589bfdec9908dc3 | 1 | static void gen_wsr_ps(DisasContext *dc, uint32_t sr, TCGv_i32 v)
{
uint32_t mask = PS_WOE | PS_CALLINC | PS_OWB |
PS_UM | PS_EXCM | PS_INTLEVEL;
if (option_enabled(dc, XTENSA_OPTION_MMU)) {
mask |= PS_RING;
}
tcg_gen_andi_i32(cpu_SR[sr], v, mask);
/* This can change mmu in... | 10,637 |
qemu | 4d9ad7f793605abd9806fc932b3e04e028894565 | 1 | uint64_t HELPER(neon_abdl_s32)(uint32_t a, uint32_t b)
{
uint64_t tmp;
uint64_t result;
DO_ABD(result, a, b, int16_t);
DO_ABD(tmp, a >> 16, b >> 16, int16_t);
return result | (tmp << 32);
}
| 10,638 |
FFmpeg | ddfa3751c092feaf1e080f66587024689dfe603c | 1 | static int get_cox(J2kDecoderContext *s, J2kCodingStyle *c)
{
if (s->buf_end - s->buf < 5)
return AVERROR(EINVAL);
c->nreslevels = bytestream_get_byte(&s->buf) + 1; // num of resolution levels - 1
c->log2_cblk_width = bytestream_get_byte(&s->buf) + 2; // cblk width
c->log2_cblk_heig... | 10,639 |
qemu | fcf73f66a67f5e58c18216f8c8651e38cf4d90af | 1 | QFloat *qobject_to_qfloat(const QObject *obj)
{
if (qobject_type(obj) != QTYPE_QFLOAT)
return NULL;
return container_of(obj, QFloat, base);
}
| 10,641 |
qemu | 0ccb9c1d8128a020720d5c6abf99a470742a1b94 | 1 | void HELPER(divu)(CPUM68KState *env, uint32_t word)
{
uint32_t num;
uint32_t den;
uint32_t quot;
uint32_t rem;
num = env->div1;
den = env->div2;
/* ??? This needs to make sure the throwing location is accurate. */
if (den == 0) {
raise_exception(env, EXCP_DIV0);
... | 10,642 |
qemu | a37ee56cb7f2094a65fff14ed5d4ff325652b802 | 1 | void cpu_dump_state(CPUState *env, FILE *f,
int (*cpu_fprintf)(FILE *f, const char *fmt, ...),
int flags)
{
int i, x;
cpu_fprintf(f, "pc: " TARGET_FMT_lx " npc: " TARGET_FMT_lx "\n", env->pc,
env->npc);
cpu_fprintf(f, "General Registers:\n");... | 10,643 |
qemu | cdd346371e09709be8e46398bb097dc690a746f2 | 1 | static uint16_t nvme_set_feature(NvmeCtrl *n, NvmeCmd *cmd, NvmeRequest *req)
{
uint32_t dw10 = le32_to_cpu(cmd->cdw10);
uint32_t dw11 = le32_to_cpu(cmd->cdw11);
switch (dw10) {
case NVME_VOLATILE_WRITE_CACHE:
blk_set_enable_write_cache(n->conf.blk, dw11 & 1);
break;
case N... | 10,644 |
FFmpeg | 90e8317b3b33dcb54ae01e419d85cbbfbd874963 | 1 | static int flic_decode_frame_8BPP(AVCodecContext *avctx,
void *data, int *got_frame,
const uint8_t *buf, int buf_size)
{
FlicDecodeContext *s = avctx->priv_data;
GetByteContext g2;
int pixel_ptr;
int palette_ptr;
unsigned ... | 10,645 |
qemu | f51074cdc6e750daa3b6df727d83449a7e42b391 | 1 | static int pci_read_devaddr(Monitor *mon, const char *addr,
int *busp, unsigned *slotp)
{
int dom;
/* strip legacy tag */
if (!strncmp(addr, "pci_addr=", 9)) {
addr += 9;
}
if (pci_parse_devaddr(addr, &dom, busp, slotp, NULL)) {
monitor_printf(m... | 10,646 |
FFmpeg | a9f8587e152c16e943c645ff295e015384ccd76d | 0 | static void write_streaminfo(FlacEncodeContext *s, uint8_t *header)
{
PutBitContext pb;
memset(header, 0, FLAC_STREAMINFO_SIZE);
init_put_bits(&pb, header, FLAC_STREAMINFO_SIZE);
/* streaminfo metadata block */
put_bits(&pb, 16, s->avctx->frame_size);
put_bits(&pb, 16, s->avctx->frame... | 10,647 |
qemu | c84a88d8cb298b6757ad01a12a8bbba66cb6eaa2 | 1 | static void slavio_check_interrupts(SLAVIO_INTCTLState *s, int set_irqs)
{
uint32_t pending = s->intregm_pending, pil_pending;
unsigned int i, j;
pending &= ~s->intregm_disabled;
trace_slavio_check_interrupts(pending, s->intregm_disabled);
for (i = 0; i < MAX_CPUS; i++) {
pil_pend... | 10,649 |
qemu | 282c6a2f292705f823554447ca0b7731b6f81a97 | 1 | static struct ioreq *ioreq_start(struct XenBlkDev *blkdev)
{
struct ioreq *ioreq = NULL;
if (QLIST_EMPTY(&blkdev->freelist)) {
if (blkdev->requests_total >= max_requests) {
goto out;
}
/* allocate new struct */
ioreq = g_malloc0(sizeof(*ioreq));
ior... | 10,650 |
FFmpeg | 14b6adfd4627421223894c6909476d229cb6d07d | 1 | static void dequantize_slice_buffered(SnowContext *s, slice_buffer * sb, SubBand *b, IDWTELEM *src, int stride, int start_y, int end_y){
const int w= b->width;
const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16);
const int qmul= ff_qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
const int qadd= (s->qbias*... | 10,651 |
qemu | 8db4936bb648e15173d687bc162be14fd0d4260c | 1 | static int kvm_irqchip_create(MachineState *machine, KVMState *s)
{
int ret;
if (!machine_kernel_irqchip_allowed(machine) ||
(!kvm_check_extension(s, KVM_CAP_IRQCHIP) &&
(kvm_vm_enable_cap(s, KVM_CAP_S390_IRQCHIP, 0) < 0))) {
return 0;
}
/* First probe and see if the... | 10,652 |
qemu | 02ce232c5051854bf49e6d2816c65e00f6d7e036 | 1 | static void qemu_clock_init(QEMUClockType type)
{
QEMUClock *clock = qemu_clock_ptr(type);
clock->type = type;
clock->enabled = true;
clock->last = INT64_MIN;
QLIST_INIT(&clock->timerlists);
notifier_list_init(&clock->reset_notifiers);
main_loop_tlg.tl[type] = timerlist_new(type, NULL, NULL)... | 10,653 |
qemu | 9b2fadda3e0196ffd485adde4fe9cdd6fae35300 | 1 | static void gen_mfdcr(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);
#else
TCGv dcrn;
if (unlikely(ctx->pr)) {
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);
return;
}
/* NIP cannot be restored if the memory exception c... | 10,654 |
FFmpeg | 8d0786ec6d066f892f29da6593e99e73a7dfd014 | 0 | static int wav_write_header(AVFormatContext *s)
{
WAVContext *wav = s->priv_data;
AVIOContext *pb = s->pb;
int64_t fmt, fact;
ffio_wfourcc(pb, "RIFF");
avio_wl32(pb, 0); /* file length */
ffio_wfourcc(pb, "WAVE");
/* format header */
fmt = ff_start_tag(pb, "fmt ");
if (... | 10,655 |
FFmpeg | 438f884fc48b4b956fa713df2a722bd484f5646b | 0 | void ff_llviddsp_init_x86(LLVidDSPContext *c)
{
int cpu_flags = av_get_cpu_flags();
#if HAVE_INLINE_ASM && HAVE_7REGS && ARCH_X86_32
if (cpu_flags & AV_CPU_FLAG_CMOV)
c->add_median_pred = add_median_pred_cmov;
#endif
if (ARCH_X86_32 && EXTERNAL_MMX(cpu_flags)) {
c->add_bytes = ff... | 10,656 |
FFmpeg | 8febd6afbca652b331ddd8e75e356656c153cad1 | 0 | static av_cold int libgsm_init(AVCodecContext *avctx) {
if (avctx->channels > 1) {
av_log(avctx, AV_LOG_ERROR, "Mono required for GSM, got %d channels\n",
avctx->channels);
return -1;
}
if(avctx->codec->decode){
if(!avctx->channels)
avctx->channel... | 10,657 |
FFmpeg | 934982c4ace1a3d5d627b518782ed092a456c49e | 0 | static int h261_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
H261Context *h= avctx->priv_data;
MpegEncContext *s = &h->s;
int ret;
AVFrame *pict = data;
#ifdef DEBUG
printf("*****fra... | 10,658 |
FFmpeg | 2d453188c2303da641dafb048dc1806790526dfd | 0 | static int mov_read_uuid(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
MOVStreamContext *sc;
int64_t ret;
uint8_t uuid[16];
static const uint8_t uuid_isml_manifest[] = {
0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd,
0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, ... | 10,660 |
qemu | 4d9ad7f793605abd9806fc932b3e04e028894565 | 1 | uint64_t HELPER(neon_abdl_u16)(uint32_t a, uint32_t b)
{
uint64_t tmp;
uint64_t result;
DO_ABD(result, a, b, uint8_t);
DO_ABD(tmp, a >> 8, b >> 8, uint8_t);
result |= tmp << 16;
DO_ABD(tmp, a >> 16, b >> 16, uint8_t);
result |= tmp << 32;
DO_ABD(tmp, a >> 24, b >> 24, uint8_t);
... | 10,661 |
FFmpeg | ff1e30c059386db05131fe2f5bca1f35e1f5ac7e | 1 | static int ipvideo_decode_block_opcode_0xA(IpvideoContext *s, AVFrame *frame)
{
int x, y;
unsigned char P[8];
int flags = 0;
bytestream2_get_buffer(&s->stream_ptr, P, 4);
/* 4-color encoding for each 4x4 quadrant, or 4-color encoding on
* either top and bottom or left and right halves */
if... | 10,663 |
FFmpeg | 46e75617d9700be8840a843237f8571061a63a8e | 1 | static av_cold int truemotion1_decode_init(AVCodecContext *avctx)
{
TrueMotion1Context *s = avctx->priv_data;
s->avctx = avctx;
// FIXME: it may change ?
// if (avctx->bits_per_sample == 24)
// avctx->pix_fmt = AV_PIX_FMT_RGB24;
// else
// avctx->pix_fmt = AV_PIX_FMT_RGB555;
... | 10,664 |
qemu | 85d604af5f96c32734af9974ec6ddb625b6716a2 | 1 | static uint32_t suov32(CPUTriCoreState *env, int64_t arg)
{
uint32_t ret;
int64_t max_pos = UINT32_MAX;
if (arg > max_pos) {
env->PSW_USB_V = (1 << 31);
env->PSW_USB_SV = (1 << 31);
ret = (target_ulong)max_pos;
} else {
if (arg < 0) {
env->PSW_USB_V ... | 10,666 |
FFmpeg | 8f1afde11d4d76fc2444074b45d76a5113d1d748 | 0 | static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *pkt)
{
DiracContext *s = avctx->priv_data;
AVFrame *picture = data;
uint8_t *buf = pkt->data;
int buf_size = pkt->size;
int i, data_unit_size, buf_idx = 0;
int ret;
/* re... | 10,667 |
FFmpeg | 82dd7d0dec29ee59af91ce18c29eb151b363ff37 | 0 | static int decode_svq1_block (bit_buffer_t *bitbuf, uint8_t *pixels, int pitch, int intra) {
uint32_t bit_cache;
vlc_code_t *vlc;
uint8_t *list[63];
uint32_t *dst;
uint32_t *codebook;
int entries[6];
int i, j, m, n;
int mean, stages;
int x, y, width, height, ... | 10,668 |
FFmpeg | 5ff31babfccd16cdee6575ae015ff67e9a08e35d | 0 | static int mov_init(AVFormatContext *s)
{
MOVMuxContext *mov = s->priv_data;
AVDictionaryEntry *global_tcr = av_dict_get(s->metadata, "timecode", NULL, 0);
int i, ret;
mov->fc = s;
/* Default mode == MP4 */
mov->mode = MODE_MP4;
if (s->oformat) {
if (!strcmp("3gp", s->... | 10,669 |
qemu | db3bf8696358e105903b00432cad0aa50d3c0cb6 | 1 | static GThread *trace_thread_create(GThreadFunc fn)
{
GThread *thread;
#ifndef _WIN32
sigset_t set, oldset;
sigfillset(&set);
pthread_sigmask(SIG_SETMASK, &set, &oldset);
#endif
thread = g_thread_create(writeout_thread, NULL, FALSE, NULL);
#ifndef _WIN32
pthread_sigmask(SIG_SETMASK, ... | 10,674 |
qemu | 297a3646c2947ee64a6d42ca264039732c6218e0 | 1 | static void visit_type_TestStruct(Visitor *v, TestStruct **obj,
const char *name, Error **errp)
{
Error *err = NULL;
visit_start_struct(v, (void **)obj, "TestStruct", name, sizeof(TestStruct),
&err);
if (err) {
goto out;
}
... | 10,675 |
FFmpeg | 01ecb7172b684f1c4b3e748f95c5a9a494ca36ec | 1 | static float get_band_cost_ZERO_mips(struct AACEncContext *s,
PutBitContext *pb, const float *in,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
... | 10,676 |
FFmpeg | 648c79624fa70414dfb644fcb84b9de15e6568b0 | 1 | static int decode_thread(void *arg)
{
VideoState *is = arg;
AVFormatContext *ic;
int err, i, ret;
int st_index[AVMEDIA_TYPE_NB];
AVPacket pkt1, *pkt = &pkt1;
AVFormatParameters params, *ap = ¶ms;
int eof=0;
int pkt_in_play_range = 0;
ic = avformat_alloc_context();
... | 10,677 |
qemu | 016d2e1dfa21b64a524d3629fdd317d4c25bc3b8 | 1 | static int restore_sigcontext(CPUSH4State *regs, struct target_sigcontext *sc,
target_ulong *r0_p)
{
unsigned int err = 0;
int i;
#define COPY(x) __get_user(regs->x, &sc->sc_##x)
COPY(gregs[1]);
COPY(gregs[2]); COPY(gregs[3]);
COPY(gregs[4]); COPY(greg... | 10,678 |
qemu | d9bce9d99f4656ae0b0127f7472db9067b8f84ab | 1 | void do_rfi (void)
{
env->nip = env->spr[SPR_SRR0] & ~0x00000003;
T0 = env->spr[SPR_SRR1] & ~0xFFFF0000UL;
do_store_msr(env, T0);
#if defined (DEBUG_OP)
dump_rfi();
#endif
env->interrupt_request |= CPU_INTERRUPT_EXITTB;
}
| 10,680 |
qemu | 9a826d7854baf6b90de46fea785d1bfc5d2c22a7 | 1 | restore_sigcontext(CPUX86State *env, struct target_sigcontext *sc, int *peax)
{
unsigned int err = 0;
abi_ulong fpstate_addr;
unsigned int tmpflags;
cpu_x86_load_seg(env, R_GS, tswap16(sc->gs));
cpu_x86_load_seg(env, R_FS, tswap16(sc->fs));
cpu_x86_load_seg(env, R_ES, t... | 10,681 |
qemu | bec1e9546e03b9e7f5152cf3e8c95cf8acff5e12 | 1 | static ssize_t local_readlink(FsContext *fs_ctx, V9fsPath *fs_path,
char *buf, size_t bufsz)
{
ssize_t tsize = -1;
char *buffer;
char *path = fs_path->data;
if ((fs_ctx->export_flags & V9FS_SM_MAPPED) ||
(fs_ctx->export_flags & V9FS_SM_MAPPED_FILE)) {
... | 10,682 |
qemu | 24ec2863b147aadd8cbd63f87ad0467210164304 | 1 | static void htab_save_first_pass(QEMUFile *f, sPAPRMachineState *spapr,
int64_t max_ns)
{
bool has_timeout = max_ns != -1;
int htabslots = HTAB_SIZE(spapr) / HASH_PTE_SIZE_64;
int index = spapr->htab_save_index;
int64_t starttime = qemu_clock_get_ns(QEMU_CLOCK_REAL... | 10,684 |
qemu | 966439a67830239a6c520c5df6c55627b8153c8b | 1 | void OPPROTO op_check_addo_64 (void)
{
if (likely(!(((uint64_t)T2 ^ (uint64_t)T1 ^ UINT64_MAX) &
((uint64_t)T2 ^ (uint64_t)T0) & (1ULL << 63)))) {
xer_ov = 0;
} else {
xer_so = 1;
xer_ov = 1;
}
RETURN();
}
| 10,686 |
qemu | 21ef45d71221b4577330fe3aacfb06afad91ad46 | 1 | static void vnc_dpy_resize(DisplayChangeListener *dcl,
DisplayState *ds)
{
VncDisplay *vd = ds->opaque;
VncState *vs;
vnc_abort_display_jobs(vd);
/* server surface */
qemu_pixman_image_unref(vd->server);
vd->server = pixman_image_create_bits(VNC_SERVER_FB_F... | 10,687 |
qemu | 1b0952445522af73b0e78420a9078b3653923703 | 1 | void hbitmap_iter_init(HBitmapIter *hbi, const HBitmap *hb, uint64_t first)
{
unsigned i, bit;
uint64_t pos;
hbi->hb = hb;
pos = first >> hb->granularity;
hbi->pos = pos >> BITS_PER_LEVEL;
hbi->granularity = hb->granularity;
for (i = HBITMAP_LEVELS; i-- > 0; ) {
bit = p... | 10,688 |
qemu | b9a0be9239ef58630c6b436ac7ed2cf0bc3a028d | 1 | print_ipc_cmd(int cmd)
{
#define output_cmd(val) \
if( cmd == val ) { \
gemu_log(#val); \
return; \
}
cmd &= 0xff;
/* General IPC commands */
output_cmd( IPC_RMID );
output_cmd( IPC_SET );
output_cmd( IPC_STAT );
output_cmd( IPC_INFO );
/* msgctl() commands */
#... | 10,689 |
FFmpeg | d445a7e9cc31b94ab1eceb228a7634c79d37496e | 1 | static void extract_mpeg4_header(AVFormatContext *infile)
{
int mpeg4_count, i, size;
AVPacket pkt;
AVStream *st;
const uint8_t *p;
mpeg4_count = 0;
for(i=0;i<infile->nb_streams;i++) {
st = infile->streams[i];
if (st->codec.codec_id == CODEC_ID_MPEG4 &&
st... | 10,690 |
FFmpeg | 6fb2fd895e858ab93f46e656a322778ee181c307 | 1 | void avfilter_unref_buffer(AVFilterBufferRef *ref)
{
if (!ref)
return;
av_assert0(ref->buf->refcount > 0);
if (!(--ref->buf->refcount)) {
if (!ref->buf->free) {
store_in_pool(ref);
return;
}
ref->buf->free(ref->buf);
}
if (ref->exte... | 10,691 |
qemu | 15c2f669e3fb2bc97f7b42d1871f595c0ac24af8 | 1 | QmpInputVisitor *qmp_input_visitor_new(QObject *obj, bool strict)
{
QmpInputVisitor *v;
v = g_malloc0(sizeof(*v));
v->visitor.type = VISITOR_INPUT;
v->visitor.start_struct = qmp_input_start_struct;
v->visitor.end_struct = qmp_input_end_struct;
v->visitor.start_list = qmp_input_start_l... | 10,693 |
qemu | b2b012afdd9c03ba8a1619f45301d34f358d367b | 1 | static void imx_eth_enable_rx(IMXFECState *s)
{
IMXFECBufDesc bd;
bool rx_ring_full;
imx_fec_read_bd(&bd, s->rx_descriptor);
rx_ring_full = !(bd.flags & ENET_BD_E);
if (rx_ring_full) {
FEC_PRINTF("RX buffer full\n");
} else if (!s->regs[ENET_RDAR]) {
qemu_flush_que... | 10,694 |
FFmpeg | c23acbaed40101c677dfcfbbfe0d2c230a8e8f44 | 1 | static inline void FUNC(idctSparseColAdd)(pixel *dest, int line_size,
DCTELEM *col)
{
int a0, a1, a2, a3, b0, b1, b2, b3;
INIT_CLIP;
IDCT_COLS;
dest[0] = CLIP(dest[0] + ((a0 + b0) >> COL_SHIFT));
dest += line_size;
dest[0] = CLIP(dest[0] + ((... | 10,695 |
FFmpeg | 640a2427aafa774b83316b7a8c5c2bdc28bfd269 | 1 | static int bfi_read_packet(AVFormatContext * s, AVPacket * pkt)
{
BFIContext *bfi = s->priv_data;
AVIOContext *pb = s->pb;
int ret, audio_offset, video_offset, chunk_size, audio_size = 0;
if (bfi->nframes == 0 || pb->eof_reached) {
return AVERROR(EIO);
/* If all previous chunks wer... | 10,696 |
FFmpeg | 836fc7778513fa97c1852444155f82627ecbb8cd | 1 | static int mpc7_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 gb;
uint8_t *bits;
in... | 10,697 |
FFmpeg | f63166f8dff65942c633adf32da9847ee1da3a47 | 1 | static void qpeg_decode_intra(uint8_t *src, uint8_t *dst, int size,
int stride, int width, int height)
{
int i;
int code;
int c0, c1;
int run, copy;
int filled = 0;
height--;
dst = dst + height * stride;
while(size > 0) {
code = *src++;
size--;
run = co... | 10,698 |
qemu | 983bff3530782d51c46c8d7c0e17e2a9dfe5fb77 | 1 | static void usb_mtp_handle_reset(USBDevice *dev)
{
MTPState *s = USB_MTP(dev);
trace_usb_mtp_reset(s->dev.addr);
#ifdef __linux__
usb_mtp_inotify_cleanup(s);
#endif
usb_mtp_object_free(s, QTAILQ_FIRST(&s->objects));
s->session = 0;
usb_mtp_data_free(s->data_in);
s->data_in = NU... | 10,700 |
qemu | 21e00fa55f3fdfcbb20da7c6876c91ef3609b387 | 0 | int vfio_region_mmap(VFIORegion *region)
{
int i, prot = 0;
char *name;
if (!region->mem) {
return 0;
}
prot |= region->flags & VFIO_REGION_INFO_FLAG_READ ? PROT_READ : 0;
prot |= region->flags & VFIO_REGION_INFO_FLAG_WRITE ? PROT_WRITE : 0;
for (i = 0; i < region->nr_... | 10,701 |
qemu | e8ede0a8bb5298a6979bcf7ed84ef64a64a4e3fe | 0 | float64 HELPER(ucf64_subd)(float64 a, float64 b, CPUUniCore32State *env)
{
return float64_sub(a, b, &env->ucf64.fp_status);
}
| 10,702 |
qemu | 7bd427d801e1e3293a634d3c83beadaa90ffb911 | 0 | static void text_console_do_init(CharDriverState *chr, DisplayState *ds)
{
TextConsole *s;
static int color_inited;
s = chr->opaque;
chr->chr_write = console_puts;
chr->chr_send_event = console_send_event;
s->out_fifo.buf = s->out_fifo_buf;
s->out_fifo.buf_size = sizeof(s->out_... | 10,703 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.