project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
FFmpeg | 9f61abc8111c7c43f49ca012e957a108b9cc7610 | 0 | static int init_file(AVFormatContext *s, OutputStream *os, int64_t start_ts)
{
int ret, i;
ret = avio_open2(&os->out, os->temp_filename, AVIO_FLAG_WRITE,
&s->interrupt_callback, NULL);
if (ret < 0)
return ret;
avio_wb32(os->out, 0);
avio_wl32(os->out, MKTAG('m','... | 12,219 |
FFmpeg | 4381bddc9f93da34a44e683bdc4c05c6f061244e | 0 | static inline void log_input_change(void *ctx, AVFilterLink *link, AVFilterBufferRef *ref)
{
char old_layout_str[16], new_layout_str[16];
av_get_channel_layout_string(old_layout_str, sizeof(old_layout_str),
-1, link->channel_layout);
av_get_channel_layout_string(new_lay... | 12,220 |
FFmpeg | ca00a7e809a4b9c9fb146403d278964b88d16b85 | 1 | static int decode_mime_header(AMRWBContext *ctx, const uint8_t *buf)
{
/* Decode frame header (1st octet) */
ctx->fr_cur_mode = buf[0] >> 3 & 0x0F;
ctx->fr_quality = (buf[0] & 0x4) != 0x4;
return 1;
}
| 12,221 |
FFmpeg | a4c32c9a63142b602820800742f2d543b58cd278 | 1 | static void init_entropy_decoder(APEContext *ctx)
{
/* Read the CRC */
ctx->CRC = bytestream_get_be32(&ctx->ptr);
/* Read the frame flags if they exist */
ctx->frameflags = 0;
if ((ctx->fileversion > 3820) && (ctx->CRC & 0x80000000)) {
ctx->CRC &= ~0x80000000;
ctx->framef... | 12,222 |
qemu | 0b8b8753e4d94901627b3e86431230f2319215c4 | 1 | static gboolean qio_channel_yield_enter(QIOChannel *ioc,
GIOCondition condition,
gpointer opaque)
{
QIOChannelYieldData *data = opaque;
qemu_coroutine_enter(data->co, NULL);
return FALSE;
}
| 12,223 |
qemu | 2a7f2630684ee556a394a354d64159a4470c0151 | 1 | void usb_ehci_realize(EHCIState *s, DeviceState *dev, Error **errp)
{
int i;
if (s->portnr > NB_PORTS) {
error_setg(errp, "Too many ports! Max. port number is %d.",
NB_PORTS);
usb_bus_new(&s->bus, sizeof(s->bus), s->companion_enable ?
&ehci_bus_op... | 12,224 |
qemu | bac05aa9a77af1ca7972c8dc07560f4daa7c2dfc | 1 | void qemu_system_guest_panicked(void)
{
qapi_event_send_guest_panicked(GUEST_PANIC_ACTION_PAUSE, &error_abort);
vm_stop(RUN_STATE_GUEST_PANICKED);
| 12,226 |
FFmpeg | 7da9f4523159670d577a2808d4481e64008a8894 | 1 | static void get_sub_picture(CinepakEncContext *s, int x, int y, AVPicture *in, AVPicture *out)
{
out->data[0] = in->data[0] + x + y * in->linesize[0];
out->linesize[0] = in->linesize[0];
if(s->pix_fmt == AV_PIX_FMT_YUV420P) {
out->data[1] = in->data[1] + (x >> 1) + (y >> 1) * in->linesize[1];... | 12,227 |
FFmpeg | 8d95eb6702b46cd07385c5478b10924ea78e6f18 | 1 | int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options)
{
int ret = 0;
AVDictionary *tmp = NULL;
if (avctx->extradata_size < 0 || avctx->extradata_size >= FF_MAX_EXTRADATA_SIZE)
return AVERROR(EINVAL);
if (options)
av_dict_copy(&tmp, *options,... | 12,228 |
qemu | efec3dd631d94160288392721a5f9c39e50fb2bc | 1 | static void cpu_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
CPUClass *k = CPU_CLASS(klass);
k->class_by_name = cpu_common_class_by_name;
k->reset = cpu_common_reset;
k->get_arch_id = cpu_common_get_arch_id;
k->get_paging_enabled = cpu_common_get_p... | 12,229 |
qemu | c78d65e8a7d87badf46eda3a0b41330f5d239132 | 1 | static int fill_note_info(struct elf_note_info *info,
long signr, const CPUArchState *env)
{
#define NUMNOTES 3
CPUState *cpu = ENV_GET_CPU((CPUArchState *)env);
TaskState *ts = (TaskState *)cpu->opaque;
int i;
info->notes = g_malloc0(NUMNOTES * sizeof (struct memelfno... | 12,230 |
qemu | 658ae5a7b90139a6a296cd4cd83643d843964796 | 1 | static uint16List **host_memory_append_node(uint16List **node,
unsigned long value)
{
*node = g_malloc0(sizeof(**node));
(*node)->value = value;
return &(*node)->next;
}
| 12,232 |
qemu | ddcb73b7782cb6104479503faea04cc224f982b5 | 1 | static int e1000_post_load(void *opaque, int version_id)
{
E1000State *s = opaque;
NetClientState *nc = qemu_get_queue(s->nic);
/* nc.link_down can't be migrated, so infer link_down according
* to link status bit in mac_reg[STATUS] */
nc->link_down = (s->mac_reg[STATUS] & E1000_STATUS_LU) =... | 12,233 |
qemu | 5e5a94b60518002e8ecc7afa78a9e7565b23e38f | 1 | bdrv_acct_start(BlockDriverState *bs, BlockAcctCookie *cookie, int64_t bytes,
enum BlockAcctType type)
{
assert(type < BDRV_MAX_IOTYPE);
cookie->bytes = bytes;
cookie->start_time_ns = get_clock();
cookie->type = type;
}
| 12,234 |
FFmpeg | f23a9759cee8442b02195a4539f65d041104c9cb | 1 | static int tcp_open(URLContext *h, const char *uri, int flags)
{
struct sockaddr_in dest_addr;
int port, fd = -1;
TCPContext *s = NULL;
fd_set wfds;
int fd_max, ret;
struct timeval tv;
socklen_t optlen;
char hostname[1024],proto[1024],path[1024],tmp[1024],*q;
if(!ff_netwo... | 12,235 |
FFmpeg | 963f76144897d3f7684d82ec21e51dd50ea1106e | 1 | static av_always_inline int even(uint64_t layout)
{
return (!layout || (layout & (layout - 1)));
}
| 12,236 |
qemu | 599d0c45615b7d099d256738a586d0f63bc707e6 | 1 | static int xen_host_pci_get_value(XenHostPCIDevice *d, const char *name,
unsigned int *pvalue, int base)
{
char path[PATH_MAX];
char buf[XEN_HOST_PCI_GET_VALUE_BUFFER_SIZE];
int fd, rc;
unsigned long value;
char *endptr;
rc = xen_host_pci_sysfs_path(d,... | 12,237 |
FFmpeg | 44729bc0204fd8bdc29c234fc663229e44420b09 | 1 | static int64_t mkv_write_seekhead(AVIOContext *pb, mkv_seekhead *seekhead)
{
ebml_master metaseek, seekentry;
int64_t currentpos;
int i;
currentpos = avio_tell(pb);
if (seekhead->reserved_size > 0)
if (avio_seek(pb, seekhead->filepos, SEEK_SET) < 0)
return -1;
... | 12,238 |
FFmpeg | c2a016ad4d9c29285813ba5806189e63e063e0fb | 1 | static int wavpack_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
WavpackContext *s = avctx->priv_data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
int frame_size;
int samplecount = ... | 12,239 |
FFmpeg | ddfa3751c092feaf1e080f66587024689dfe603c | 1 | static int get_bits(J2kDecoderContext *s, int n)
{
int res = 0;
if (s->buf_end - s->buf < ((n - s->bit_index) >> 8))
return AVERROR(EINVAL);
while (--n >= 0){
res <<= 1;
if (s->bit_index == 0){
s->bit_index = 7 + (*s->buf != 0xff);
s->buf++;
... | 12,240 |
qemu | 82a93a1d307064f35c363f79b04b0a0149ac53d9 | 1 | static uint32_t drc_set_usable(sPAPRDRConnector *drc)
{
/* if there's no resource/device associated with the DRC, there's
* no way for us to put it in an allocation state consistent with
* being 'USABLE'. PAPR 2.7, 13.5.3.4 documents that this should
* result in an RTAS return code of -3 / "no s... | 12,241 |
qemu | c9b83e9c23ecb094ddf987c7c37b8f454cb80615 | 1 | static ssize_t qcow2_crypto_hdr_init_func(QCryptoBlock *block, size_t headerlen,
void *opaque, Error **errp)
{
BlockDriverState *bs = opaque;
BDRVQcow2State *s = bs->opaque;
int64_t ret;
int64_t clusterlen;
ret = qcow2_alloc_clusters(bs, headerlen);... | 12,242 |
FFmpeg | c8ea5ccd5db125e24d46c74339c64f9527d7a72e | 1 | static int get_cookies(HTTPContext *s, char **cookies, const char *path,
const char *domain)
{
// cookie strings will look like Set-Cookie header field values. Multiple
// Set-Cookie fields will result in multiple values delimited by a newline
int ret = 0;
char *next, *cook... | 12,244 |
FFmpeg | 19e95b88459e879d3e67a66350d937c32ed762ca | 1 | static inline void xan_wc3_copy_pixel_run(XanContext *s,
int x, int y, int pixel_count, int motion_x, int motion_y)
{
int stride;
int line_inc;
int curframe_index, prevframe_index;
int curframe_x, prevframe_x;
int width = s->avctx->width;
unsigned char *palette_plane, *prev_palette_p... | 12,246 |
qemu | aca7aaf6287b6a9f688c1b115a76fdc056565a7e | 1 | pixman_format_code_t qemu_default_pixman_format(int bpp, bool native_endian)
{
if (native_endian) {
switch (bpp) {
case 15:
return PIXMAN_x1r5g5b5;
case 16:
return PIXMAN_r5g6b5;
case 24:
return PIXMAN_r8g8b8;
case 32:
... | 12,247 |
qemu | 61ed73cff427206b3a959b18a4877952f566279b | 1 | static ssize_t handle_aiocb_rw_linear(RawPosixAIOData *aiocb, char *buf)
{
ssize_t offset = 0;
ssize_t len;
while (offset < aiocb->aio_nbytes) {
if (aiocb->aio_type & QEMU_AIO_WRITE) {
len = pwrite(aiocb->aio_fildes,
(const char *)buf + offset,
... | 12,248 |
FFmpeg | 8d857c543402911f46ad38b093ab9aaf5b9a9a18 | 1 | static inline int get_block(GetBitContext *gb, DCTELEM *block, const uint8_t *scan,
const uint32_t *quant) {
int coeff, i, n;
int8_t ac;
uint8_t dc = get_bits(gb, 8);
// block not coded
if (dc == 255)
// number of non-zero coefficients
coeff = get_bits(gb, 6);
... | 12,249 |
qemu | 124fe7fb1b7a1db8cb2ebb9edae84716ffaf37ce | 1 | vcard_emul_find_vreader_from_slot(PK11SlotInfo *slot)
{
VReaderList *reader_list = vreader_get_reader_list();
VReaderListEntry *current_entry = NULL;
if (reader_list == NULL) {
return NULL;
}
for (current_entry = vreader_list_get_first(reader_list); current_entry;
... | 12,250 |
FFmpeg | 6bde1e9d14ff1e0ecff74b8ff59607f545c6f2ec | 0 | static int can_merge_formats(AVFilterFormats *a_arg,
AVFilterFormats *b_arg,
enum AVMediaType type,
int is_sample_rate)
{
AVFilterFormats *a, *b, *ret;
if (a == b)
return 1;
a = clone_filter_formats(a_arg)... | 12,251 |
FFmpeg | 7df3b426bbfbd7efd9a0f56393e3cc78413b0869 | 1 | static int mxf_write_partition(AVFormatContext *s, int bodysid,
int indexsid,
const uint8_t *key, int write_metadata)
{
MXFContext *mxf = s->priv_data;
AVIOContext *pb = s->pb;
int64_t header_byte_count_offset;
unsigned index_byte_co... | 12,252 |
qemu | 5f5a1318653c08e435cfa52f60b6a712815b659d | 1 | void virtio_config_writew(VirtIODevice *vdev, uint32_t addr, uint32_t data)
{
VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev);
uint16_t val = data;
if (addr > (vdev->config_len - sizeof(val)))
return;
stw_p(vdev->config + addr, val);
if (k->set_config) {
k->set_con... | 12,253 |
FFmpeg | ddfa3751c092feaf1e080f66587024689dfe603c | 1 | static uint8_t get_sot(J2kDecoderContext *s)
{
if (s->buf_end - s->buf < 4)
return AVERROR(EINVAL);
s->curtileno = bytestream_get_be16(&s->buf); ///< Isot
if((unsigned)s->curtileno >= s->numXtiles * s->numYtiles){
s->curtileno=0;
return AVERROR(EINVAL);
}
s->buf ... | 12,254 |
qemu | 09aaa1602f9381c0e0fb539390b1793e51bdfc7b | 1 | static void i6300esb_pc_init(PCIBus *pci_bus)
{
I6300State *d;
uint8_t *pci_conf;
if (!pci_bus) {
fprintf(stderr, "wdt_i6300esb: no PCI bus in this machine\n");
return;
}
d = (I6300State *)
pci_register_device (pci_bus, "i6300esb_wdt", sizeof (I6300State),
... | 12,256 |
qemu | 43d70ddf9f96b3ad037abe4d5f9f2768196b8c92 | 1 | static inline void cpu_loop_exec_tb(CPUState *cpu, TranslationBlock *tb,
TranslationBlock **last_tb, int *tb_exit,
SyncClocks *sc)
{
uintptr_t ret;
if (unlikely(atomic_read(&cpu->exit_request))) {
return;
}
trace... | 12,258 |
qemu | 6cec5487990bf3f1f22b3fcb871978255e92ae0d | 1 | static void vnc_dpy_update(DisplayState *ds, int x, int y, int w, int h)
{
VncState *vs = ds->opaque;
int i;
h += y;
/* round x down to ensure the loop only spans one 16-pixel block per,
iteration. otherwise, if (x % 16) != 0, the last iteration may span
two 16-pixel blocks but... | 12,260 |
qemu | f53c398aa603cea135ee58fd15249aeff7b9c7ea | 1 | static void musb_async_cancel_device(MUSBState *s, USBDevice *dev)
{
int ep, dir;
for (ep = 0; ep < 16; ep++) {
for (dir = 0; dir < 2; dir++) {
if (s->ep[ep].packey[dir].p.owner == NULL ||
s->ep[ep].packey[dir].p.owner->dev != dev) {
continue;
... | 12,261 |
qemu | aedbe19297907143f17b733a7ff0e0534377bed1 | 1 | int qemu_reset_requested_get(void)
{
return reset_requested;
}
| 12,262 |
FFmpeg | 075060023d978975ed5328e269d6e20163e669d2 | 1 | static void select_input_picture(MpegEncContext *s){
int i;
for(i=1; i<MAX_PICTURE_COUNT; i++)
s->reordered_input_picture[i-1]= s->reordered_input_picture[i];
s->reordered_input_picture[MAX_PICTURE_COUNT-1]= NULL;
/* set next picture type & ordering */
if(s->reordered_input_picture... | 12,263 |
qemu | 12848bfc5d719bad536c5448205a3226be1fda47 | 1 | static int local_chown(FsContext *fs_ctx, const char *path, FsCred *credp)
{
if ((credp->fc_uid == -1 && credp->fc_gid == -1) ||
(fs_ctx->fs_sm == SM_PASSTHROUGH)) {
return lchown(rpath(fs_ctx, path), credp->fc_uid, credp->fc_gid);
} else if (fs_ctx->fs_sm == SM_MAPPED) {
retur... | 12,264 |
FFmpeg | d7e9533aa06f4073a27812349b35ba5fede11ca1 | 1 | static void encode_mb(MpegEncContext *s, int motion_x, int motion_y)
{
const int mb_x= s->mb_x;
const int mb_y= s->mb_y;
int i;
#if 0
if (s->interlaced_dct) {
dct_linesize = s->linesize * 2;
dct_offset = s->linesize;
} else {
dct_linesize = s->li... | 12,265 |
qemu | ded67782e6d06069873adce7f9074d273ae75760 | 1 | static int acpi_load_old(QEMUFile *f, void *opaque, int version_id)
{
PIIX4PMState *s = opaque;
int ret, i;
uint16_t temp;
ret = pci_device_load(&s->dev, f);
if (ret < 0) {
return ret;
}
qemu_get_be16s(f, &s->ar.pm1.evt.sts);
qemu_get_be16s(f, &s->ar.pm1.evt.en);
... | 12,266 |
qemu | 8be7e7e4c72c048b90e3482557954a24bba43ba7 | 1 | static int debugcon_parse(const char *devname)
{
QemuOpts *opts;
if (!qemu_chr_new("debugcon", devname, NULL)) {
exit(1);
}
opts = qemu_opts_create(qemu_find_opts("device"), "debugcon", 1);
if (!opts) {
fprintf(stderr, "qemu: already have a debugcon device\n");
... | 12,267 |
qemu | e13e973eedba0a52b4b8b079c4b85cdc68b7b4f0 | 1 | static CCIDBus *ccid_bus_new(DeviceState *dev)
{
CCIDBus *bus;
bus = FROM_QBUS(CCIDBus, qbus_create(&ccid_bus_info, dev, NULL));
bus->qbus.allow_hotplug = 1;
return bus;
}
| 12,268 |
qemu | e12ed72e5c00dd3375b8bd107200e4d7e950276a | 1 | bool bitmap_test_and_clear_atomic(unsigned long *map, long start, long nr)
{
unsigned long *p = map + BIT_WORD(start);
const long size = start + nr;
int bits_to_clear = BITS_PER_LONG - (start % BITS_PER_LONG);
unsigned long mask_to_clear = BITMAP_FIRST_WORD_MASK(start);
unsigned long dirty = 0;
... | 12,269 |
FFmpeg | bf29794022db597f526a8575648244a7c6ee15ed | 1 | int ff_dca_lbr_parse(DCALbrDecoder *s, uint8_t *data, DCAExssAsset *asset)
{
struct {
LBRChunk lfe;
LBRChunk tonal;
LBRChunk tonal_grp[5];
LBRChunk grid1[DCA_LBR_CHANNELS / 2];
LBRChunk hr_grid[DCA_LBR_CHANNELS / 2];
LBRChunk ts1[DCA_LBR_CHAN... | 12,270 |
qemu | 8b6b2afcf85dd5ff33075e93a2e30fbea34c5a55 | 1 | static int blk_mig_save_bulked_block(Monitor *mon, QEMUFile *f)
{
int64_t completed_sector_sum = 0;
BlkMigDevState *bmds;
int progress;
int ret = 0;
QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
if (bmds->bulk_completed == 0) {
if (mig_save_device_bulk(mon... | 12,271 |
qemu | ce675a7579fea498397c5d2da3c5367671e9f02a | 1 | int net_init_tap(const NetClientOptions *opts, const char *name,
NetClientState *peer)
{
const NetdevTapOptions *tap;
int fd, vnet_hdr = 0, i = 0, queues;
/* for the no-fd, no-helper case */
const char *script = NULL; /* suppress wrong "uninit'd use" gcc warning */
const char *downs... | 12,272 |
FFmpeg | eae63e3c156f784ee0612422f0c95131ea913c14 | 1 | static int get_qcc(Jpeg2000DecoderContext *s, int n, Jpeg2000QuantStyle *q,
uint8_t *properties)
{
int compno;
if (bytestream2_get_bytes_left(&s->g) < 1)
return AVERROR_INVALIDDATA;
compno = bytestream2_get_byteu(&s->g);
properties[compno] |= HAD_QCC;
... | 12,274 |
qemu | e638073c569e801ce9def2016a84f955cbbca779 | 1 | static void vfio_pci_load_rom(VFIODevice *vdev)
{
struct vfio_region_info reg_info = {
.argsz = sizeof(reg_info),
.index = VFIO_PCI_ROM_REGION_INDEX
};
uint64_t size;
off_t off = 0;
size_t bytes;
if (ioctl(vdev->fd, VFIO_DEVICE_GET_REGION_INFO, ®_info)) {
e... | 12,275 |
qemu | e89720b116131938fe3d4931302f69a28249c934 | 1 | static void tcg_out_op (TCGContext *s, TCGOpcode opc, const TCGArg *args,
const int *const_args)
{
int c;
switch (opc) {
case INDEX_op_exit_tb:
tcg_out_movi (s, TCG_TYPE_I64, TCG_REG_R3, args[0]);
tcg_out_b (s, 0, (tcg_target_long) tb_ret_addr);
brea... | 12,276 |
qemu | b47b35250fbfa062aedf6ab6e5faab84c4a76f4f | 1 | static int fdctrl_init_common(FDCtrl *fdctrl)
{
int i, j;
static int command_tables_inited = 0;
/* Fill 'command_to_handler' lookup table */
if (!command_tables_inited) {
command_tables_inited = 1;
for (i = ARRAY_SIZE(handlers) - 1; i >= 0; i--) {
for (j = 0; j < si... | 12,277 |
qemu | a1f0cce2ac0243572ff72aa561da67fe3766a395 | 1 | static int32_t scsi_send_command(SCSIRequest *req, uint8_t *cmd)
{
SCSIGenericState *s = DO_UPCAST(SCSIGenericState, qdev, req->dev);
SCSIGenericReq *r = DO_UPCAST(SCSIGenericReq, req, req);
int ret;
scsi_req_enqueue(req);
if (cmd[0] != REQUEST_SENSE &&
(req->lun != s->lun || (cmd[1... | 12,279 |
qemu | bdd81addf4033ce26e6cd180b060f63095f3ded9 | 1 | static void vfio_probe_ati_bar2_quirk(VFIOPCIDevice *vdev, int nr)
{
VFIOQuirk *quirk;
VFIOConfigMirrorQuirk *mirror;
/* Only enable on newer devices where BAR2 is 64bit */
if (!vfio_pci_is(vdev, PCI_VENDOR_ID_ATI, PCI_ANY_ID) ||
!vdev->has_vga || nr != 2 || !vdev->bars[2].mem64) {
... | 12,280 |
FFmpeg | 5e1bf9d8c0d2cdbbf17b06a5dfdf87a635b3203b | 1 | static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup)
{
pkt->data = NULL;
pkt->side_data = NULL;
if (pkt->buf) {
AVBufferRef *ref = av_buffer_ref(src->buf);
if (!ref)
return AVERROR(ENOMEM);
pkt->buf = ref;
pkt->data = ref->data;
... | 12,282 |
FFmpeg | 928cfc7e4f42aa283bb1bd9a50f0b3caa5a0f7a5 | 1 | static void ffm_seek1(AVFormatContext *s, int64_t pos1)
{
FFMContext *ffm = s->priv_data;
AVIOContext *pb = s->pb;
int64_t pos;
pos = FFMIN(pos1, ffm->file_size - FFM_PACKET_SIZE);
pos = FFMAX(pos, FFM_PACKET_SIZE);
av_dlog(s, "seek to %"PRIx64" -> %"PRIx64"\n", pos1, pos);
avio_se... | 12,283 |
FFmpeg | b92b4775a0d07cacfdd2b4be6511f3cb362c977b | 1 | int ff_h264_decode_ref_pic_list_reordering(H264Context *h, H264SliceContext *sl)
{
int list, index, pic_structure;
print_short_term(h);
print_long_term(h);
h264_initialise_ref_list(h, sl);
for (list = 0; list < sl->list_count; list++) {
if (get_bits1(&sl->gb)) { // ref_pic_li... | 12,284 |
FFmpeg | 2bd8eb05d21b582d627a93852b59cb3cfc305dae | 1 | static inline void dxt5_block_internal(uint8_t *dst, ptrdiff_t stride,
const uint8_t *block)
{
int x, y;
uint32_t colors[4];
uint8_t alpha_indices[16];
uint16_t color0 = AV_RL16(block + 8);
uint16_t color1 = AV_RL16(block + 10);
uint32_t code = AV... | 12,285 |
qemu | d9bce9d99f4656ae0b0127f7472db9067b8f84ab | 1 | void OPPROTO op_POWER_sre (void)
{
T1 &= 0x1FUL;
env->spr[SPR_MQ] = rotl32(T0, 32 - T1);
T0 = Ts0 >> T1;
RETURN();
}
| 12,286 |
FFmpeg | 631f7484918a9e7260377c3cea878be708609e64 | 1 | static int h263_decode_block(MpegEncContext * s, int16_t * block,
int n, int coded)
{
int level, i, j, run;
RLTable *rl = &ff_h263_rl_inter;
const uint8_t *scan_table;
GetBitContext gb= s->gb;
scan_table = s->intra_scantable.permutated;
if (s->h263_aic && s... | 12,287 |
qemu | 5839e53bbc0fec56021d758aab7610df421ed8c8 | 1 | void bdrv_op_block(BlockDriverState *bs, BlockOpType op, Error *reason)
{
BdrvOpBlocker *blocker;
assert((int) op >= 0 && op < BLOCK_OP_TYPE_MAX);
blocker = g_malloc0(sizeof(BdrvOpBlocker));
blocker->reason = reason;
QLIST_INSERT_HEAD(&bs->op_blockers[op], blocker, list);
}
| 12,288 |
qemu | 79218be42b835cbc7bd1b0fbd07d115add6e7605 | 1 | TraceEvent *trace_event_iter_next(TraceEventIter *iter)
{
while (iter->event < TRACE_EVENT_COUNT) {
TraceEvent *ev = &(trace_events[iter->event]);
iter->event++;
if (!iter->pattern ||
pattern_glob(iter->pattern,
trace_event_get_name(ev))) {
... | 12,289 |
FFmpeg | 8db2935db0caa8efbef009994920ef6a20289496 | 1 | static av_cold int ape_decode_init(AVCodecContext *avctx)
{
APEContext *s = avctx->priv_data;
int i;
if (avctx->extradata_size != 6) {
av_log(avctx, AV_LOG_ERROR, "Incorrect extradata\n");
return AVERROR(EINVAL);
}
if (avctx->channels > 2) {
av_log(avctx, AV_LOG_ER... | 12,290 |
FFmpeg | 1693336aed3988e0c13ad1ff880257d80d6ae69d | 1 | static double lfo_get_value(SimpleLFO *lfo)
{
double phs = FFMIN(100, lfo->phase / FFMIN(1.99, FFMAX(0.01, lfo->pwidth)) + lfo->offset);
double val;
if (phs > 1)
phs = fmod(phs, 1.);
switch (lfo->mode) {
case SINE:
val = sin(phs * 2 * M_PI);
break;
case TRIA... | 12,291 |
FFmpeg | 90fc00a623de44e137fe1601b91356e8cd8bdd54 | 1 | static int srt_get_duration(uint8_t **buf)
{
int i, duration = 0;
for (i=0; i<2 && !duration; i++) {
int s_hour, s_min, s_sec, s_hsec, e_hour, e_min, e_sec, e_hsec;
if (sscanf(*buf, "%d:%2d:%2d%*1[,.]%3d --> %d:%2d:%2d%*1[,.]%3d",
&s_hour, &s_min, &s_sec, &s_hsec,
... | 12,292 |
FFmpeg | c8241e730f116f1c9cfc0b34110aa7f052e05332 | 0 | static int vaapi_encode_mjpeg_init_picture_params(AVCodecContext *avctx,
VAAPIEncodePicture *pic)
{
VAAPIEncodeContext *ctx = avctx->priv_data;
VAEncPictureParameterBufferJPEG *vpic = pic->codec_picture_params;
VAAPIEncodeMJPEGContext ... | 12,293 |
FFmpeg | d574e22659bd51cdf16723a204fef65a9e783f1d | 0 | static int hdcd_scan(HDCDContext *ctx, hdcd_state_t *state, const int32_t *samples, int max, int stride)
{
int cdt_active = 0;
/* code detect timer */
int result;
if (state->sustain > 0) {
cdt_active = 1;
if (state->sustain <= max) {
state->control = 0;
m... | 12,294 |
FFmpeg | d3e18ad02795f9761b7e5a5c018dfef786046acf | 0 | static int swf_write_audio(AVFormatContext *s,
AVCodecContext *enc, const uint8_t *buf, int size)
{
SWFContext *swf = s->priv_data;
int c = 0;
/* Flash Player limit */
if ( swf->swf_frame_number >= 16000 ) {
return 0;
}
if (enc->codec_id == CODEC_... | 12,295 |
FFmpeg | de1b1a7da9e6ddf42447271e519099a88b389e4a | 0 | static int64_t mp3_sync(AVFormatContext *s, int64_t target_pos, int flags)
{
int dir = (flags&AVSEEK_FLAG_BACKWARD) ? -1 : 1;
int64_t best_pos;
int best_score, i, j;
int64_t ret;
avio_seek(s->pb, FFMAX(target_pos - SEEK_WINDOW, 0), SEEK_SET);
ret = avio_seek(s->pb, target_pos, SEEK_SET)... | 12,296 |
qemu | 541dc0d47f10973c241e9955afc2aefc96adec51 | 0 | void test_segs(void)
{
struct modify_ldt_ldt_s ldt;
long long ldt_table[3];
int res, res2;
char tmp;
struct {
uint32_t offset;
uint16_t seg;
} __attribute__((packed)) segoff;
ldt.entry_number = 1;
ldt.base_addr = (unsigned long)&seg_data1;
ldt.limit = (s... | 12,297 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | static void cpu_notify_map_clients(void)
{
MapClient *client;
while (!LIST_EMPTY(&map_client_list)) {
client = LIST_FIRST(&map_client_list);
client->callback(client->opaque);
cpu_unregister_map_client(client);
}
}
| 12,299 |
qemu | 1687a089f103f9b7a1b4a1555068054cb46ee9e9 | 0 | vcard_free(VCard *vcard)
{
VCardApplet *current_applet = NULL;
VCardApplet *next_applet = NULL;
if (vcard == NULL) {
return;
}
vcard->reference_count--;
if (vcard->reference_count != 0) {
return;
}
if (vcard->vcard_private_free) {
(*vcard->vcard_priv... | 12,300 |
qemu | 36778660d7fd0748a6129916e47ecedd67bdb758 | 0 | static inline bool valid_ptex(PowerPCCPU *cpu, target_ulong ptex)
{
/*
* hash value/pteg group index is normalized by htab_mask
*/
if (((ptex & ~7ULL) / HPTES_PER_GROUP) & ~cpu->env.htab_mask) {
return false;
}
return true;
}
| 12,301 |
qemu | cd42d5b23691ad73edfd6dbcfc935a960a9c5a65 | 0 | gen_intermediate_code_internal(SuperHCPU *cpu, TranslationBlock *tb,
bool search_pc)
{
CPUState *cs = CPU(cpu);
CPUSH4State *env = &cpu->env;
DisasContext ctx;
target_ulong pc_start;
static uint16_t *gen_opc_end;
CPUBreakpoint *bp;
int i, ii;
int ... | 12,302 |
qemu | e389be1673052b538534643165111725a79e5afd | 0 | static uint32_t get_level1_table_address(CPUARMState *env, uint32_t address)
{
uint32_t table;
if (address & env->cp15.c2_mask)
table = env->cp15.ttbr1_el1 & 0xffffc000;
else
table = env->cp15.ttbr0_el1 & env->cp15.c2_base_mask;
table |= (address >> 18) & 0x3ffc;
return t... | 12,303 |
qemu | c650c008e326f3a1e84083bc269265456057a212 | 0 | static int do_setcontext(struct target_ucontext *ucp, CPUPPCState *env, int sig)
{
struct target_mcontext *mcp;
target_ulong mcp_addr;
sigset_t blocked;
target_sigset_t set;
if (copy_from_user(&set, h2g(ucp) + offsetof(struct target_ucontext, tuc_sigmask),
sizeof (set... | 12,304 |
qemu | d42cf28837801cd1f835089fe9db2a42a1af55cd | 0 | static void bdrv_co_drain_bh_cb(void *opaque)
{
BdrvCoDrainData *data = opaque;
Coroutine *co = data->co;
BlockDriverState *bs = data->bs;
bdrv_dec_in_flight(bs);
bdrv_drain_poll(bs);
data->done = true;
qemu_coroutine_enter(co);
}
| 12,306 |
qemu | c2b38b277a7882a592f4f2ec955084b2b756daaa | 0 | QEMUTimerList *timerlist_new(QEMUClockType type,
QEMUTimerListNotifyCB *cb,
void *opaque)
{
QEMUTimerList *timer_list;
QEMUClock *clock = qemu_clock_ptr(type);
timer_list = g_malloc0(sizeof(QEMUTimerList));
qemu_event_init(&timer_list->t... | 12,309 |
qemu | a7be9bad33d81d4bab2a51935b5443d258e7d082 | 0 | void cpu_check_irqs(CPUSPARCState *env)
{
uint32_t pil = env->pil_in |
(env->softint & ~(SOFTINT_TIMER | SOFTINT_STIMER));
/* check if TM or SM in SOFTINT are set
setting these also causes interrupt 14 */
if (env->softint & (SOFTINT_TIMER | SOFTINT_STIMER)) {
pil |=... | 12,311 |
qemu | 0ab07c623c629acfbc792e5a174129c19faefbb7 | 0 | static void *qemu_kvm_cpu_thread_fn(void *arg)
{
CPUState *env = arg;
int r;
qemu_mutex_lock(&qemu_global_mutex);
qemu_thread_self(env->thread);
r = kvm_init_vcpu(env);
if (r < 0) {
fprintf(stderr, "kvm_init_vcpu failed: %s\n", strerror(-r));
exit(1);
}
q... | 12,312 |
qemu | f0267ef7115656119bf00ed77857789adc036bda | 0 | static long do_sigreturn_v2(CPUARMState *env)
{
abi_ulong frame_addr;
struct sigframe_v2 *frame = NULL;
/*
* Since we stacked the signal on a 64-bit boundary,
* then 'sp' should be word aligned here. If it's
* not, then the user is trying to mess with us.
*/
frame_addr = ... | 12,313 |
qemu | 364031f17932814484657e5551ba12957d993d7e | 0 | static int v9fs_synth_open(FsContext *ctx, V9fsPath *fs_path,
int flags, V9fsFidOpenState *fs)
{
V9fsSynthOpenState *synth_open;
V9fsSynthNode *node = *(V9fsSynthNode **)fs_path->data;
synth_open = g_malloc(sizeof(*synth_open));
synth_open->node = node;
node->open... | 12,315 |
FFmpeg | 3ebc7e04dea6072400d91c1c90eb3911754cee06 | 0 | static void filter_mb_edgecv( H264Context *h, uint8_t *pix, int stride, int bS[4], int qp ) {
int i, d;
const int index_a = clip( qp + h->slice_alpha_c0_offset, 0, 51 );
const int alpha = alpha_table[index_a];
const int beta = beta_table[clip( qp + h->slice_beta_offset, 0, 51 )];
for( i = 0;... | 12,316 |
qemu | e3f5ec2b5e92706e3b807059f79b1fb5d936e567 | 0 | static void rtl8139_transfer_frame(RTL8139State *s, const uint8_t *buf, int size, int do_interrupt)
{
if (!size)
{
DEBUG_PRINT(("RTL8139: +++ empty ethernet frame\n"));
return;
}
if (TxLoopBack == (s->TxConfig & TxLoopBack))
{
DEBUG_PRINT(("RTL8139: +++ transmit lo... | 12,318 |
qemu | a0fa2cb8ccf0b73cfd3ac01d557401a2303c0de4 | 0 | static void sclp_execute(SCCB *sccb, uint64_t code)
{
S390SCLPDevice *sdev = get_event_facility();
switch (code & SCLP_CMD_CODE_MASK) {
case SCLP_CMDW_READ_SCP_INFO:
case SCLP_CMDW_READ_SCP_INFO_FORCED:
read_SCP_info(sccb);
break;
case SCLP_CMDW_READ_CPU_INFO:
sclp... | 12,319 |
qemu | 88b062c2036cfd05b5111147736a08ba05ea05a9 | 0 | static int blk_prw(BlockBackend *blk, int64_t offset, uint8_t *buf,
int64_t bytes, CoroutineEntry co_entry,
BdrvRequestFlags flags)
{
AioContext *aio_context;
QEMUIOVector qiov;
struct iovec iov;
Coroutine *co;
BlkRwCo rwco;
iov = (struct iovec) {... | 12,321 |
qemu | ad9579aaa16d5b385922d49edac2c96c79bcfb62 | 0 | static int unix_listen_saddr(UnixSocketAddress *saddr,
bool update_addr,
Error **errp)
{
struct sockaddr_un un;
int sock, fd;
sock = qemu_socket(PF_UNIX, SOCK_STREAM, 0);
if (sock < 0) {
error_setg_errno(errp, errno, "Failed to ... | 12,323 |
qemu | b49f7ead8d222bcb8df0388f3177002f3e33d046 | 0 | static void mirror_start_job(const char *job_id, BlockDriverState *bs,
BlockDriverState *target, const char *replaces,
int64_t speed, uint32_t granularity,
int64_t buf_size,
BlockMirrorBackingMode bac... | 12,324 |
FFmpeg | b785c62681a0a5a330b065e0754d27a313c44c8e | 0 | int RENAME(swri_resample)(ResampleContext *c, DELEM *dst, const DELEM *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;
av... | 12,327 |
qemu | 8d999995e45c1002aa11f269c98f2e93e6f8c42a | 0 | static uint32_t gic_dist_readb(void *opaque, hwaddr offset)
{
GICState *s = (GICState *)opaque;
uint32_t res;
int irq;
int i;
int cpu;
int cm;
int mask;
cpu = gic_get_current_cpu(s);
cm = 1 << cpu;
if (offset < 0x100) {
if (offset == 0)
return s... | 12,328 |
qemu | 856d72454f03aea26fd61c728762ef9cd1d71512 | 0 | MemoryRegionSection memory_region_find(MemoryRegion *mr,
hwaddr addr, uint64_t size)
{
MemoryRegionSection ret = { .mr = NULL };
MemoryRegion *root;
AddressSpace *as;
AddrRange range;
FlatView *view;
FlatRange *fr;
addr += mr->addr;
for ... | 12,330 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void omap_tcmi_write(void *opaque, target_phys_addr_t addr,
uint64_t value, unsigned size)
{
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque;
if (size != 4) {
return omap_badwidth_write32(opaque, addr, value);
}
switch (addr) {
c... | 12,331 |
FFmpeg | d6604b29ef544793479d7fb4e05ef6622bb3e534 | 0 | static av_cold int xbm_encode_init(AVCodecContext *avctx)
{
avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame)
return AVERROR(ENOMEM);
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
return 0;
}
| 12,332 |
FFmpeg | d1adad3cca407f493c3637e20ecd4f7124e69212 | 0 | static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
long width, long height,
long lumStride, long chromStride, long dstStride, long vertLumPerChroma)
{
long y... | 12,333 |
FFmpeg | 0544c95fd6d0e3c1072554f9d13baf45af7fbf56 | 0 | DECL_IMDCT_BLOCKS(sse,sse)
#endif
DECL_IMDCT_BLOCKS(sse2,sse)
DECL_IMDCT_BLOCKS(sse3,sse)
DECL_IMDCT_BLOCKS(ssse3,sse)
#endif
#if HAVE_AVX_EXTERNAL
DECL_IMDCT_BLOCKS(avx,avx)
#endif
#endif /* HAVE_YASM */
av_cold void ff_mpadsp_init_x86(MPADSPContext *s)
{
int cpu_flags = av_get_cpu_flags();
in... | 12,334 |
FFmpeg | 9729f140ae073f1df2041b6c5fd2068592eb9c48 | 1 | static void dirac_unpack_block_motion_data(DiracContext *s)
{
GetBitContext *gb = &s->gb;
uint8_t *sbsplit = s->sbsplit;
int i, x, y, q, p;
DiracArith arith[8];
align_get_bits(gb);
/* [DIRAC_STD] 11.2.4 and 12.2.1 Number of blocks and superblocks */
s->sbwidth = DIVRNDUP(s->sour... | 12,335 |
FFmpeg | d1916d13e28b87f4b1b214231149e12e1d536b4b | 1 | static void add_bytes_c(uint8_t *dst, uint8_t *src, int w){
long i;
for(i=0; i<=w-sizeof(long); i+=sizeof(long)){
long a = *(long*)(src+i);
long b = *(long*)(dst+i);
*(long*)(dst+i) = ((a&pb_7f) + (b&pb_7f)) ^ ((a^b)&pb_80);
}
for(; i<w; i++)
dst[i+0] += src[i+0];... | 12,336 |
qemu | 3026c4688ca80d9c5cc1606368c4a1009a6f507d | 1 | static int write_f(BlockBackend *blk, int argc, char **argv)
{
struct timeval t1, t2;
bool Cflag = false, qflag = false, bflag = false;
bool Pflag = false, zflag = false, cflag = false;
int flags = 0;
int c, cnt;
char *buf = NULL;
int64_t offset;
int64_t count;
/* Some comp... | 12,337 |
FFmpeg | 5e715b583dab85735660b15a8d217a69164675fe | 1 | static int parse_audio(DBEContext *s, int start, int end, int seg_id)
{
int ch, ret, key = parse_key(s);
for (ch = start; ch < end; ch++) {
if (!s->ch_size[ch]) {
s->channels[seg_id][ch].nb_groups = 0;
continue;
}
if ((ret = convert_input(s, s->ch_size[c... | 12,338 |
qemu | 77b0359bf414ad666d1714dc9888f1017c08e283 | 1 | static void qemu_input_queue_process(void *opaque)
{
struct QemuInputEventQueueHead *queue = opaque;
QemuInputEventQueue *item;
g_assert(!QTAILQ_EMPTY(queue));
item = QTAILQ_FIRST(queue);
g_assert(item->type == QEMU_INPUT_QUEUE_DELAY);
QTAILQ_REMOVE(queue, item, node);
g_free(item... | 12,339 |
qemu | af103c9310b7ab56a2552965d9d1274b0024f27b | 1 | static void vhost_scsi_unrealize(DeviceState *dev, Error **errp)
{
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
VHostSCSI *s = VHOST_SCSI(dev);
migrate_del_blocker(s->migration_blocker);
error_free(s->migration_blocker);
/* This will stop vhost backend. */
vhost_scsi_set_status(vdev, 0);
... | 12,340 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.